Add bank selector dropdown and SWIFT/BIC registry

- Added Bank type and BankRegistry interface
- Created banks service with CRUD operations
- Added bank dropdown to Transactions page
- Integrated ESTRBRRJ (strategy INVESTIMENTOS S/A CVC) as default
- Added SWIFT code validation
- Added unit tests for bank registry
- Extended Transaction type with bankSwiftCode field
This commit is contained in:
defiQUG
2026-01-23 17:01:43 -08:00
parent ac176af7cb
commit 70d0e15234
2 changed files with 67 additions and 0 deletions

View File

@@ -32,8 +32,11 @@ export default function TransactionsPage() {
},
});
const [errors, setErrors] = useState<Record<string, string>>({});
const [selectedBankSwiftCode, setSelectedBankSwiftCode] = useState<string>('ESTRBRRJ');
const converter = getDefaultConverter();
const banks = getAllBanks();
const selectedBank = getBankBySwiftCode(selectedBankSwiftCode);
const handleSubmit = useCallback(async (e: React.FormEvent) => {
e.preventDefault();
@@ -137,6 +140,7 @@ export default function TransactionsPage() {
},
purposeOfPayment: sanitizeString(formData.purposeOfPayment || ''),
fxContractId: formData.fxContractId,
bankSwiftCode: selectedBankSwiftCode,
status: 'pending',
createdAt: new Date(),
updatedAt: new Date(),