diff --git a/CHANGELOG.md b/CHANGELOG.md index 61cd353..9335b7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.3.0] - 2026-10-07 + +### Added + +- Add `nominaCatalogs().searchDeductions` and `nominaCatalogs().searchPerceptions` to search the SAT payroll deduction and perception catalogs. + ## [2.2.0] - 2026-09-09 ### Added diff --git a/README.es.md b/README.es.md index d5ba3bd..18f6b03 100644 --- a/README.es.md +++ b/README.es.md @@ -62,6 +62,13 @@ var invoice = facturapi.invoices().create(Map.of( System.out.println(invoice.getId()); ``` +## Catálogos de nómina + +```java +var deductions = facturapi.nominaCatalogs().searchDeductions(Map.of("q", "001")); +var perceptions = facturapi.nominaCatalogs().searchPerceptions(Map.of("q", "001")); +``` + ## Subidas ```java diff --git a/README.md b/README.md index b2ca541..a21c96e 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,13 @@ var invoice = facturapi.invoices().create(Map.of( System.out.println(invoice.getId()); ``` +## Payroll catalogs + +```java +var deductions = facturapi.nominaCatalogs().searchDeductions(Map.of("q", "001")); +var perceptions = facturapi.nominaCatalogs().searchPerceptions(Map.of("q", "001")); +``` + ## Uploads ```java diff --git a/pom.xml b/pom.xml index 2a1fa3f..40a1b17 100644 --- a/pom.xml +++ b/pom.xml @@ -1,11 +1,10 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 io.facturapi facturapi-java - 2.2.0 + 2.3.0 facturapi-java Official Java SDK for Facturapi https://github.com/facturapi/facturapi-java diff --git a/src/main/java/io/facturapi/Facturapi.java b/src/main/java/io/facturapi/Facturapi.java index 13403cf..770f2b0 100644 --- a/src/main/java/io/facturapi/Facturapi.java +++ b/src/main/java/io/facturapi/Facturapi.java @@ -17,6 +17,7 @@ import io.facturapi.tools.CartaPorteCatalogsTool; import io.facturapi.tools.CatalogsTool; import io.facturapi.tools.ComercioExteriorCatalogsTool; +import io.facturapi.tools.NominaCatalogsTool; import io.facturapi.tools.ToolsResource; import java.time.Duration; @@ -34,6 +35,7 @@ public class Facturapi { private final CatalogsTool catalogs; private final CartaPorteCatalogsTool cartaPorteCatalogs; private final ComercioExteriorCatalogsTool comercioExteriorCatalogs; + private final NominaCatalogsTool nominaCatalogs; private final ToolsResource tools; /** @@ -73,6 +75,7 @@ public Facturapi(FacturapiConfig config) { this.catalogs = new CatalogsTool(httpClient); this.cartaPorteCatalogs = new CartaPorteCatalogsTool(httpClient); this.comercioExteriorCatalogs = new ComercioExteriorCatalogsTool(httpClient); + this.nominaCatalogs = new NominaCatalogsTool(httpClient); this.tools = new ToolsResource(httpClient); } @@ -126,6 +129,10 @@ public ComercioExteriorCatalogsTool comercioExteriorCatalogs() { return comercioExteriorCatalogs; } + public NominaCatalogsTool nominaCatalogs() { + return nominaCatalogs; + } + public ToolsResource tools() { return tools; } diff --git a/src/main/java/io/facturapi/tools/NominaCatalogsTool.java b/src/main/java/io/facturapi/tools/NominaCatalogsTool.java new file mode 100644 index 0000000..d80199f --- /dev/null +++ b/src/main/java/io/facturapi/tools/NominaCatalogsTool.java @@ -0,0 +1,25 @@ +package io.facturapi.tools; + +import com.fasterxml.jackson.core.type.TypeReference; +import io.facturapi.http.FacturapiHttpClient; +import io.facturapi.models.CatalogItem; +import io.facturapi.models.SearchResult; +import java.util.Map; + +public class NominaCatalogsTool { + private final FacturapiHttpClient client; + + public NominaCatalogsTool(FacturapiHttpClient client) { + this.client = client; + } + + /** Searches payroll deduction types. */ + public SearchResult searchDeductions(Map params) { + return client.get("/catalogs/deductions", params, new TypeReference>() {}); + } + + /** Searches payroll perception types. */ + public SearchResult searchPerceptions(Map params) { + return client.get("/catalogs/perceptions", params, new TypeReference>() {}); + } +}