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.
| Table | Role | Main fields |
|---|---|---|
exchange_rate | daily rates | currency, day, unit, rate, source |
Process
- List: filter by currency, source and date; the per-unit rate is calculated in the list.
- Manual sync:
MNBsource only (otherwiseerror_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 issyncRange()(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 coremodify),debug. - No content scope.
Known limitations
- The sync needs PHP SOAP.
- The
syncanddebugkeys are not classified in the seeds.