feat(alertas): add alerts CRUD with stats and management UI
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
30
apps/web/lib/hooks/use-reportes.ts
Normal file
30
apps/web/lib/hooks/use-reportes.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import * as reportesApi from '../api/reportes';
|
||||
|
||||
export function useEstadoResultados(fechaInicio?: string, fechaFin?: string) {
|
||||
return useQuery({
|
||||
queryKey: ['estado-resultados', fechaInicio, fechaFin],
|
||||
queryFn: () => reportesApi.getEstadoResultados(fechaInicio, fechaFin),
|
||||
});
|
||||
}
|
||||
|
||||
export function useFlujoEfectivo(fechaInicio?: string, fechaFin?: string) {
|
||||
return useQuery({
|
||||
queryKey: ['flujo-efectivo', fechaInicio, fechaFin],
|
||||
queryFn: () => reportesApi.getFlujoEfectivo(fechaInicio, fechaFin),
|
||||
});
|
||||
}
|
||||
|
||||
export function useComparativo(año?: number) {
|
||||
return useQuery({
|
||||
queryKey: ['comparativo', año],
|
||||
queryFn: () => reportesApi.getComparativo(año),
|
||||
});
|
||||
}
|
||||
|
||||
export function useConcentradoRfc(tipo: 'cliente' | 'proveedor', fechaInicio?: string, fechaFin?: string) {
|
||||
return useQuery({
|
||||
queryKey: ['concentrado-rfc', tipo, fechaInicio, fechaFin],
|
||||
queryFn: () => reportesApi.getConcentradoRfc(tipo, fechaInicio, fechaFin),
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user