- Implemented AbsenceNotifyView for notifying absence with session details. - Created AnalyticsView for displaying group analytics and managing students at risk. - Added ClassAttendanceView for marking attendance in classes. - Defined new schemas for analytics and attendance in shared package.
20 lines
732 B
TypeScript
20 lines
732 B
TypeScript
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;
|