new report structure

This commit is contained in:
2026-05-06 14:11:03 +05:30
parent 7470da6d2d
commit 15f76eb5f0
10 changed files with 138 additions and 350 deletions

View File

@@ -1,18 +1,20 @@
import { useResourceByName } from "../../../react-openapi";
export interface ReportParams {
period: "weekly" | "monthly" | "yearly" | "fyly" | "full";
periods?: ("weekly" | "monthly" | "yearly" | "fyly" | "full")[];
rolling?: boolean;
report_date?: string;
group_by?: ("payee" | "tags")[];
ignore_self?: boolean;
include_transactions?: boolean;
}
export function useReport(params: ReportParams) {
const { useList } = useResourceByName("reports");
if (params.group_by) {
// @ts-ignore
params.group_by = params.group_by[0]
}
return useList(params);
}
return useList({
...params,
periods: params.periods,
group_by: params.group_by,
});
}