Alternera.Resources.Finance.RecordRates (alternera_resources_finance v0.9.0)

Copy Markdown View Source

ExchangeRate.record_rates: one day's rates against one base currency, each stored as the pair's record for the day (created, or updated when the day already has one), as the caller and in the caller's tenant.

The whole call is one transaction: a rate the resource refuses (zero, not a number) fails the call and stores none of the day's rates, so a feed that sent nonsense leaves the previous day as the newest. A quote code with no currency record is skipped and named, since a feed quotes more currencies than a tenant keeps.