Skip to content

Comments

Agergar ejemplos impuestos locales y nomina#1

Open
Anidem1995 wants to merge 4 commits intomainfrom
agergar-ejemplos-impuestos-locales-y-nomina
Open

Agergar ejemplos impuestos locales y nomina#1
Anidem1995 wants to merge 4 commits intomainfrom
agergar-ejemplos-impuestos-locales-y-nomina

Conversation

@Anidem1995
Copy link

@Anidem1995 Anidem1995 commented Feb 11, 2026

Summary by CodeRabbit

  • New Features

    • Added many new endpoints to create invoices with payroll, local-tax, and payment complements, supporting value-based and reference-based payloads, plus multiple currency/payment variants.
  • Chores

    • Updated fiscalapi dependency to a newer version for improved stability.

@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

No actionable comments were generated in the recent review. 🎉


📝 Walkthrough

Walkthrough

Bumped fiscalapi in package.json and added numerous POST endpoints to InvoicesController to create invoices with various complements (nomina, impuestos locales, pago) by values or by references, including currency-specific pago variants; each endpoint builds an invoice payload and calls fiscalApi.invoices.create, returning or throwing on error.

Changes

Cohort / File(s) Summary
Dependency Update
package.json
Bumped fiscalapi version from ^4.0.141 to ^4.0.360.
Invoice Complement Endpoints
src/facturas/invoices.controller.ts
Added many POST endpoints to create invoices with complements: complemento-nomina-por-valores, complemento-nomina-por-referencias, complemento-impuestos-locales-por-valores, complemento-impuestos-locales-por-referencias, complemento-pago, complemento-pago-referencias, complemento-pago-usd-mxn, complemento-pago-mxn-usd, complemento-pago-eur-usd and several duplicated/variant handlers. Each constructs invoice payloads (moving payment details under complement.payment where applicable) and delegates to fiscalApi.invoices.create, returning API responses or throwing BadRequestException on failure. Changes are dense in controller logic and payload construction.

Sequence Diagram

sequenceDiagram
    participant Client
    participant InvoicesController
    participant FiscalAPI
    participant Response
    rect rgba(200,230,201,0.5)
    Client->>InvoicesController: POST /complemento-*(payload)
    end
    rect rgba(187,222,251,0.5)
    InvoicesController->>InvoicesController: Build Invoice object (complement / payment)
    InvoicesController->>FiscalAPI: invoices.create(invoice)
    end
    alt API Success
        FiscalAPI->>Response: 201 Created (apiResponse)
        Response->>Client: Return apiResponse
    else API Failure
        FiscalAPI->>Response: 4xx/5xx (apiResponse)
        Response->>Client: Throw BadRequestException(apiResponse)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through code with nimble paws,

Added complements, adjusted laws,
Payments nested, versions bumped,
Invoices hum, my tail all thumped —
Carrots ready, tests applause! 🥕

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'Agergar ejemplos impuestos locales y nomina' contains a typo ('Agergar' instead of 'Agregar') and is only partially related to the main changes. While it mentions impuestos locales (local taxes) and nomina (payroll), the most significant change is the fiscalapi dependency upgrade from ^4.0.141 to ^4.0.360, which is not reflected in the title.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch agergar-ejemplos-impuestos-locales-y-nomina

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@package.json`:
- Line 30: The project is pinning "fiscalapi" to ^4.0.360 which removed legacy
invoice endpoints; search for any callsites/functions that POST to legacy routes
or build payloads for invoices (look for function names like createInvoice,
sendInvoice, postInvoice, submitInvoice or any direct fetch/axios calls to
"/api/v4/invoices/income", "/credit-note", "/payment", "/payroll",
"/local-taxes") and migrate them to use the unified POST /api/v4/invoices
endpoint and the new payload shape: move payroll, payment, and local-taxes
fields under invoice.complement.* (e.g., invoice.payroll ->
invoice.complement.payroll), update any tests and serializers to construct the
new invoice object, and remove usage of the discontinued endpoints or add
adapter code transforming old payloads to the new structure before calling POST
/api/v4/invoices.

In `@src/facturas/invoices.controller.ts`:
- Around line 1134-1141: Remove the duplicate route and docs decorators above
the crearComplementoNominaPorReferencias method: keep only the correct
`@Post`('complemento-nomina-por-referencias') and its matching
`@ApiOperation/`@ApiResponse annotations, and delete the earlier
`@Post`('complemento-nomina-referencias') plus its `@ApiOperation/`@ApiResponse to
avoid creating two endpoints and duplicate Swagger entries for
crearComplementoNominaPorReferencias.

Copy link
Contributor

@mendozagit mendozagit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mismo feedback que los ejemplos de express:

Los ejemplos existentes de complemento de pago y el readme requieren cambios, Hay discusiones pendientes con Rabbit, ninguna aplica? yo leí al menos una que sí, hiciste dev DevTesting? porque puedo asegurarte de que los ejemplos de complementos de pago no funcionarán después del update de sdk, levanta los ejemplos y verifica que lo que estás haciendo no solo funciona, si no que lo que existe no está roto.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants