aeat.domain.invoices package¶
Public facade for immutable invoice catalogue records.
The package root is the import boundary for InvoiceLine,
Invoice, InvoiceCatalogue, invoice errors, repository
ports, and reconciliation helpers. Invoice is a strict frozen
commercial-document record; derive_invoice_id() derives its stable id
from kind, number, issue date, counterparty, currency, and grand total, while
line and invoice validators preserve totals, tax-rate slots, payment state,
bucket ownership, and linked_transaction_ids provenance.
The IVA bridge re-exports IvaRate, PaymentStatus,
IvaInvoiceClassification, classify_invoice_line_for_iva(),
invoice_line_to_iva_observation(), and rate helpers. The standard helper
covers domestic IVA rate slots; reverse-charge, intra-community, OSS/IOSS, and
other non-domestic cases use explicit substrate fields such as
domain.iva.IvaCategory already carried on Invoice.
Service helpers such as link_transaction(),
suggest_reconciliations(), and verify_link_consistency() are pure
operations over InvoiceCatalogue and
domain.transactions.TransactionCatalogue; persisted cross-catalogue
workflows belong in application.invoices.
Ledger purchase_invoice_evidence_id references must resolve to
bucket-owned Invoice records with matching linked_transaction_ids
before aggregation treats them as purchase evidence.
Persistence is exposed through the narrow
InvoiceCatalogueRepositoryProtocol port; the concrete
InvoiceCatalogueRepository
lives in the persistence adapter and stores the active-bucket catalogue
singleton through
adapters.persistence.storage.SecureObjectRepository as
FINANCIAL adapters.persistence.storage.SensitivityClass
payloads wrapped in adapters.persistence.storage.Envelope; no
plaintext invoice row, JSON catalogue, or envelope file is the durable store.
Callers must import public objects from aeat.domain.invoices and must not
reach into the private underscore modules inside this package.
See also
InvoiceStrict frozen invoice record that carries identity, totals, payment, bucket, tax-substrate, and linked-transaction facts.
InvoiceCatalogueFrozen aggregate persisted as the encrypted invoice catalogue.
InvoiceCatalogueRepositoryProtocolNarrow port used by application services that only need load/save semantics.
application.invoicesPersisted invoice import, reconciliation, repository linking, and
application.invoices.InvoiceCatalogueSourceResolver.application.ledgerLedger lifecycle that attaches
purchase_invoice_evidence_idto bucket-scoped transactions after evidence ownership checks.application.aggregationCalculation-source resolvers that consume invoice and purchase-evidence records for modelo bindings.
Submodules¶
- aeat.domain.invoices._enums module
- aeat.domain.invoices._errors module
- aeat.domain.invoices._ids module
- aeat.domain.invoices._models module
derive_invoice_id()InvoiceLineInvoiceInvoice.invoice_idInvoice.bucket_idInvoice.kindInvoice.invoice_numberInvoice.issued_atInvoice.counterparty_nameInvoice.counterparty_tax_idInvoice.counterparty_countryInvoice.base_totalInvoice.iva_totalInvoice.grand_totalInvoice.currencyInvoice.linesInvoice.payment_statusInvoice.linked_transaction_idsInvoice.notesInvoice.iva_categoryInvoice.operation_typeInvoice.oss_ioss_regimeInvoice.oss_transaction_kindInvoice.retention_rateInvoice.retention_amountInvoice.payment_idInvoice.counterparty_eu_member_stateInvoice.counterparty_is_eu_member
InvoiceCatalogue
- aeat.domain.invoices._protocols module
- aeat.domain.invoices._service module
- aeat.domain.invoices._validators module