Instead of relying on per-profile invertAmountSign settings, the upload
route now overrides invertAmountSign: true for any BANK account using
Strategy A. This ensures positive CSV amounts always map to CREDIT
(deposits) regardless of which bank or whether profile was auto-detected.
Credit card logic is unchanged.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Drop dedupeHash field and unique constraint from Transaction model.
Remove skipDuplicates from createMany. All rows in every upload are
now inserted unconditionally.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add TRANSFER to TransactionType enum; excluded from cash flow queries
- Add TransferRule model: description patterns that auto-mark transactions
as transfers on upload (takes priority over budget rules)
- Bulk action "Mark as transfer" in transaction table
- Transfer Rules button/dialog on transactions page for managing patterns
- Transfers shown with ⇄ prefix and muted color in transaction list
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Budget formula correctly adds DEBIT (CC charges stored from positive CSV
values) and subtracts CREDIT (refunds from negative CSV values).
Remove the fix-cc-types endpoint which was flipping CC transaction types
and causing charges to appear as CREDIT.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Bulk delete now recomputes currentBalanceCents and BalanceSnapshot
records for every affected account+month after deletion
- Add POST /api/admin/recalculate-balances to fix currently stale
accounts (zeros out balances and removes orphaned snapshots)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
After deleting transactions, recalculate currentBalanceCents for each
affected account so the account card and net worth dashboard stay accurate.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add onDelete: Cascade to CsvUpload.accountId so deleting an account
cascades to its upload records. Also explicitly delete uploads before
the account in the API route so existing deployed DBs without the
constraint don't error.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Category:
- Add categoryColumn to NormalizerConfig and NormalizedRow
- Map 'Category' column for Discover CC profile
- Write category to Transaction on upload
Budget rules:
- Add BudgetRule model (userId, budgetId, pattern)
- API: GET/POST /api/budget-rules, DELETE /api/budget-rules/:id
- Apply rules during upload (first case-insensitive match wins)
- Budgets page fetches and passes rules per budget
- BudgetCard 'Rules' menu item opens BudgetRulesDialog for add/delete
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>