-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/add payroll support #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Anidem1995
wants to merge
16
commits into
main
Choose a base branch
from
feat/AddPayrollSupport
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+6,798
−327
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
710323f
Added payroll support
Anidem1995 b44aa40
Added enums for stamp transaction. Organized examples code. Final rou…
Anidem1995 08936cb
Fixed app version and a typo in pom.xml
Anidem1995 b4795c7
Removed all fully references to BigDecimal
Anidem1995 429a925
Removed unused imports. Fixed naming issue with Stamp Service methods
Anidem1995 1a41879
fixed missconsistency on employer and employee services
Anidem1995 1b20719
Fixed problems created by breaking changes on setting BigDecimal and …
Anidem1995 7c5cf80
Fixed typo in EmployerService endpoint
Anidem1995 9d99589
updated README.md
Anidem1995 23320d5
Fixed typo in TransactionStatus setter
Anidem1995 7191d3a
Removed sensitive data used for testing
Anidem1995 474367b
Added stock options to payroll earnings
Anidem1995 cac3403
Code refactoring
Anidem1995 a2637ce
Fixed technic debt in employee and employer services
Anidem1995 1238d92
Fixed jackson serialization errors
Anidem1995 84624b5
Fixed insecure BigDecimal parsing
Anidem1995 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Project Overview | ||
|
|
||
| Official Java SDK for FiscalAPI - a Mexican CFDI electronic invoicing service (SAT integration). Provides CFDI 4.0 invoicing, certificate management, mass downloads, payroll, and SAT catalog queries. | ||
|
|
||
| ## Build Commands | ||
|
|
||
| ```bash | ||
| mvn clean compile # Compile | ||
| mvn test # Run tests | ||
| mvn package # Create JAR | ||
| mvn clean deploy -Prelease # Deploy to Maven Central (requires GPG) | ||
| ``` | ||
|
|
||
| ## Architecture | ||
|
|
||
| ### Entry Point | ||
| `FiscalApiClient.create(FiscalApiSettings)` - Factory method creating the main client with all services. | ||
|
|
||
| ### Service Layer Pattern | ||
| ``` | ||
| IFiscalApiClient (facade) | ||
| ├── getInvoiceService() → IInvoiceService extends IFiscalApiService<Invoice> | ||
| ├── getPersonService() → IPersonService extends IFiscalApiService<Person> | ||
| ├── getProductService() → IProductService extends IFiscalApiService<Product> | ||
| ├── getTaxFileService() → ITaxFileService extends IFiscalApiService<TaxFile> | ||
| ├── getCatalogService() → ICatalogService extends IFiscalApiService<CatalogDto> | ||
| └── ... (other services) | ||
| ``` | ||
|
|
||
| ### Generic CRUD Base | ||
| All services extend `BaseFiscalApiService<T>` which implements standard CRUD: | ||
| - `getList(pageNumber, pageSize)` → `ApiResponse<PagedList<T>>` | ||
| - `getById(id, details)` → `ApiResponse<T>` | ||
| - `create(model)` → `ApiResponse<T>` | ||
| - `update(model)` → `ApiResponse<T>` | ||
| - `delete(id)` → `ApiResponse<Boolean>` | ||
|
|
||
| Subclasses must implement `getTypeParameterClass()` to return the entity type for Jackson deserialization. | ||
|
|
||
| ### DTO Hierarchy | ||
| ``` | ||
| SerializableDto → AuditableDto (createdAt, updatedAt) → BaseDto (id) | ||
| ``` | ||
| All models extend `BaseDto`. Responses wrapped in `ApiResponse<T>`. | ||
|
|
||
| ### HTTP Layer | ||
| - `OkHttpClientFactory` - Creates/caches OkHttpClient instances with auth headers (X-API-KEY, X-TENANT-KEY, X-API-VERSION, X-TIMEZONE) | ||
| - `FiscalApiHttpClient` - Wraps OkHttp with Jackson, handles request/response logging in debug mode | ||
|
|
||
| ### Key Packages | ||
| - `abstractions/` - Service interfaces | ||
| - `common/` - ApiResponse, PagedList, settings | ||
| - `http/` - HTTP client implementation | ||
| - `models/` - All DTOs (invoicing/, downloading/ subpackages) | ||
| - `services/` - Service implementations | ||
|
|
||
| ## Configuration | ||
|
|
||
| ```java | ||
| FiscalApiSettings settings = new FiscalApiSettings(); | ||
| settings.setApiUrl("https://test.fiscalapi.com"); // or https://live.fiscalapi.com | ||
| settings.setApiKey("sk_test_..."); | ||
| settings.setTenant("..."); | ||
| settings.setDebugMode(true); // Logs requests/responses | ||
| FiscalApiClient client = FiscalApiClient.create(settings); | ||
| ``` | ||
|
|
||
| ## API Endpoint Pattern | ||
|
|
||
| `{apiUrl}/api/{apiVersion}/{resource}/{id?}/{action?}` | ||
|
|
||
| Example: `POST api/v4/invoices`, `GET api/v4/invoices/{id}?details=true` | ||
|
|
||
| ## Dependencies | ||
|
|
||
| - OkHttp3 4.12.0 (HTTP) | ||
| - Jackson 2.14.2 (JSON) | ||
| - Java 8+ (source/target) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pom.xml version was bumped from 4.0.273 to 4.0.360, but this PR introduces multiple source/binary breaking API changes (e.g., many setters changing from Double to String/BigDecimal, new methods with different naming). If you follow semantic versioning for the SDK, this should be a major/minor bump or the API changes should be made backwards-compatible (overloads/deprecations).