Commit Graph

14 Commits

Author SHA1 Message Date
1400aa99d6 Enforce positive=CREDIT for all BANK account uploads
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>
2026-04-22 09:39:14 -04:00
038539c191 Remove dedupeHash and duplicate skipping from CSV upload
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>
2026-04-21 21:02:54 -04:00
6f1376cc53 Add TRANSFER transaction type with bulk action and auto-rules
- 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>
2026-04-21 20:15:07 -04:00
587ac19b18 Revert budget to net DEBIT-CREDIT formula, remove fix-cc-types endpoint
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>
2026-04-21 16:46:49 -04:00
5a795d7e93 Fix stale balances after transaction delete
- 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>
2026-04-21 16:30:24 -04:00
60dabb6264 Recompute account balance after bulk transaction delete
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>
2026-04-21 16:24:59 -04:00
da938c1fcf Fix account delete blocked by CsvUpload FK constraint
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>
2026-04-21 16:18:25 -04:00
0cf4612106 Add INVESTMENT account type with manual portfolio value recording 2026-04-21 11:32:50 -04:00
62ca178308 Remove CC type flip — normalizer already produces correct DEBIT/CREDIT for Discover CC 2026-04-21 10:59:59 -04:00
e6f5d5a33b reverted budget allocation for credit cards 2026-04-21 09:47:49 -04:00
7ccd64a7bb CC account value consistency 2026-04-21 08:25:16 -04:00
f4216815e8 added functionality for multi-edit of transactions 2026-04-20 23:17:56 -04:00
jerick
60fc836b73 feat: category import from CSV + budget auto-assign rules
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>
2026-04-20 22:56:41 -04:00
55debd082b first build commit 2026-04-19 00:44:43 -04:00