mirror of
https://github.com/elisiariocouto/leggen.git
synced 2025-12-14 07:22:25 +00:00
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:
@@ -36,7 +36,8 @@ class AccountDetails(BaseModel):
|
||||
class Transaction(BaseModel):
|
||||
"""Transaction model"""
|
||||
|
||||
internal_transaction_id: Optional[str] = None
|
||||
transaction_id: str # NEW: stable bank-provided transaction ID
|
||||
internal_transaction_id: Optional[str] = None # OLD: unstable GoCardless ID
|
||||
institution_id: str
|
||||
iban: Optional[str] = None
|
||||
account_id: str
|
||||
@@ -54,6 +55,7 @@ class Transaction(BaseModel):
|
||||
class TransactionSummary(BaseModel):
|
||||
"""Transaction summary for lists"""
|
||||
|
||||
transaction_id: str # NEW: stable bank-provided transaction ID
|
||||
internal_transaction_id: Optional[str] = None
|
||||
date: datetime
|
||||
description: str
|
||||
|
||||
Reference in New Issue
Block a user