SI Engine
A standing-instruction engine that schedules, validates and orchestrates recurring transfers, and never posts money itself.
- 8 Standing-instruction types Fund transfer, bills, RTGS, NPSB, EFT, MFS top-up, loan EMI and card payment.
- 5 Payment methods Internal transfers plus NPSB, EFT, RTGS and other rails.
- 48 Regression checks An HTTP regression suite that passed unchanged after a large refactor.
- 25 Postman requests Verified against pre-production, including error cases.
- Customer sets up an instruction
- Validate and schedule
- Scheduler finds due items
- Execution strategy
- Core banking fund transfer
- Inter-bank rail, if any
- Result recorded
The problem
// ContextCustomers want to set up transfers that repeat on a schedule: once, daily, weekly or monthly, from the mobile app and internet banking. The bank needed those to run on their own, across several payment rails, without creating a second place where money is posted.
Approach
// What I built- Clean Architecture with CQRS and MediatR on .NET 9, Oracle through Dapper, and thin controllers that only dispatch.
- One rule decides the design: the engine is a scheduler, validator and orchestrator. Every money movement starts with one core-banking fund-transfer call, so posting stays in one place.
- Execution follows the payment method. Strategy handles each method, a Template Method covers the inter-bank rails (debit the settlement account, call the rail, reverse if the rail fails), and a Factory means a new rail is one class and one registration.
- A background scheduler polls for due instructions and runs each through the same pipeline as the manual endpoint. One failing instruction never blocks the rest of the batch, and a second replica can run with the scheduler off.
- Missed runs recover safely: an overdue one-time instruction is marked expired, and a missed recurring run is logged as skipped and rolled forward. Stale payments are never executed late.
- All 'today' logic runs on a Bangladesh-time clock, which removed an off-by-one-day risk between midnight and 06:00 caused by UTC.
- HTTP calls get a timeout, a connect-only retry and a circuit breaker. A timed-out transfer is never retried; it is reported as 'outcome unknown, verify in core banking'.
- Sliding-window rate limits protect the API: 120 requests a minute per client and 10 a minute on execute.
- The API is shaped for an external vendor: every route is a POST with identifiers in the body, and every response carries a status code and a message.
Decisions and trade-offs
// Why it is built this wayA scheduler, not a payments engine
One posting path keeps the ledger, reconciliation and reversals in a single place instead of two.
Never retry a timed-out transfer
A retry after a timeout can debit twice. Reporting 'outcome unknown' sends it for verification instead.
Recover missed runs, never replay them
Paying a stale instruction late is worse than skipping it, so overdue runs are logged and rolled forward.
Rules live in the database
Validation such as 'routing code required for this rail' sits in PL/SQL packages, so every caller gets the same answer.
Outcomes
// Result- A Phase 1 vertical slice built: set up, schedule, execute and record. Internal transfers (conventional and Islamic) and EFT are built against captured real contracts; RTGS, card and NPSB sit behind the same strategy pattern, ready for their contracts.
- A customer-app design for scheduled transfers (one-time, daily, weekly, monthly) was matched by extending the same create endpoint instead of adding a parallel one.
- Still open by design: authentication and two-factor checks, a preview step before creation, and automated tests.