feat(belo): add analysis page with historical stats, chart, and date range picker

This commit is contained in:
Jose Selesan
2026-06-04 09:48:20 -03:00
parent bd53b26f29
commit 8b8a4670cb
9 changed files with 340 additions and 5 deletions

View File

@@ -38,6 +38,13 @@ export type DailyQuote = {
sell: number;
};
export type HistoricalMinMax = {
minBuy: number;
maxBuy: number;
minBuyDate: string | null;
maxBuyDate: string | null;
};
async function fetcher<T>(url: string): Promise<T> {
const res = await fetch(url, { credentials: "include" });
if (!res.ok) {
@@ -94,6 +101,10 @@ export function getDailyQuotes(
return fetcher<DailyQuote[]>(`/api/quotes/${type}/daily?${params}`);
}
export function getHistoricalMinMax(type: string): Promise<HistoricalMinMax> {
return fetcher<HistoricalMinMax>(`/api/quotes/${type}/historical/min-max`);
}
// Expenses
export type PeriodicExpense = {