feat(api): add timezone support for group fetching and increase page size

feat(attendance): refactor attendance summary logic and update tests

feat(analytics): extend GroupRiskSummary schema with absence and attendance counts

feat(groups): enhance group schema with attendee and waitlist counts

chore(skills): add frontend design skill with guidelines and license

feat(attendee-detail): implement AttendeePhoneLine component for phone display

feat(groups): create AttendanceBadge and CapacityIndicator components for group cards

feat(groups): add card utility functions for attendance alerts and capacity summaries

test(groups): implement tests for attendance alert and capacity summary logic
This commit is contained in:
Jose Selesan
2026-09-30 17:39:13 -03:00
parent 4e86096653
commit 454f20ed25
31 changed files with 1323 additions and 250 deletions

View File

@@ -7,7 +7,7 @@ import { cn } from '../../lib/utils'
import {
attendanceStatusClass,
attendanceStatusLabel,
attendanceSummaryLabel,
attendanceSummary,
formatSessionShortDate,
HISTORY_LIMIT,
HISTORY_PREVIEW,
@@ -67,14 +67,15 @@ export function AttendeeAttendanceSection() {
const visible = visibleSessions(sessions, showAll)
const hasMore = sessions.length > HISTORY_PREVIEW
const isCapped = sessions.length >= HISTORY_LIMIT
const summary = attendanceSummary(visible)
return (
<Section title="Asistencia" trailing={attendanceSummaryLabel(visible)}>
<Section title="Asistencia" trailing={summary.label}>
<ul className="divide-y divide-border/60">
{visible.map((session) => {
const Icon = iconFor(session.status)
return (
<li key={session.classSessionId} className="flex items-center justify-between gap-3 py-2.5">
<li key={session.classSessionId} className="flex items-center justify-between gap-3 py-2">
<span className="truncate text-sm text-primary">
{formatSessionShortDate(session.startsAt)}
</span>
@@ -92,6 +93,12 @@ export function AttendeeAttendanceSection() {
})}
</ul>
{/* Las clases sin registro no son ausencias: se avisa aparte y en voz baja
para que el "1 de 1" de arriba no se lea como un fallo. */}
{summary.unmarkedLabel ? (
<p className="pt-2 text-right text-xs text-foreground">{summary.unmarkedLabel}</p>
) : null}
{showAll && isCapped ? (
<p className="pt-2 text-xs text-foreground">
El historial guarda las últimas {HISTORY_LIMIT} clases.
@@ -104,7 +111,7 @@ export function AttendeeAttendanceSection() {
variant="ghost"
onClick={() => setShowAll((value) => !value)}
aria-expanded={showAll}
className="h-11 gap-1 px-2 text-sm text-accent hover:text-accent-strong"
className="h-11 gap-1 px-2 text-sm text-accent-fg hover:text-primary"
>
{showAll ? 'Ver menos' : `Ver todas (${sessions.length})`}
<ChevronDown className={cn('size-4 transition-transform', showAll && 'rotate-180')} />