// ============================================================
// 생산관리 > 생산계획&실적 + 소요량 라우트.
// app.ts:
//   app.use("/api/production/plan-result",     productionPlanResultRoutes)
//   app.use("/api/production/mbom-requirement", productionMbomRequirementRoutes)
// 각 라우트는 동일 컨트롤러를 공유하므로 한 파일에서 두 Router 를 export.
// ============================================================

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

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

planResultRouter.get("/list",            ctrl.getList);            // 메뉴1
planResultRouter.get("/list-equip",      ctrl.getListEquip);       // 메뉴2
planResultRouter.get("/project-options", ctrl.getProjectOptions);  // 공용 검색 옵션
planResultRouter.get("/writer-options",  ctrl.getWriterOptions);   // 메뉴1 등록자

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

mbomReqRouter.get("/options",  ctrl.getMbomOptions);     // 메뉴3+4 공용 M-BOM 옵션
mbomReqRouter.post("/semi",    ctrl.getSemiRequirement); // 메뉴3 반제품
mbomReqRouter.post("/raw",     ctrl.getRawRequirement);  // 메뉴4 원자재

export { planResultRouter, mbomReqRouter };
