/**
 * ISO-4217 currency codes the exchange service can handle.
 * Extend this union as new currencies are supported.
 */
export type CurrencyCode = "USD" | "ETB";

/** A directional currency pair, e.g. `{ from: 'USD', to: 'ETB' }`. */
export interface CurrencyPair {
  from: CurrencyCode;
  to: CurrencyCode;
}

/**
 * A source of base exchange rates. Implementations fetch (scrape/API) the rate
 * for a single canonical direction; the {@link ExchangeService} derives the
 * inverse and same-currency (1:1) cases on top.
 *
 * Today the only implementation is the CBE (Central Bank of Ethiopia) provider,
 * which sources USD→ETB. New providers (other banks, other base pairs) can be
 * added without touching consumers.
 */
export interface ExchangeRateProvider {
  /** Human-readable provider name, used in logs (e.g. `'CBE'`). */
  readonly name: string;

  /**
   * Returns the rate for `pair` (units of `pair.to` per 1 unit of `pair.from`),
   * or `null` if this provider cannot supply that pair directly.
   */
  getBaseRate(pair: CurrencyPair): Promise<number | null>;
}
