Skip to content

Technical Reference: Currency Rate History

Entity: CurrencyRateHistoryRecord

The entity serves to store a snapshot of the rate in time.

Fields

Name (System) Type Description
name Varchar Currency code (e.g., USD, EUR).
rate Float Exchange rate value against the default currency.
rateCurrency Varchar Default currency code (e.g., CZK).
createdAt DateTime Time of record creation.

Logic (Job)

Class: Espo\Modules\CurrencyRateHistory\Classes\Jobs\RecordCurrencyRates

  1. Loads defaultCurrency from config.
  2. Loads currencyList and currencyRates from config.
  3. Iterates through currencies.
  4. Creates CurrencyRateHistoryRecord entity.

UI Extensions

The module extends the currency settings view (views/settings/fields/currency-rates). It adds logic for selecting from the CurrencyRateHistoryRecord entity and backfilling the input.