Exchange rates – system description

The exchange rate table, the manual MNB sync, the catch-up logic of the daily job and the permission keys.

The module stores MNB exchange rates by currency and day with the quotation unit. At the top it shows the latest rate per currency; the manual sync and the daily job share the same sync path.

Data model

Table names carry the installation's own prefix in the database.

TableRoleMain fields
exchange_ratedaily ratescurrency, day, unit, rate, source

Process

  1. List: filter by currency, source and date; the per-unit rate is calculated in the list.
  2. Manual sync: MNB source only (otherwise error_source_unsupported); the window comes from the filter dates (default: last 30 days, reversed order swapped); the currency from the filter, or every non-HUF currency of the currency master; the call is syncRange() (MNB SOAP) and returns the number of stored rows.

Background job: fxrate_sync

A daily job in the job queue. Currencies: the non-HUF entries of the currency master, always extended with EUR and USD. Window: yesterday to today, but if the last stored MNB day is older, it catches up from that day, at most 30 days back (getLastMnbRateDate). The result appears in the Exchange rates list.

Permissions

  • Function rights: list (without it the index shows the permission page and the list is empty), sync (plus core modify), debug.
  • No content scope.

Known limitations

  • The sync needs PHP SOAP.
  • The sync and debug keys are not classified in the seeds.
Related topics: exchange rate background job