backbone-banking 0.9.0

Cash & bank — bank/account master, statement import, reconciliation, and clearing postings (5th GL producer)
Documentation
# =============================================================================
# Domain: Banking — FX realisation
# Entities: FxGainLoss
# Description: The realised FX gain/loss recognised on bank clearance of a
#   foreign-currency settlement. The currency catalogue and the exchange-rate
#   table RETIRED to backbone-corporate (the single FX owner): banking keeps
#   only the realisation, whose trigger — the bank clearance — is a banking
#   fact. The ExchangeRateProvider read port (defined in fx_service.rs, read
#   by billing/payment via the composition ACL) now resolves spot rates from
#   corporate through the host seam. Zero cargo edges — banking never imports
#   corporate.
# =============================================================================

models:
  - name: FxGainLoss
    collection: fx_gain_losses
    description: "A realised FX gain/loss recognised on bank clearance of a foreign-currency settlement"
    fields:
      id: { type: uuid, attributes: ["@id", "@default(uuid)"] }
      bank_clearance_id: { type: uuid?, attributes: ["@exclude_from_foreign_key_check"], description: "The clearance that triggered the realisation # logical FK" }
      matched_source_id: { type: uuid, attributes: ["@required", "@exclude_from_foreign_key_check"], description: "The settled document id" }
      currency: { type: string, attributes: ["@required", "@max(3)"], description: "The foreign currency" }
      original_rate: { type: decimal, attributes: ["@required", "@precision(20,8)", "@positive"], description: "Rate at the original post" }
      realised_rate: { type: decimal, attributes: ["@required", "@precision(20,8)", "@positive"], description: "Rate at the bank statement" }
      base_amount_delta: { type: decimal, attributes: ["@required", "@precision(18,2)"], description: "realised_base − original_base. Positive = gain; negative = loss." }
      direction: { type: FxDirection, attributes: ["@required"] }
      fx_account_id: { type: uuid, attributes: ["@required", "@exclude_from_foreign_key_check"], description: "FX Gain or FX Loss GL account" }
      metadata: { type: Metadata, attributes: ["@audit_metadata"] }
    indexes:
      # No tenancy indexes (ADR-0029): the module is tenant-agnostic. Reads walk
      # matched_source_id; the per-unit read path is the decorator's org fence.

enums:
  - name: FxDirection
    description: "Sign of an FX realisation"
    variants:
      - { name: gain, description: "Favourable (cash cleared higher than booked)", default: true }
      - { name: loss, description: "Unfavourable" }