Files
zeekay 7fea3be87f docs: generic integration patterns + M-Pesa adapter
Add docs/INTEGRATIONS.md documenting treasuryd as a system:

- Double-entry ledger model (Account / Transaction / Posting / Move /
  Volumes; multi-tenant via `ledger` column; immutable history with
  reversal-by-new-transaction).
- Virtual wallet layer (Wallet / Hold / WalletBalance; hold → confirm
  full or partial / void semantics mapped to ledger sub-accounts).
- Provider abstraction (CreateAccount / CreatePayment / GetFXQuote /
  CreateCounterparty / Capabilities) and the seven adapter categories
  it covers today — bank-rail, treasury orchestrator, payment gateway,
  card issuer, bank-link aggregator, FX / cross-border, mobile-money
  operator, cross-chain bridge — referenced by package path only.
- Step-by-step recipe for adding a new adapter (mirror pkg/provider/wise
  or pkg/provider/mpesa; conditional registration in
  cmd/treasuryd/main.go gated on the adapter's credential env var).
- Reconciliation engine (ledger vs provider, drift surfaces for human
  investigation, no auto-correction).
- Compliance defaults (amount thresholds, OFAC country list, velocity
  windows) and the regulated-deployment layering pattern on top.
- Idempotency contract via the `reference` field on transactions and
  payment requests.

No commercial-vendor positioning — adapter package paths are technical
identifiers; the prose describes categories, not products.
2026-05-24 01:13:32 -07:00
..