Treasury & Bank Transfer Management System — سامانه مدیریت خزانهداری و حوالههای بانکی
feature/reconciliation-guard-20261013
ci/public-windows-bridge-probe-20261017
ci/windows-dispatch-bootstrap-20261016
ci/windows-dual-app-lab-20261016
dev/v7-production-failclosed-20261021
feature/reconciliation-guard-20261013
main
phase-1-foundation
phase-1-implementation
phase-2-treasury-core
phase-3-banking-reconciliation
phase-4-operations-enterprise-ux
phase-5-hardening-release
phase-6-production-platform
phase-7-production-infrastructure-bank-golive
phase-7-sql-readonly-ux-20261015
transfer-exe-to-drive-20261006
| 1 | # TreasuryFlow reconciliation guard (isolated module) |
| 2 | |
| 3 | **Status:** Standalone tested development module, NOT merged into the operating TreasuryFlow application. |
| 4 | |
| 5 | Use this when a transfer attempt has already been recorded but bank outcome is uncertain. This package neither sends money nor connects to a bank or modifies a database. |
| 6 | |
| 7 | Guarantees: |
| 8 | - UNKNOWN is never eligible for automatic retransmission. |
| 9 | - Bank acceptance is not final settlement. |
| 10 | - A definitive bank rejection must be distinguished from network errors. |
| 11 | - Evidence must match payment ID, amount as *string minor units*, and currency. |
| 12 | - Each bank evidence ID is idempotent; inconsistent replays and terminal conflicts fail closed. |
| 13 | - No automatic conversion between Iranian rials and tomans. |
| 14 | |
| 15 | Tests: Node >=20, run `npm test` and `npm run check` in this folder (16 tests). |
| 16 | |
| 17 | Important integration requirements: |
| 18 | 1. Run only server-side. `verifiedBy` is asserted by a trusted banking adapter, not cryptographic verification by this module; NEVER accept it from client payload. |
| 19 | 2. Save returned snapshot atomically using the current row version (compare-and-swap/SQLite transactional write). |
| 20 | 3. Deduplicate external bank references across transfers at persistence level. |
| 21 | 4. Inspect existing `TreasuryService.dispatchPayment` and adapt actual types before integrating. |
| 22 | 5. Status flags from legacy Mayan do not alone establish confirmed settlement. |
| 23 | 6. Require explicit authorized/manual workflow before retrying payment; this module provides no such permission. |
| 24 | 7. Test against official bank sandbox and approved contract before enabling any real transfer. |
| 25 | |
| 26 | The actual project source was previously reported at: |
| 27 | `C:\TreasuryFlow-P1\.worktrees\batch-payment-import-v1.0.1` |
| 28 | |
| 29 | The GitHub TreasuryFlow repository main branch currently contains only README.md, therefore this isolated module is deliberately kept in a feature branch and is NOT an application release. |