Skip to content

[US-9.1] CFDI Domain Model & Infrastructure#67

Merged
dacanetdev merged 2 commits intomainfrom
feature/US-9.1-cfdi-domain
Apr 5, 2026
Merged

[US-9.1] CFDI Domain Model & Infrastructure#67
dacanetdev merged 2 commits intomainfrom
feature/US-9.1-cfdi-domain

Conversation

@dacanetdev
Copy link
Copy Markdown
Owner

Summary

  • Invoice + InvoiceItem entities in Domain/Entities/CFDI/ with full CFDI 4.0 fields (uses existing CfdiStatus/CfdiType enums)
  • TenantConfiguration extended with CfdiCertificateData (bytea), IssuerRfc, IssuerName, IssuerTaxRegime, IssuerPostalCode
  • EF Core configurations with UNIQUE(tenant_id, serie, folio) constraint
  • IInvoiceRepository + InvoiceRepository with paged/filtered queries
  • Migration AddCfdiInvoiceSchema creates cfdi_invoices + cfdi_invoice_items tables
  • DI registered in both IServiceCollection and IHostApplicationBuilder overloads

Design decisions

  • Certificate storage: encrypted DB fields (no Azure Key Vault dependency)
  • PAC provider: MockPACProvider (stub — real Finkel wired in US-9.3)

Test plan

  • dotnet build — 0 warnings, 0 errors
  • dotnet test tests/Corelio.Application.Tests — 150/150 passing
  • Migration applies cleanly on next DB startup

🤖 Generated with Claude Code

dacanetdev and others added 2 commits April 2, 2026 17:37
…passing

All 5 product handler test files were already implemented:
- CreateProductCommandHandlerTests (9 tests)
- UpdateProductCommandHandlerTests (9 tests)
- DeleteProductCommandHandlerTests (7 tests)
- GetProductsQueryHandlerTests (8 tests)
- GetProductByIdQueryHandlerTests (6+ tests)

Sprint 8 is now 100% complete (42/42 tasks, 23/23 SP).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Invoice + InvoiceItem entities in Domain/Entities/CFDI/
  - Uses existing CfdiStatus/CfdiType/PacProvider enums
  - Full CFDI 4.0 fields: issuer/receiver snapshots, amounts, stamp data, XML content
- TenantConfiguration: added CfdiCertificateData (bytea), IssuerRfc, IssuerName,
  IssuerTaxRegime, IssuerPostalCode (encrypted DB cert storage, no Azure Key Vault)
- EF configs: InvoiceConfiguration (UNIQUE tenant+serie+folio), InvoiceItemConfiguration
- ApplicationDbContext: DbSet<Invoice>, DbSet<InvoiceItem>, query filters for both
- IInvoiceRepository + InvoiceRepository (GetById, GetBySaleId, GetByUuid, GetPaged)
- DependencyInjection: IInvoiceRepository registered in both overloads
- Migration AddCfdiInvoiceSchema: cfdi_invoices + cfdi_invoice_items tables
- All 150 existing tests still passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dacanetdev dacanetdev merged commit 4662f89 into main Apr 5, 2026
2 of 7 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