"""Currency normalization value models.Defines :class:`MonetaryAmount`, :class:`NormalizedAmount`, and:class:`CurrencyNormalizationStatus` for the EUR conversion results produced by:class:`CurrencyNormalizationService`."""from__future__importannotationsfromdatetimeimportdatefromdecimalimportDecimalfromenumimportStrEnumfrompydanticimportBaseModel,Fieldfrom...coreimportSTRICT_FROZEN_CONFIG
[docs]classCurrencyNormalizationStatus(StrEnum):"""Status of currency normalization."""NATIVE_EUR="native_eur"NORMALIZED="normalized"MISSING_RATE="missing_rate"UNSUPPORTED_CURRENCY="unsupported_currency"
[docs]classMonetaryAmount(BaseModel):"""A monetary amount with its currency."""model_config=STRICT_FROZEN_CONFIGamount:Decimalcurrency:str=Field(min_length=3,max_length=3)
[docs]classNormalizedAmount(BaseModel):"""A EUR-normalized monetary amount with provenance."""model_config=STRICT_FROZEN_CONFIGoriginal:MonetaryAmounteur_amount:Decimalstatus:CurrencyNormalizationStatusrate:Decimal|None=Nonerate_source:str|None=Nonerate_date:date|None=None