import { apiClient } from './client'; import type { KpiData, IngresosEgresosData, ResumenFiscal, Alerta } from '@horux/shared'; export async function getKpis(año?: number, mes?: number): Promise { const params = new URLSearchParams(); if (año) params.set('año', año.toString()); if (mes) params.set('mes', mes.toString()); const response = await apiClient.get(`/dashboard/kpis?${params}`); return response.data; } export async function getIngresosEgresos(año?: number): Promise { const params = new URLSearchParams(); if (año) params.set('año', año.toString()); const response = await apiClient.get(`/dashboard/ingresos-egresos?${params}`); return response.data; } export async function getResumenFiscal(año?: number, mes?: number): Promise { const params = new URLSearchParams(); if (año) params.set('año', año.toString()); if (mes) params.set('mes', mes.toString()); const response = await apiClient.get(`/dashboard/resumen-fiscal?${params}`); return response.data; } export async function getAlertas(limit = 5): Promise { const response = await apiClient.get(`/dashboard/alertas?limit=${limit}`); return response.data; }