feat: rediseño de Grupos y pantalla "Requiere atención"
- Grupos: subtítulo con resumen (grupos · alumnos · lugares libres), sección "Requiere atención" con los 4 alumnos más urgentes y tarjetas con avatares (punteados por lugar libre en grupos chicos, superpuestos con "+N" en grandes; con alerta primero y anillo de gravedad). - Pantalla nueva /groups/attention: filtros Todos/Asistencia/Pagos, secciones Urgente y A vigilar, Contactar / Enviar recordatorio por wa.me y "Resuelto" persistente con update optimista. - FAB "Nuevo grupo" que se pliega al scrollear (respeta reduced motion); los toasts en mobile suben para no quedar debajo. - Alertas centralizadas en computeStudentAlerts (shared). La regla de asistencia pasa a: urgente = 3 seguidas o 4 de las últimas 6; a vigilar = 2 de las últimas 4 (sin inactividad por días ni tendencia). Cuotas: 1 vencida vigilar, 2+ urgente. - Backend: GET /attention y POST /attention/:attendeeId/resolve; tabla attendee_alert_resolutions (la alerta vuelve si cambia la firma). - Tokens de gravedad para claro y oscuro; se quita el indicador de pills. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -90,11 +90,34 @@ model Attendee {
|
||||
attendances Attendance[]
|
||||
slotReleases SlotRelease[]
|
||||
outboundMessages OutboundMessage[]
|
||||
alertResolutions AttendeeAlertResolution[]
|
||||
|
||||
@@index([groupId], map: "attendees_groupId_idx")
|
||||
@@map("attendees")
|
||||
}
|
||||
|
||||
enum StudentAlertKind {
|
||||
ATTENDANCE
|
||||
PAYMENT
|
||||
}
|
||||
|
||||
// "Resuelto" on the "Requiere atención" screen. One row per attendee and kind:
|
||||
// it hides the alert while its signature (last absence / overdue fees) stays
|
||||
// the same, so a new absence or a new overdue fee brings it back on its own.
|
||||
model AttendeeAlertResolution {
|
||||
id String @id @default(cuid())
|
||||
attendeeId String @map("attendee_id")
|
||||
kind StudentAlertKind
|
||||
signature String
|
||||
resolvedById String @map("resolved_by_id")
|
||||
resolvedAt DateTime @default(now()) @map("resolved_at")
|
||||
|
||||
attendee Attendee @relation(fields: [attendeeId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([attendeeId, kind])
|
||||
@@map("attendee_alert_resolutions")
|
||||
}
|
||||
|
||||
model Payment {
|
||||
id String @id @default(cuid())
|
||||
groupId String @map("group_id")
|
||||
|
||||
Reference in New Issue
Block a user