Skip to content

[US-9.3] PAC Integration & Invoice Stamping#69

Merged
dacanetdev merged 1 commit intomainfrom
feature/US-9.3-pac-integration
Apr 5, 2026
Merged

[US-9.3] PAC Integration & Invoice Stamping#69
dacanetdev merged 1 commit intomainfrom
feature/US-9.3-pac-integration

Conversation

@dacanetdev
Copy link
Copy Markdown
Owner

Summary

  • IPACProvider + PacStampResult + MockPACProvider (always succeeds, fake UUID)
  • ICFDIService + CfdiService orchestrates the full stamp flow (LoadCert → XML → Sign → PAC → Persist)
  • StampInvoiceCommand / CancelInvoiceCommand handlers with 72-hour validation
  • IInvoicePdfService + InvoicePdfService + InvoiceDocument (A4, QuestPDF)
  • Both DI overloads updated

Design decisions

  • MockPACProvider replaces Finkel (no sandbox credentials available); swap-in ready via DI
  • Certificate disposed in finally block per CLAUDE.md requirements

Test plan

  • dotnet build — 0 warnings, 0 errors
  • dotnet test tests/Corelio.Application.Tests — 150/150 passing

🤖 Generated with Claude Code

- IPACProvider interface + PacStampResult record (Application layer)
- MockPACProvider: deterministic fake UUID/stamps for dev (no Finkel needed)
- ICFDIService interface (Application layer)
- CfdiService: LoadCert → GenerateXML → PAC.Stamp → Persist UUID/seals/QrCode
  Certificate always disposed in finally block
- StampInvoiceCommand + handler: delegates to ICFDIService, handles Draft→Stamped
- CancelInvoiceCommand + handler: validates 72h window + reason codes 01-04
- IInvoicePdfService + InvoicePdfService + InvoiceDocument (QuestPDF, A4)
  Shows issuer/receiver RFC, items table, stamp section (UUID, QR, cert number)
  Cancelled invoices show red CANCELADA banner
- All services registered in both DI overloads
- 0 warnings, 0 errors, 150/150 tests passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dacanetdev dacanetdev merged commit 47b0af2 into main Apr 5, 2026
8 of 14 checks passed
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.

1 participant