cadrumo.domain.currency.models module

Currency normalization value models.

Defines MonetaryAmount, NormalizedAmount, and CurrencyNormalizationStatus for the EUR conversion results produced by CurrencyNormalizationService.

class CurrencyNormalizationStatus(*values)[source]

Bases: StrEnum

Status of currency normalization.

NATIVE_EUR
NORMALIZED
MISSING_RATE
UNSUPPORTED_CURRENCY
class MonetaryAmount(**data)[source]

Bases: BaseModel

A monetary amount with its currency.

Parameters:

data (Any)

amount: Decimal
currency: IsoCurrencyCode
class NormalizedAmount(**data)[source]

Bases: BaseModel

A EUR-normalized monetary amount with provenance.

Parameters:

data (Any)

original: MonetaryAmount
eur_amount: Decimal
status: CurrencyNormalizationStatus
rate: Decimal | None
rate_source: str | None
rate_date: date | None
class FxConversionStamp(**data)[source]

Bases: BaseModel

The euro-conversion stamp a foreign-currency record carries.

Three fields rather than the (rate, date) pair this replaced, because a stored euro figure that cannot say WHO quoted the rate is a number with no authority behind it. The rate and the date say what was applied; source says which rate authority stated it, which is what makes the conversion auditable years later against the same published series.

Parameters:

data (Any)

rate: Decimal
rate_date: date
source: str