aeat.domain.iva package

Public facade for the registry-backed Spanish IVA substrate.

This package owns the canonical IVA taxonomy, dated rate lookup, settlement flow mapping, invoice classification bridge, prorrata calculations, OSS/IOSS regime metadata, recargo-equivalencia rates, refund eligibility, and SEPA marca derivation. Runtime Python owns validation and deterministic resolution; statutory rate windows, catalogue text, and recargo tables are loaded from committed registry files under registry/aeat/iva.

The facade exposes closed identifiers such as IvaCategory, EUMemberState, IvaRateKind, IvaCitationSource, IvaFlowDirection, and IvaSettlementSide; loaders and lookups such as load_iva_catalogues(), resolve_catalogue(), load_iva_rate_table(), lookup_rate(), load_recargo_rates(), and recargo_rate_for(); and the classification axis stack (IvaTerritorialScope, CustomerTaxStatus, TransactionKind, InvoiceKind) resolved by classify_iva() into IvaClassificationResult.

Ledger and invoice callers use IvaInvoiceClassification, classify_invoice_line_for_iva(), invoice_line_to_iva_observation(), and derive_flow_for_classification() to carry the category/rate/flow/settlement-side tuple without re-encoding IVA rules. Legal prorrata remains a distinct LIVA arts. 101-103 substrate through ProrrataInputs, ProrrataReference, ProrrataResult, compute_prorrata_general(), and compute_sectoral_prorrata(); it is not a usage-ratio or ledger business-percentage mechanism.

Callers from outside this subpackage import exclusively from domain.iva and must not reach into private modules. This domain surface is pure substrate logic: repositories, CLI commands, modelo binding, and live AEAT access belong to application and adapter layers.

See also

domain.invoices

Invoice records and helpers that use this IVA substrate to produce registry-ready invoice and IVA observations.

application.aggregation

Source-mesh resolvers that convert bucket-local ledger and invoice facts into IVA, OSS/IOSS, and prorrata-aware calculation payloads.

domain.calculations.registry

Binding declarations, observation models, and formulas that consume the resolved IVA substrate during modelo calculation.

application.modelo

Work-unit calculation and verification flows that persist the registry results; they do not own IVA taxonomy or rate lookup.

Submodules