Files
finance-app/src/lib/categories.ts
T
siddharthd 278e57354c feat(insights): analytics drill-down, fee tracking, and category improvements
- Monthly spend chart with category breakdown drill-down
- Merchant frequency and spend analytics with per-merchant history
- Subscription detection and recurring charge tracking
- Fee and interest analytics endpoint
- Expanded category list with formatCategory display helper
2026-03-14 20:06:24 +11:00

44 lines
842 B
TypeScript

export const REGULAR_CATEGORIES = new Set([
"rent", "utilities", "insurance", "subscriptions",
"groceries", "dining", "transport", "fuel",
"health", "personal_care", "government", "charity", "pets",
] as const);
export const CATEGORIES = [
"groceries",
"dining",
"transport",
"fuel",
"shopping",
"utilities",
"entertainment",
"travel",
"health",
"insurance",
"subscriptions",
"cash_advance",
"government",
"education",
"rent",
"home_goods",
"home_maintenance",
"transfers",
"income",
"investment",
"personal_care",
"pets",
"gifts",
"charity",
"fees",
"other",
] as const;
export type Category = (typeof CATEGORIES)[number];
export function formatCategory(cat: string): string {
return cat
.split("_")
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
.join(" ");
}