feat(mejoras): 14 mejoras al CRM Frasa
Fase 1 - UI: dark mode, skeletons, toasts Fase 2 - Filtros: avanzados Mi día, búsqueda global Ctrl+K Fase 3 - Datos: export Excel, notas apartados, auditoría Fase 4 - Dashboard: gráficas vendedor + métricas uso Fase 5 - Responsive: tablets optimizadas Fase 6 - PWA: IndexedDB offline, push notifications Backend: 3 tablas nuevas, 6 services, 6 endpoints nuevos 721 API tests + fronts verdes.
This commit is contained in:
@@ -108,6 +108,37 @@ export async function patchUsuarioConfig(
|
||||
if (!resp.ok) throw new Error(`HTTP ${resp.status}`)
|
||||
}
|
||||
|
||||
// ─── Auditoría ─────────────────────────────────────────────────
|
||||
|
||||
export interface AuditoriaItem {
|
||||
id: string
|
||||
usuarioId: string
|
||||
accion: string
|
||||
entidad: string
|
||||
entidadId: string
|
||||
detalle: string | null
|
||||
createdAt: string // ISO
|
||||
}
|
||||
|
||||
/** GET /auditoria — registros de auditoría con filtros opcionales */
|
||||
export async function getAuditoria(filtros?: {
|
||||
entidad?: string
|
||||
usuario?: string
|
||||
desde?: string
|
||||
hasta?: string
|
||||
}): Promise<AuditoriaItem[]> {
|
||||
const params = new URLSearchParams()
|
||||
if (filtros?.entidad) params.set('entidad', filtros.entidad)
|
||||
if (filtros?.usuario) params.set('usuario', filtros.usuario)
|
||||
if (filtros?.desde) params.set('desde', filtros.desde)
|
||||
if (filtros?.hasta) params.set('hasta', filtros.hasta)
|
||||
const qs = params.toString()
|
||||
const resp = await fetch(`${API_URL}/auditoria${qs ? `?${qs}` : ''}`, conAuth())
|
||||
manejar401(resp)
|
||||
if (!resp.ok) throw new Error(`HTTP ${resp.status}`)
|
||||
return (await resp.json()) as AuditoriaItem[]
|
||||
}
|
||||
|
||||
// ─── Acciones ────────────────────────────────────────────────────
|
||||
|
||||
/** GET /config/acciones — acciones disponibles para el rol del usuario actual */
|
||||
|
||||
Reference in New Issue
Block a user