polish(reports): drop dead category_type projection from the monthly query (#256 review)

getCategoryOverTime's monthly pivot selected COALESCE(c.type,'expense') AS
category_type but nothing read it — the `types` map is built from the top-N
query. Remove the unused projection and its row-type field. No behaviour change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
le king fu 2026-07-05 20:55:16 -04:00
parent 44976767d1
commit 450229522b

View file

@ -140,7 +140,6 @@ export async function getCategoryOverTime(
month: string; month: string;
category_id: number | null; category_id: number | null;
category_name: string; category_name: string;
category_type: "expense" | "income" | "transfer";
total: number; total: number;
}> }>
>( >(
@ -148,7 +147,6 @@ export async function getCategoryOverTime(
strftime('%Y-%m', t.date) AS month, strftime('%Y-%m', t.date) AS month,
t.category_id, t.category_id,
COALESCE(c.name, 'Uncategorized') AS category_name, COALESCE(c.name, 'Uncategorized') AS category_name,
COALESCE(c.type, 'expense') AS category_type,
ABS(SUM(t.amount)) AS total ABS(SUM(t.amount)) AS total
FROM transactions t FROM transactions t
LEFT JOIN categories c ON t.category_id = c.id LEFT JOIN categories c ON t.category_id = c.id