- 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
44 lines
842 B
TypeScript
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(" ");
|
|
}
|