Simpl-Resultat/src/components/transactions
le king fu 0e996a5aa1 feat(transactions): inline transfer icon + FK error message
Issue #142 / Bilan #4 — non-regressive transfer awareness in the
transactions table + clean error mapping on bulk delete.

- `TransactionTable.tsx`: optional new prop
  `linkedTransfersByTxId?: Map<txId, links[]>`. When supplied, a small
  `<Link2>` icon appears next to the description for every linked
  transaction; tooltip lists the account name(s) and direction(s).
  Without the prop, the table renders byte-for-byte identical to
  before — preserves the spec's non-regression invariant.
- `TransactionsPage.tsx`: loads the linked-transfers map once on mount
  via `listAllLinkedTransfersForTooltip()` (one batch SELECT) and
  threads it through to the table. Failure to load the map degrades
  gracefully to an empty map (icon simply doesn't appear).
- `transactionService.ts`: new `deleteTransaction(id)` helper +
  `TransactionLinkedToBalanceError` (typed FK guard). Pre-checks
  `balance_account_transfers` before attempting the DELETE so the
  error carries the offending account names; falls back to the FK
  pattern matcher if a race linked the transaction between the
  SELECT and the DELETE.
- `importedFileService.ts`: both bulk delete paths
  (`deleteImportWithTransactions`, `deleteAllImportsWithTransactions`)
  now pre-check for any linked transfer and surface the same typed
  error before they would explode on FK RESTRICT. The pre-check has
  a `LIMIT 50` safety cap on the global path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 16:38:46 -04:00
..
SplitAdjustmentModal.tsx feat: add transaction split adjustments across multiple categories 2026-02-16 23:51:36 +00:00
TransactionFilterBar.tsx feat: add period quick-select filter to transactions page 2026-02-15 17:32:08 +00:00
TransactionPagination.tsx feat: implement transactions page with filters, sorting, and inline editing 2026-02-08 22:54:18 +00:00
TransactionSummaryBar.tsx fix: show expenses as absolute value and add balance card to transaction summary 2026-02-08 23:30:44 +00:00
TransactionTable.tsx feat(transactions): inline transfer icon + FK error message 2026-04-25 16:38:46 -04:00