#913: CurrencyPairDO.kt

projectforge-business/src/main/kotlin/org/projectforge/business/fibu/CurrencyPairDO.kt Type: JPA Entity (Data Object)
Package: org.projectforge.business.fibu
Path: projectforge-business/src/main/kotlin/org/projectforge/business/fibu/CurrencyPairDO.kt
Author: Kai Reinhard (k.reinhard@micromata.de) 94 lines · 52 code · 32 comments · 10 blank

Represents a currency pair for foreign exchange conversion (e.g. USD → EUR). Each pair links a source currency to a target currency. The pair itself does not contain conversion rates — those are held by child CurrencyConversionRateDO entities with validity periods. A transient rates list is populated by CurrencyConversionCache for in-memory access.

Database Mapping

Tablet_fibu_currency_pair
Unique Constraint(source_currency, target_currency) — prevents duplicate pairs
Indexesidx_t_fibu_currency_pair_source, idx_t_fibu_currency_pair_target
Annotations@Indexed, @AUserRightId("FIBU_CURRENCY_CONVERSION")

Fields

FieldTypeColumnConstraintsSearchDescription
sourceCurrencyString?source_currencyLength 3, not null@FullTextFieldISO 4217 currency code (source)
targetCurrencyString?target_currencyLength 3, not null@FullTextFieldISO 4217 currency code (target)
commentString?Max COMMENT_LENGTH@FullTextFieldOptional description
ratesMutableList<CurrencyConversionRateDO>?@TransientPopulated by cache; not persisted

Inheritance & Interfaces

Equality

equals() and hashCode() are overridden to use the id field. If the id is null, falls back to the DefaultBaseDO implementation.

Access Control

Annotated with @AUserRightId("FIBU_CURRENCY_CONVERSION"), linking this entity to the FIBU_CURRENCY_CONVERSION user right for access control checks throughout the persistence layer.

Git History

868d6abb7 2025 -> 2026
07edc85de WIP: currency conversion with Claude Code.
357ebee61 WIP: currency conversion with Claude Code.
73b486107 WIP: currency conversion with Claude Code.
bd69407de Initial revision with Claude Code.