PR V: dbis_core HTTP client adapter with provider-switch #26
Reference in New Issue
Block a user
Delete Branch "devin/1776892235-pr-v-dbiscore-client"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Headless HTTP client for the DBIS Core Banking API (
d-bis/dbis_core), wired into the orchestrator via the same provider-switch pattern asservices/bank.tsandservices/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.tsmount points:/api/accounts/:id/balancegetAccountBalance/api/isn/routefindSettlementRoute/api/isn/atomicatomicSettle/api/isn/settlements/:idgetSettlementStatus/api/ari/decisionrequestAriDecision/api/v1/gpn/message/pacs008dispatchPacs008Provider switch
DBIS_CORE_URLunset →MockDbisCoreClientreturns deterministic shapes matching upstream types.DBIS_CORE_URLset →HttpDbisCoreClientwithX-API-Keyauth (DBIS_CORE_API_KEY) and a 10sAbortControllertimeout (DBIS_CORE_TIMEOUT_MSoverride).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-modefetchstubs for headers, path encoding, JSON body, error handling).Verification
npx tsc --noEmitclean.npx jestunit suite: 12 suites / 156 tests, all passing.