aeat.application.invoices._source_resolver module¶
Source-mesh resolver for governed invoice records.
InvoiceCatalogueSourceResolver reads the
InvoiceCatalogue selected by
bucket_id through
InvoiceCatalogueRepository and also adapts slim
BusinessOperationInvoice records when their
repository is available. It projects those records into the
calculation mesh as CalculationSourceResolution
values for COLLECTIBLE_INVOICE and
PAYABLE_INVOICE.
The rich Invoice aggregate remains the
reconciliation and link authority; the slim ledger-mounted invoice records are
operator-editable source-kind records. Both paths converge here only after they
can be represented as registry InvoiceObservation
facts, with Modelo 349 summary bindings, detail rows, transaction ids, and
source provenance emitted through one resolver envelope.
- invoice_direction_to_source_kind(kind)[source]¶
Map an invoice direction to its settlement source kind.
The single contractual home for the direction↔settlement relationship, consumed by both
InvoiceCatalogueSourceResolverand the operatoraeat app ledger invoiceCLI. An issued invoice (we billed a customer) is collectible; a received invoice (a vendor billed us) is payable.- Return type:
- Returns:
The
BusinessOperationInvoiceDirectionsettlingkind.- Parameters:
kind (InvoiceKind)
- class InvoiceCatalogueSourceResolver(*, invoice_repository=None, business_invoice_repository=None)[source]¶
Bases:
objectResolve invoice-source bindings and detail rows from persisted invoice records.
The resolver owns both invoice source kinds in the calculation mesh. It filters records by
CalculationSourceContext, turns declarable intracommunity entries intoInvoiceObservationfacts, and returns aCalculationSourceResolutioncarrying binding values, Modelo 349 detail rows, linked transaction ids, and stable source provenance.- Parameters:
invoice_repository (InvoiceCatalogueRepositoryProtocol | None)
business_invoice_repository (BusinessOperationInvoiceRepository | None)
- resolver_id¶
- owned_sources¶
- resolve(context)[source]¶
- Return type:
- Parameters:
context (CalculationSourceContext)