import type { Request, Response } from 'express';
import ZoneCheckinService from '@/services/zone-checkin';

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

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

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

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

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