Phase 1 activeFCMB processor gateway foundation

Allpro TMS Gateway

The stack is now anchored around a dedicated web surface, a durable worker, and a compatibility-first contract baseline.

This foundation keeps the current FCMB and terminal-facing ecosystem stable while carving out a clean runtime boundary for callback ingestion, settlement orchestration, and MQTT delivery.

Service map

Foundation runtime layout

isolated by design

Node.js + route handlers

Next.js web surface

Admin UI and preserved API boundary

Go 1.25

Go worker

Inbox, outbox, retries, and scheduling baseline

Postgres 16

Postgres

Gateway system database

Redis 7

Redis

Coordination, locks, and queue support

EMQX 5

EMQX

Existing MQTT terminal contract

Contract freeze

Preserved external surfaces

  • POST /terminal/fcmb/event/callback
  • POST /terminal/grupp/event/callback
  • GET /terminal/pos/terminal-id/:serialNumber
  • POST /mobile/iot-jwt
  • POST /terminal/print/ack
  • GET /pos-terminal/:businessId/fcmb/transaction/by-rrn/:rrn
  • GET /pos-terminal/:businessId/fcmb/settlement/transactions/:settlementId
  • GET /admin/pos-terminal/fcmb-pending-terminals
  • GET /admin/pos-terminal/approved-fcmb-terminals
  • POST /admin/pos-terminal/approve-fcmb-terminal-request
  • POST /admin/pos-terminal/activate-fcmb
  • GET /admin/pos-terminal/list-mapped-fcmb-terminals
  • POST /admin/pos-terminal/upload-unmapped-terminals
  • GET /admin/pos-terminal/mapped-fcmb-terminal/:lookup
  • GET /admin/pos-terminal/mapped-fcmb-terminal/:lookup/transactions
  • POST /admin/pos-terminal/mapped-fcmb-terminal/:lookup/state
  • GET /admin/pos-terminal/ledger/statement
  • GET /admin/callbacks/inbox
  • POST /admin/callbacks/inbox/:callbackId/requeue
  • GET /admin/outbox
  • GET /admin/outbox/:outboxId/history
  • POST /admin/outbox/:outboxId/retry
  • POST /admin/outbox/:outboxId/release-lease
  • GET /admin/settlements
  • GET /admin/settlements/:settlementId
  • GET /admin/settlements/:settlementId/children
  • GET /admin/settlements/:settlementId/transfers
  • GET /admin/settlements/:settlementId/transactions
  • GET /admin/settlements/:settlementId/webhook
  • GET /admin/settlements/:settlementId/audit
  • POST /admin/settlements/:settlementId/retrigger-notification
  • GET /admin/settlements/pending-notifications
  • GET /admin/settlement-transfers/provider-pending
  • POST /admin/settlement-transfers/:transferId/requery

Why this order

Foundation before feature extraction

The stack is intentionally narrow right now. We freeze the infrastructure, contracts, health checks, and startup commands before implementing FCMB flows so cutover risk stays visible.

This gives the next tasks a stable base for terminal support APIs, callback normalization, settlement processing, and admin diagnostics.

Next tasks

Work unlocked by this scaffold

  • Preserve terminal lookup, MQTT token, print acknowledgement, and unmapped terminal inventory upload with processor-aware service boundaries.
  • Extend the durable callback inbox into settlement rollup and outbound notification delivery.
  • Add normalized transaction persistence and settlement rollup scaffolding.
  • Build admin operations views for FCMB terminal and delivery diagnostics.