aeat.domain.currency package

Public facade for currency normalization to euro.

Normalizes MonetaryAmount records to EUR through an injected ExchangeRateProvider, so downstream tax aggregation works from a single currency while source currency evidence remains intact. The provider contract is original_amount * rate = eur_amount; ECB EUR-base quote inversion and most-recent-prior-publication fallback live in adapters.outbound.fx, not in this pure domain package.

The service returns NormalizedAmount with a CurrencyNormalizationStatus rather than silently assuming EUR or writing zero into filing-grade facts. Ledger import persists successful normalization as fx_rate / value_in_eur on domain.transactions.Transaction records before application aggregation consumes the row.

Major declarations:

See also

adapters.outbound.fx

Bundled ECB adapters.outbound.fx.EcbReferenceRateProvider adapter that implements ExchangeRateProvider.

application.ledger

Import path that applies this service and persists fx_rate / value_in_eur on transactions.

domain.transactions

Transaction model coupling invariants for foreign-currency rate provenance and EUR projection fields.

application.aggregation

Source-resolution predicates and amount projections that reject unconverted foreign rows instead of silently treating them as EUR.

Submodules