Implement UI components and quick wins
- Complete Dashboard page with statistics, recent activity, compliance status - Complete Transactions page with form, validation, E&O uplift display - Complete Treasury page with account management - Complete Reports page with BCB report generation and export - Add LoadingSpinner component - Add ErrorBoundary component - Add Toast notification system - Add comprehensive input validation - Add error handling utilities - Add basic unit tests structure - Fix XML exporter TypeScript errors - All quick wins completed
This commit is contained in:
46
packages/rules-engine/src/__tests__/threshold.test.ts
Normal file
46
packages/rules-engine/src/__tests__/threshold.test.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { describe, it, expect, beforeEach } from 'vitest';
|
||||
import { evaluateThreshold } from '../threshold';
|
||||
import { setConfig, DEFAULT_CONFIG } from '../config';
|
||||
import type { Transaction } from '@brazil-swift-ops/types';
|
||||
|
||||
describe('Threshold Evaluation', () => {
|
||||
beforeEach(() => {
|
||||
setConfig(DEFAULT_CONFIG);
|
||||
});
|
||||
|
||||
it('should flag transactions >= USD 10,000 for reporting', () => {
|
||||
const transaction: Transaction = {
|
||||
id: 'TXN-1',
|
||||
direction: 'outbound',
|
||||
amount: 50000,
|
||||
currency: 'USD',
|
||||
orderingCustomer: { name: 'Test', country: 'BR' },
|
||||
beneficiary: { name: 'Test', country: 'BR' },
|
||||
status: 'pending',
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
};
|
||||
|
||||
const result = evaluateThreshold(transaction);
|
||||
expect(result.requiresReporting).toBe(true);
|
||||
expect(result.usdEquivalent).toBeGreaterThanOrEqual(10000);
|
||||
});
|
||||
|
||||
it('should not flag transactions < USD 10,000', () => {
|
||||
const transaction: Transaction = {
|
||||
id: 'TXN-2',
|
||||
direction: 'outbound',
|
||||
amount: 5000,
|
||||
currency: 'USD',
|
||||
orderingCustomer: { name: 'Test', country: 'BR' },
|
||||
beneficiary: { name: 'Test', country: 'BR' },
|
||||
status: 'pending',
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
};
|
||||
|
||||
const result = evaluateThreshold(transaction);
|
||||
expect(result.requiresReporting).toBe(false);
|
||||
expect(result.usdEquivalent).toBeLessThan(10000);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user