aeat.application.ledger package

Application facade for bucket-scoped ledger and invoice-adjacent workflows.

Owns the operator-facing ledger lifecycle: importing bank statements and records, classifying transactions for tax, splitting and merging entries, attaching evidence, and checking a period’s tax-readiness before a modelo calculation consumes it. The primary movement fact remains ledger_transaction. Purchase invoice evidence and payable / collectible business invoices are related bucket-scoped records, not ledger rows, and their source-kind identity is carried by BusinessOperationInvoiceDirection.

The ledger-mounted invoice surface is intentionally slim: BusinessOperationInvoice records carry the BusinessOperationInvoiceDirection source-kind discriminator consumed by PayableInvoiceService and CollectibleInvoiceService. Rich invoice-line detail and reconciliation links stay in domain.invoices, while the application invoice package maps issued / received invoice directions back onto core.BindingSourceKind.PAYABLE_INVOICE and core.BindingSourceKind.COLLECTIBLE_INVOICE.

Major declarations:

See also

application.invoices

Rich invoice orchestration and the application.invoices.InvoiceCatalogueSourceResolver that adapts invoice records into the calculation source mesh.

application.aggregation

Ledger aggregation resolvers such as application.aggregation.LedgerIvaAggregationSourceResolver and the shared application.aggregation.CalculationSourceResolution envelope consumed by modelo calculation.

application.modelo

Work-unit calculation actions that call preflight_ledger_tax_readiness() before resolving ledger-backed bindings for a domain.modelos.WorkUnit.

domain.transactions

The transaction catalogue and lifecycle states that remain the ledger’s durable movement authority.

domain.categories

Closed spending-category identifiers and proportionality rules accepted by ledger category_id and ratio workflows.

domain.usage_ratios

Bucket-scoped, encrypted per-category business-use ratios validated by ledger commands and preflight.

domain.iva

Legal IVA classification and prorrata substrates referenced by ledger tax fields without becoming ledger lifecycle ownership.

Submodules