import { Router } from "express";
import { authenticateToken } from "../middleware/authMiddleware";
import {
  createWorkProcesses,
  controlTimer,
  controlGroupTimer,
  getDefectTypes,
  saveResult,
  confirmResult,
  getResultHistory,
  getAvailableQty,
  acceptProcess,
  cancelAccept,
} from "../controllers/popProductionController";

const router = Router();

router.use(authenticateToken);

router.post("/create-work-processes", createWorkProcesses);
router.post("/timer", controlTimer);
router.post("/group-timer", controlGroupTimer);
router.get("/defect-types", getDefectTypes);
router.post("/save-result", saveResult);
router.post("/confirm-result", confirmResult);
router.get("/result-history", getResultHistory);
router.get("/available-qty", getAvailableQty);
router.post("/accept-process", acceptProcess);
router.post("/cancel-accept", cancelAccept);

export default router;
