import type { Request, Response } from 'express';
import ClassAttendanceService from '@/services/class_attendance';

export async function summary(req: Request, res: Response): Promise<void> {
  const payload = await ClassAttendanceService.summary(req.query, req.currentUser);
  res.status(200).send(payload);
}

export async function upsert(req: Request, res: Response): Promise<void> {
  const payload = await ClassAttendanceService.upsert(
    req.params.classId,
    req.params.date,
    req.body.data,
    req.currentUser,
  );
  res.status(200).send(payload);
}
