feat: group report transactions by report granularity

Make the outer accordion grouping in TransactionList granularity-aware
instead of hardcoded months. TransactionList accepts a granularity prop
(weekly/monthly/quarterly/yearly, default monthly); ReportViewer passes
the report's granularity so a weekly report buckets transactions by ISO
week, quarterly by quarter, yearly by year. Expense page keeps monthly
grouping. Add periodKey/periodLabel/groupByPeriod/toPeriodGranularity to
src/common/utils/transactions.ts and drop the dead groupByMonth/
GroupedMonth helpers.
This commit is contained in:
2026-08-20 14:37:52 +05:30
parent a107029b90
commit 47c00a06a8
4 changed files with 73 additions and 21 deletions

View File

@@ -11,14 +11,6 @@ export interface ExpenseItem {
updated_at?: string;
}
export interface GroupedMonth {
key: string;
items: ExpenseItem[];
spent: number;
income: number;
currency: string;
}
export interface TxnFieldConfigs {
entity: FieldConfig;
amount: FieldConfig;