import type { Request, Response } from 'express';
import { paramStr } from '@/api/http/request';
import WalkthroughCheckinsService from '@/services/walkthrough_checkins';

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

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

export async function remove(req: Request, res: Response): Promise<void> {
  const payload = await WalkthroughCheckinsService.remove(
    paramStr(req.params.id),
    req.currentUser,
  );
  res.status(200).send(payload);
}
