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

Merged
nsatoshi merged 1 commits from devin/1776892235-pr-v-dbiscore-client into main 2026-04-22 21:11:59 +00: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 added 1 commit 2026-04-22 21:11:05 +00:00
PR V: dbis_core HTTP client adapter with provider-switch
Some checks failed
CI / Frontend Lint (pull_request) Failing after 5s
CI / Frontend Type Check (pull_request) Failing after 6s
CI / Frontend Build (pull_request) Failing after 8s
CI / Frontend E2E Tests (pull_request) Failing after 9s
CI / Orchestrator Build (pull_request) Failing after 6s
CI / Orchestrator Unit Tests (pull_request) Failing after 7s
CI / Orchestrator E2E (Testcontainers) (pull_request) Has been skipped
CI / Contracts Compile (pull_request) Failing after 6s
CI / Contracts Test (pull_request) Failing after 9s
Code Quality / SonarQube Analysis (pull_request) Failing after 20s
Code Quality / Code Quality Checks (pull_request) Failing after 5s
Security Scan / Dependency Vulnerability Scan (pull_request) Failing after 3s
Security Scan / OWASP ZAP Scan (pull_request) Failing after 4s
049c1e0fb3
Headless HTTP client for the DBIS Core Banking API (d-bis/dbis_core).
Follows the same provider-switch pattern as services/bank.ts and
services/notaryChain.ts — env var gate, deterministic mock fallback.

Wires the subset of dbis_core endpoints the orchestrator actually
calls from its settlement / compliance / ISO20022 paths (mount-point
references per dbis_core/src/integration/api-gateway/app.ts):

- GET  /api/accounts/:accountId/balance     → getAccountBalance
- POST /api/isn/route                        → findSettlementRoute
- POST /api/isn/atomic                       → atomicSettle
- GET  /api/isn/settlements/:settlementId    → getSettlementStatus
- POST /api/ari/decision                     → requestAriDecision
- POST /api/v1/gpn/message/pacs008           → dispatchPacs008

Provider-switched via DBIS_CORE_URL: unset → mock mode with
deterministic fakes; set → live HTTP with X-API-Key auth
(DBIS_CORE_API_KEY) and a 10s AbortController-backed timeout
(DBIS_CORE_TIMEOUT_MS to override).

Tests (12/12) cover both legs: mock-shape assertions + live-mode
fetch stubs for auth headers, path encoding, JSON body, and error
handling. No network. tsc --noEmit clean; full unit suite
12/156 passing unchanged.
nsatoshi merged commit 7fdc9c06da into main 2026-04-22 21:11:59 +00:00
nsatoshi deleted branch devin/1776892235-pr-v-dbiscore-client 2026-04-22 21:12:06 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: d-bis/CurrenciCombo#26