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:
@@ -0,0 +1,26 @@
|
||||
-- Notas de apartado y bitácora de auditoría.
|
||||
-- Patrón manual: db execute + migrate resolve. NUNCA migrate dev.
|
||||
|
||||
-- CreateTable NotaApartado
|
||||
CREATE TABLE IF NOT EXISTS "NotaApartado" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"apartadoId" TEXT NOT NULL,
|
||||
"usuarioId" TEXT NOT NULL,
|
||||
"contenido" TEXT NOT NULL,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "NotaApartado_apartadoId_idx" ON "NotaApartado"("apartadoId");
|
||||
|
||||
-- CreateTable AuditoriaLog
|
||||
CREATE TABLE IF NOT EXISTS "AuditoriaLog" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"usuarioId" TEXT NOT NULL,
|
||||
"accion" TEXT NOT NULL,
|
||||
"entidad" TEXT NOT NULL,
|
||||
"entidadId" TEXT NOT NULL,
|
||||
"detalle" TEXT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS "AuditoriaLog_usuarioId_idx" ON "AuditoriaLog"("usuarioId");
|
||||
CREATE INDEX IF NOT EXISTS "AuditoriaLog_entidad_entidadId_idx" ON "AuditoriaLog"("entidad", "entidadId");
|
||||
CREATE INDEX IF NOT EXISTS "AuditoriaLog_createdAt_idx" ON "AuditoriaLog"("createdAt");
|
||||
@@ -387,3 +387,40 @@ model AsignacionLocal {
|
||||
@@unique([leadCapturaId])
|
||||
@@index([usuarioId])
|
||||
}
|
||||
|
||||
model NotaApartado {
|
||||
id String @id @default(uuid())
|
||||
apartadoId String
|
||||
usuarioId String
|
||||
contenido String
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([apartadoId])
|
||||
}
|
||||
|
||||
model AuditoriaLog {
|
||||
id String @id @default(uuid())
|
||||
usuarioId String
|
||||
accion String
|
||||
entidad String
|
||||
entidadId String
|
||||
detalle String?
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([usuarioId])
|
||||
@@index([entidad, entidadId])
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
// Suscripciones push de los navegadores (Web Push API)
|
||||
model PushSubscription {
|
||||
id String @id @default(uuid())
|
||||
usuarioId String
|
||||
endpoint String
|
||||
p256dh String
|
||||
auth String
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@unique([usuarioId])
|
||||
@@index([usuarioId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user