fix: resolve 404 balances endpoint and currency formatting errors

- Add missing /api/v1/balances endpoint to backend
- Update frontend Account type to match backend AccountDetails model
- Add currency validation with EUR fallback in formatCurrency function
- Update AccountsOverview, TransactionsList, and Dashboard components
- Fix balance calculations to use balances array structure
- All pre-commit checks pass
This commit is contained in:
Elisiário Couto
2025-09-08 23:45:31 +01:00
committed by Elisiário Couto
parent 947342e196
commit 417b77539f
6 changed files with 149 additions and 69 deletions

View File

@@ -163,11 +163,11 @@ export default function TransactionsList() {
className="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
>
<option value="">All accounts</option>
{accounts?.map((account) => (
<option key={account.id} value={account.id}>
{account.name} ({account.bank_name})
</option>
))}
{accounts?.map((account) => (
<option key={account.id} value={account.id}>
{account.name || 'Unnamed Account'} ({account.institution_id})
</option>
))}
</select>
</div>
@@ -259,10 +259,10 @@ export default function TransactionsList() {
{transaction.description}
</h4>
<div className="text-xs text-gray-500 space-y-1">
{account && (
<p>{account.name} {account.bank_name}</p>
)}
<div className="text-xs text-gray-500 space-y-1">
{account && (
<p>{account.name || 'Unnamed Account'} {account.institution_id}</p>
)}
{(transaction.creditor_name || transaction.debtor_name) && (
<p>