import { apiClient } from './client'; import type { EstadoResultados, FlujoEfectivo, ComparativoPeriodos, ConcentradoRfc } from '@horux/shared'; export async function getEstadoResultados(fechaInicio?: string, fechaFin?: string): Promise { const params = new URLSearchParams(); if (fechaInicio) params.set('fechaInicio', fechaInicio); if (fechaFin) params.set('fechaFin', fechaFin); const response = await apiClient.get(`/reportes/estado-resultados?${params}`); return response.data; } export async function getFlujoEfectivo(fechaInicio?: string, fechaFin?: string): Promise { const params = new URLSearchParams(); if (fechaInicio) params.set('fechaInicio', fechaInicio); if (fechaFin) params.set('fechaFin', fechaFin); const response = await apiClient.get(`/reportes/flujo-efectivo?${params}`); return response.data; } export async function getComparativo(año?: number): Promise { const params = año ? `?año=${año}` : ''; const response = await apiClient.get(`/reportes/comparativo${params}`); return response.data; } export async function getConcentradoRfc( tipo: 'cliente' | 'proveedor', fechaInicio?: string, fechaFin?: string ): Promise { const params = new URLSearchParams({ tipo }); if (fechaInicio) params.set('fechaInicio', fechaInicio); if (fechaFin) params.set('fechaFin', fechaFin); const response = await apiClient.get(`/reportes/concentrado-rfc?${params}`); return response.data; }