Accounts: rename, set the kind (bank account or credit card), and delete

- An Edit button on every account: name, and what kind it is (bank account,
  credit card, loan, investment, something else). The kind decides where it
  counts: a credit card's balance is money you owe.
- The kind you pick sticks: migration 0031 adds accounts.type_override, and a
  trigger puts it back whenever a sync writes the bank's type, so every page
  keeps reading accounts.type.
- An imported or hand-added credit card or loan now adds its purchases to what
  you owe (it subtracted them, as for a bank account).
- Delete for accounts you added or imported, with their transactions. A linked
  account says to hide it or remove the bank, since sync would bring it back.

Tested on a local Supabase: rename + Credit card moved the imported account
under Credit cards; a sync-style write of type depository kept it credit;
deleting removed it and its 358 transactions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
minimus7andClaude Opus 5.5 committed 2026-11-12 11:05:36 -06:00
1 parent 1cf12f4619
commit b4a5044f8a
3 files changed
+128

No files matched your search

+2
View File
@@ -1,5 +1,6 @@
import { Banknote, BarChart3, Bitcoin, Car, CreditCard, Gem, HandCoins, House, Landmark, type LucideIcon } from "lucide-react";
import Link from "next/link";
import { AccountEdit } from "@/components/AccountEdit";
import { AccountToggle } from "@/components/AccountToggle";
import { HoldingFee } from "@/components/HoldingFee";
import { CardArt } from "@/components/CardArt";
@@ -123,6 +124,7 @@ export default async function Accounts() {
<div className="text-xs text-muted">{a.item.institution_name}{a.subtype ? ` · ${subtypeLabel(a.subtype)}` : ""}</div>
</div>
<span className="tabular font-medium">{money(a.current_balance, a.currency)}</span>
<AccountEdit id={a.id} name={a.custom_name || a.name} bankName={a.name} type={a.type} manual={a.item.id === "manual"} />
<AccountToggle id={a.id} included={a.included} name={a.custom_name || a.name} />
</div>
{!!a.holdings?.length && (