mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-14 11:36:49 +07:00
Aurum — a self-hosted personal finance operating system: cash flow, net worth tracking, budgets, goals, recurring payments, reports, proactive alerts, and a compound-interest returns calculator, all bilingual (RU/EN) and mobile-first. Ships as a three-container Docker Compose stack (Postgres + FastAPI + nginx-served React frontend). See README.md for setup and CONTRIBUTING.md for development.
19 lines
769 B
TypeScript
19 lines
769 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
import { fetchCategoryRanking, fetchCategorySpendingReport } from "@/api/reports";
|
|
import type { CategoryKind } from "@/types";
|
|
|
|
export function useCategorySpendingReport(categoryId: number | null, startDate?: string, endDate?: string) {
|
|
return useQuery({
|
|
queryKey: ["category-spending-report", categoryId, startDate, endDate],
|
|
queryFn: () => fetchCategorySpendingReport(categoryId as number, startDate, endDate),
|
|
enabled: categoryId !== null,
|
|
});
|
|
}
|
|
|
|
export function useCategoryRanking(kind: CategoryKind, startDate?: string, endDate?: string) {
|
|
return useQuery({
|
|
queryKey: ["category-ranking", kind, startDate, endDate],
|
|
queryFn: () => fetchCategoryRanking(kind, startDate, endDate),
|
|
});
|
|
}
|