feat(frontend): adapt to composite key transaction structure

- Update Transaction interface to include stable transaction_id field
- Modify TransactionsList to use stable transaction_id for React keys
- Update API models to handle new transactionId field from database
- Fix API routes to properly map transaction_id in responses
- Update test mocks to include transactionId field
- Ensure backward compatibility with internal_transaction_id

This adapts the frontend to work with the new composite primary key
(accountId, transactionId) structure that prevents duplicate transactions.
This commit is contained in:
Elisiário Couto
2025-09-10 21:11:26 +01:00
parent 13e92ccd34
commit 61fafecb78
6 changed files with 24 additions and 15 deletions

View File

@@ -56,7 +56,8 @@ export interface RawTransactionData {
}
export interface Transaction {
internal_transaction_id: string | null;
transaction_id: string; // NEW: stable bank-provided transaction ID
internal_transaction_id: string | null; // OLD: unstable GoCardless ID
account_id: string;
transaction_value: number;
transaction_currency: string;