report models and prepareReport function

This commit is contained in:
2026-05-05 11:39:07 +05:30
parent 0e0928af95
commit f684083496
3 changed files with 16 additions and 145 deletions

View File

@@ -1,14 +1,18 @@
import { useResourceByName } from "../../../react-openapi";
export interface ReportParams {
period: "weekly" | "monthly" | "yearly" | "fyly";
period: "weekly" | "monthly" | "yearly" | "fyly" | "full";
rolling?: boolean;
report_date?: string;
group_by?: ("flow" | "payee" | "tags")[];
group_by?: ("payee" | "tags")[];
ignore_self?: 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);
}