CurrencyConversionRateDO.ktA time-dependent currency conversion rate record. Each entry belongs to a CurrencyPairDO and has a validFrom date. The rate remains active until a newer rate's validFrom date takes effect. Both forward and inverse rates are stored to simplify querying from either direction. Extends AbstractBaseDO<Long> and implements Serializable.
| Table | t_fibu_currency_conversion_rate |
|---|---|
| PK Column | pk (sequence-generated) |
| Unique Constraint | (currency_pair_fk, valid_from) |
| Indexes | idx_fk_t_fibu_curr_conv_rate_pair on currency_pair_fk, idx_t_fibu_curr_conv_rate_valid on valid_from |
| Constant | Query | Purpose |
|---|---|---|
FIND_BY_PAIR_AND_DATE | Find rate by pair id and validFrom | Validation — check if a rate already exists |
FIND_OTHER_BY_PAIR_AND_DATE | Find rate by pair id, validFrom, excluding a given id | Validation during update (exclude self) |
FIND_ALL_BY_PAIR | All rates for a pair, sorted by validFrom DESC | Listing and active-rate lookup |
| Field | Type | Column | Constraints | Description |
|---|---|---|---|---|
id | Long? | pk | PK, sequence | Primary key |
currencyPair | CurrencyPairDO? | currency_pair_fk | FK, not null, lazy, @JsonIdentityReference | Parent currency pair (serialized as id only) |
validFrom | LocalDate? | valid_from | Not null | Date from which this rate becomes active |
conversionRate | BigDecimal? | conversion_rate | Scale 8, precision 18, not null | Forward conversion factor (source → target) |
inverseConversionRate | BigDecimal? | inverse_conversion_rate | Scale 8, precision 18, not null | Inverse factor (target → source), stored redundantly for performance |
comment | String? | comment | Max length Constants.LENGTH_TEXT | Optional comment |
copyFrom(other) — copies validFrom, conversionRate, inverseConversionRate, and comment from another rate. Does not copy id or currencyPair — used when re-activating undeleted records.Annotated with @WithHistory, enabling automatic change tracking via the ProjectForge history framework.
868d6abb7 2025 -> 2026 07edc85de WIP: currency conversion with Claude Code. 0d4a5352a WIP: currency conversion with Claude Code. bd69407de Initial revision with Claude Code.