import type { PublicNotifyAbsence } from '@gruperly/shared'; import { PublicNotifyAbsenceSchema } from '@gruperly/shared'; import { Hono } from 'hono'; import { resultJson } from '@/http/problem-details'; import { validate } from '@/http/validate'; import { PublicNotifyAbsenceUseCase } from './use-case'; const route = new Hono(); // Ruta pública (whitelistada en session-auth): el alumno avisa su ausencia con token. route.post('/notify-absence', validate.json(PublicNotifyAbsenceSchema), async (c) => { const payload = c.req.valid('json') as PublicNotifyAbsence; const useCase = new PublicNotifyAbsenceUseCase(); const result = await useCase.execute(payload); return resultJson(c, result); }); export default route;