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:
defiQUG
2026-01-23 16:32:41 -08:00
parent adb2b3620b
commit 7558268f9d
20 changed files with 2135 additions and 28 deletions

View 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);
});
});