Table of Contents

Namespace Integrations.Application.Fx

Classes

ConvertRequestValidator

Validates ConvertRequest.

CreateRateLockRequestValidator

Validates CreateRateLockRequest.

DailyRateImportJob

Imports the configured provider's daily rates, re-reading a backfill window so late publications land.

ExchangeRateService

Daily rates, locks and conversions.

Rates are stored as published (every currency against the provider's pivot) and cross rates are derived: USD→MXN = (USD→CAD) / (MXN→CAD). The rate for a business date is the latest publication on or before it.

Imports and new locks commit in their own DI scope (own DbContext and outbox), independent of the caller's unit of work: losing an insert race just discards that scope.

Locks: the first lock for a pair and date fixes the rate; every later lock for that pair and date returns the same row (enforced by a unique index), so all lines committed on one day share one rate.

FxOptions

Exchange-rate settings (section Fx).

ImportRatesRequestValidator

Validates ImportRatesRequest.

PublishedRate

A published daily rate: 1 Currency = Rate units of the provider's pivot currency.

Interfaces

IExchangeRateProvider

Source of daily exchange rates (Bank of Canada first; others can be added to match finance's source of record).