Treasury & Bank Transfer Management System — سامانه مدیریت خزانهداری و حوالههای بانکی
ci/windows-dual-app-lab-20261016
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 | import {describe,expect,it} from 'vitest'; import {TreasuryWorkflow} from './workflow'; |
| 2 | describe('treasury workflow',()=>{const policy={transactionLimitIrr:5000,dailyLimitIrr:10000,whitelist:new Set(['t1:b1'])};it('runs maker-checker simulated settlement',()=>{const w=new TreasuryWorkflow(policy);const p=w.create({id:'p1',tenantId:'t1',makerId:'maker',beneficiaryId:'b1',amountIrr:1000,paymentDate:'2026-10-05',clientReference:'R1'});expect(p.state).toBe('DRAFT');expect(w.submit('p1','maker').state).toBe('PENDING_APPROVAL');expect(()=>w.approve('p1','maker')).toThrow();expect(w.approve('p1','checker').state).toBe('APPROVED');expect(w.queue('p1').state).toBe('QUEUED');expect(w.simulateSettlement('p1').state).toBe('SETTLED')});it('material edit invalidates approval and increments version',()=>{const w=new TreasuryWorkflow(policy);w.create({id:'p2',tenantId:'t1',makerId:'m',beneficiaryId:'b1',amountIrr:100,paymentDate:'2026-10-05',clientReference:'R2'});w.submit('p2','m');w.approve('p2','c');const edited=w.editAmount('p2','m',200);expect(edited.version).toBe(2);expect(edited.state).toBe('DRAFT');expect(edited.approvedVersion).toBeUndefined()});it('exposes approval and settlement queues',()=>{const w=new TreasuryWorkflow(policy);w.create({id:'p3',tenantId:'t1',makerId:'m',beneficiaryId:'b1',amountIrr:100,paymentDate:'2026-10-05',clientReference:'R3'});w.submit('p3','m');expect(w.queueView('PENDING_APPROVAL')).toHaveLength(1)})}); |