PR V: dbis_core HTTP client adapter with provider-switch #26

Merged
nsatoshi merged 0 commits from devin/1776892235-pr-v-dbiscore-client into main 2026-04-22 14:11:59 -07:00
Owner

Summary

Headless HTTP client for the DBIS Core Banking API (d-bis/dbis_core), wired into the orchestrator via the same provider-switch pattern as services/bank.ts and services/notaryChain.ts: env var gate, deterministic mock fallback, no runtime dependency introduced.

Closes gap-analysis v3 §10 “deploy dbis_core” external blocker — the deploy remains a DBIS-side decision, but with this adapter the orchestrator is now ready to flip from mock to live in 1 env var (DBIS_CORE_URL) the moment a reachable endpoint exists.

Endpoints wired

Recon sourced from dbis_core/src/integration/api-gateway/app.ts mount points:

Method Upstream path Adapter method
GET /api/accounts/:id/balance getAccountBalance
POST /api/isn/route findSettlementRoute
POST /api/isn/atomic atomicSettle
GET /api/isn/settlements/:id getSettlementStatus
POST /api/ari/decision requestAriDecision
POST /api/v1/gpn/message/pacs008 dispatchPacs008

Provider switch

  • DBIS_CORE_URL unset → MockDbisCoreClient returns deterministic shapes matching upstream types.
  • DBIS_CORE_URL set → HttpDbisCoreClient with X-API-Key auth (DBIS_CORE_API_KEY) and a 10s AbortController timeout (DBIS_CORE_TIMEOUT_MS override).

Files

  • orchestrator/src/services/dbisCore/types.ts — canonical request/response shapes.
  • orchestrator/src/services/dbisCore/client.ts — Http + Mock implementations, createDbisCoreClient() factory.
  • orchestrator/src/services/dbisCore/index.ts — barrel.
  • orchestrator/tests/services/dbisCoreClient.test.ts — 12 tests covering both legs (mock-shape assertions + live-mode fetch stubs for headers, path encoding, JSON body, error handling).

Verification

  • npx tsc --noEmit clean.
  • npx jest unit suite: 12 suites / 156 tests, all passing.
  • No new runtime dependencies.
  • No UI changes. Headless backend only.
## Summary Headless HTTP client for the DBIS Core Banking API (`d-bis/dbis_core`), wired into the orchestrator via the same provider-switch pattern as `services/bank.ts` and `services/notaryChain.ts`: env var gate, deterministic mock fallback, no runtime dependency introduced. Closes gap-analysis v3 §10 “deploy `dbis_core`” external blocker — the deploy remains a DBIS-side decision, but with this adapter the orchestrator is now ready to flip from mock to live in 1 env var (`DBIS_CORE_URL`) the moment a reachable endpoint exists. ## Endpoints wired Recon sourced from `dbis_core/src/integration/api-gateway/app.ts` mount points: | Method | Upstream path | Adapter method | |---|---|---| | GET | `/api/accounts/:id/balance` | `getAccountBalance` | | POST | `/api/isn/route` | `findSettlementRoute` | | POST | `/api/isn/atomic` | `atomicSettle` | | GET | `/api/isn/settlements/:id` | `getSettlementStatus` | | POST | `/api/ari/decision` | `requestAriDecision` | | POST | `/api/v1/gpn/message/pacs008` | `dispatchPacs008` | ## Provider switch - `DBIS_CORE_URL` unset → `MockDbisCoreClient` returns deterministic shapes matching upstream types. - `DBIS_CORE_URL` set → `HttpDbisCoreClient` with `X-API-Key` auth (`DBIS_CORE_API_KEY`) and a 10s `AbortController` timeout (`DBIS_CORE_TIMEOUT_MS` override). ## Files - `orchestrator/src/services/dbisCore/types.ts` — canonical request/response shapes. - `orchestrator/src/services/dbisCore/client.ts` — Http + Mock implementations, `createDbisCoreClient()` factory. - `orchestrator/src/services/dbisCore/index.ts` — barrel. - `orchestrator/tests/services/dbisCoreClient.test.ts` — 12 tests covering both legs (mock-shape assertions + live-mode `fetch` stubs for headers, path encoding, JSON body, error handling). ## Verification - `npx tsc --noEmit` clean. - `npx jest` unit suite: 12 suites / 156 tests, all passing. - No new runtime dependencies. - No UI changes. Headless backend only.
nsatoshi merged commit 7fdc9c06da into main 2026-04-22 14:11:59 -07:00
nsatoshi deleted branch devin/1776892235-pr-v-dbiscore-client 2026-04-22 14:12:06 -07:00
Sign in to join this conversation.