fix(transactions): editable transaction type, fee/interest counted as spend, fees category

- TypeBadge is now clickable — opens inline select to change debit/credit/fee/interest/etc.
- PATCH /api/transactions/[id] now accepts transaction_type, updates transactions table directly
- Analytics monthly query includes fee and interest types as spend (not just debit)
- fee and interest amounts show red in transaction list (same as debit)
- Add fees category to taxonomy
This commit is contained in:
2026-03-10 00:24:42 +11:00
parent 714c5a9b25
commit dd11019fdf
5 changed files with 74 additions and 14 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ export async function GET(req: NextRequest) {
LEFT JOIN transaction_splits ts ON ts.transaction_id = t.id AND ts.participant_id = $1
JOIN statements s ON s.id = t.statement_id
WHERE s.owner_id = $1
AND t.transaction_type = 'debit'
AND t.transaction_type IN ('debit', 'fee', 'interest')
AND COALESCE(o.category_override, t.category) NOT IN ('transfers', 'investment')
AND t.transaction_date >= $2
AND t.transaction_date < $3