import { Router } from "express";
import { authenticateToken } from "../middleware/authMiddleware";
import * as ctrl from "../controllers/workInstructionController";

const router = Router();
router.use(authenticateToken);

router.get("/list", ctrl.getList);
router.get("/preview-no", ctrl.previewNextNo);
router.post("/save", ctrl.save);
router.post("/delete", ctrl.remove);
router.get("/source/item", ctrl.getItemSource);
router.get("/source/sales-order", ctrl.getSalesOrderSource);
router.get("/source/production-plan", ctrl.getProductionPlanSource);
router.get("/equipment", ctrl.getEquipmentList);
router.get("/employees", ctrl.getEmployeeList);

// 라우팅 & 공정작업기준
router.get("/:wiNo/routing-versions/:itemCode", ctrl.getRoutingVersions);
router.put("/:wiNo/routing", ctrl.updateRouting);
router.get("/:wiNo/work-standard", ctrl.getWorkStandard);
router.post("/:wiNo/work-standard/copy", ctrl.copyWorkStandard);
router.put("/:wiNo/work-standard/save", ctrl.saveWorkStandard);
router.delete("/:wiNo/work-standard/reset", ctrl.resetWorkStandard);

export default router;
