# [Digital](../domain.md) ## Entities ### Exchange Rate An Exchange Rate records the conversion between two currencies at a point in time. Append-only: rates observed in the past are facts, and a historical conversion must still reproduce the number that was actually used. ```mermaid --- config: layout: elk --- classDiagram class ExchangeRate{ * Exchange Rate Identifier : string Rate Value : decimal Effective Date Time : datetime } ExchangeRate "0..*" --> "1" Currency : base ExchangeRate "0..*" --> "1" Currency : quote class Currency["Currency"] ``` ```yaml existence: dependent mutability: append_only attributes: Exchange Rate Identifier: type: string identifier: primary description: Unique identifier for the rate observation. Rate Value: type: decimal description: Conversion multiplier from the base currency to the quote currency. Effective Date Time: type: datetime description: The moment this rate became effective. ``` ```yaml governance: retention_basis: Inherited from the domain default of 7 years post relationship end ``` ## Relationships ### Exchange Rate References Base Currency Each Exchange Rate references one base Currency — the one being converted from. ```yaml source: Exchange Rate type: references target: Currency cardinality: many-to-one granularity: atomic ownership: Exchange Rate ``` ### Exchange Rate References Quote Currency Each Exchange Rate references one quote Currency — the one being converted to. ```yaml source: Exchange Rate type: references target: Currency cardinality: many-to-one granularity: atomic ownership: Exchange Rate ```