ExchangeRate Model
TheExchangeRate class represents the conversion rate between two currencies.
Class Structure
Properties
Unique identifier for the exchange rate
The destination currency for the exchange rate. See Currency for details.
The exchange rate from base currency to target currencyConstraints:
- Must be greater than
0(MIN_RATE) - Must not exceed
99999999(MAX_RATE) - Represents how many units of target currency equal 1 unit of base currency
Rate Constraints: The rate must be in the range (0, 99999999]. A rate of 0 or below is not allowed, and rates exceeding 99,999,999 will be rejected.
ExchangeRateDTO
Data transfer object used for API responses containing full exchange rate information.TypeScript Definition
Properties
Unique identifier for the exchange rate
Complete currency object for the base currency
Complete currency object for the target currency
Exchange rate value (0 < rate ≤ 99999999)
Example Response
AddExchangeRateDTO
Data transfer object used when creating a new exchange rate.TypeScript Definition
Properties
Currency code for the base currency (e.g., “USD”)Must be a valid currency code that exists in the system (3-5 uppercase letters)
Currency code for the target currency (e.g., “EUR”)Must be a valid currency code that exists in the system (3-5 uppercase letters)
Exchange rate valueConstraints:
- Must be greater than 0
- Must not exceed 99999999
Example Request
UpdateRateDTO
Data transfer object used when updating an existing exchange rate.TypeScript Definition
Properties
New exchange rate valueConstraints:
- Must be greater than 0 (MIN_RATE)
- Must not exceed 99999999 (MAX_RATE)
Example Request
When updating an exchange rate, only the rate value can be modified. To change the currency pair, you must create a new exchange rate record.
Rate Constraints Summary
| Constraint | Value | Description |
|---|---|---|
| MIN_RATE | 0 | Rate must be greater than 0 (exclusive) |
| MAX_RATE | 99999999 | Rate must be less than or equal to 99,999,999 |