feat(analysis): add monthly variation table with inflation comparison

- New backend endpoint GET /api/quotes/monthly-last
- MonthlyVariationTable component with BELO/Blue/Oficial % changes
- Inflation data from ArgentinaDatos API with 24h cache
- Visual indicators: green if beats inflation, red if below
- Responsive: cards on mobile, table on desktop
This commit is contained in:
Jose Selesan
2026-08-27 10:13:56 -03:00
parent a6e95f0c05
commit 66ab56b46a
6 changed files with 389 additions and 0 deletions

View File

@@ -109,6 +109,30 @@ export function getHistoricalMinMax(type: string): Promise<HistoricalMinMax> {
return fetcher<HistoricalMinMax>(`/api/quotes/${type}/historical/min-max`);
}
export type MonthlyLast = {
month: string;
type: "BELO" | "BLUE" | "BNA";
buy: number;
};
export function getMonthlyLast(): Promise<MonthlyLast[]> {
return fetcher<MonthlyLast[]>("/api/quotes/monthly-last");
}
export type InflationMonth = {
fecha: string;
valor: number;
};
export function getInflation(): Promise<InflationMonth[]> {
return fetch(
"https://api.argentinadatos.com/v1/finanzas/indices/inflacion",
).then((r) => {
if (!r.ok) throw new Error(`Inflation API error: ${r.status}`);
return r.json();
});
}
// Expenses
export type PeriodicExpense = {