Treasury & Bank Transfer Management System — سامانه مدیریت خزانه‌داری و حواله‌های بانکی

1 import {describe,expect,it} from 'vitest'; import {filterAudit} from './audit-explorer';
2 describe('audit explorer',()=>{const e=[{tenantId:'t1',seq:2,actor:'u2',action:'APPROVE',entity:'p1',at:20},{tenantId:'t2',seq:1,actor:'u1',action:'CREATE',entity:'p2',at:10},{tenantId:'t1',seq:1,actor:'u1',action:'CREATE',entity:'p1',at:10}];it('never leaks tenants and preserves sequence',()=>expect(filterAudit('t1',e,{}).map(x=>x.seq)).toEqual([1,2]));it('filters actor/action/entity/time',()=>expect(filterAudit('t1',e,{actor:'u2',action:'APPROVE',entity:'p1',from:15,to:25})).toHaveLength(1))});