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:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user