# ExchangeRate

## Description

ExchangeRate maintains the conversion ratio between a currency pair with an effective date. Each rate record specifies the source currency, target currency, rate value, and the date from which it applies. The system uses these rates to convert monetary amounts for transactions, reporting, and consolidation.

Rates are date-based to support historical accuracy - a transaction from last month uses last month's rate, not today's rate.

## Domain Model Definitions

### Model type

AppendOnly

### Command Definitions

- [createExchangeRate](../command/CreateExchangeRate.md)

### Query Definitions

- [convertAmount](../query/ConvertAmount.md)

### Models

- ExchangeRate

### Invariants

- Rate must be a positive decimal value
- Source and target currencies must be different
- Effective date is required for all rate records

### Relationships

- **Belongs To Source Currency**: Each rate has exactly one source currency
- **Belongs To Target Currency**: Each rate has exactly one target currency
