From 5518288f18c9289ae9cd2309a3e6d4d44e90f61b Mon Sep 17 00:00:00 2001 From: kjs Date: Fri, 24 Apr 2026 18:23:32 +0900 Subject: [PATCH] refactor(pop): update popProductionController and routes - Changed the `copyChecklistToSplit` function to be exported for better accessibility. - Temporarily commented out the `getProcessList` and `getProcessResult` routes in `popProductionRoutes` due to missing implementations, with a note for future restoration. - Updated the loop in `salesOrderBulkService` to use `Array.from()` for better clarity in iterating over entries. These changes aim to improve code organization and maintainability while addressing current implementation gaps. --- backend-node/src/controllers/popProductionController.ts | 2 +- backend-node/src/routes/popProductionRoutes.ts | 8 ++++---- backend-node/src/services/salesOrderBulkService.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend-node/src/controllers/popProductionController.ts b/backend-node/src/controllers/popProductionController.ts index 4d747830..5420ed69 100644 --- a/backend-node/src/controllers/popProductionController.ts +++ b/backend-node/src/controllers/popProductionController.ts @@ -80,7 +80,7 @@ async function upsertInventoryStock( * * 전략: routingDetailId가 있으면 원본 템플릿에서, 없으면 마스터의 기존 결과에서 복사 */ -async function copyChecklistToSplit( +export async function copyChecklistToSplit( client: { query: (text: string, values?: any[]) => Promise }, masterProcessId: string, newProcessId: string, diff --git a/backend-node/src/routes/popProductionRoutes.ts b/backend-node/src/routes/popProductionRoutes.ts index eea9ebad..ab43a5fc 100644 --- a/backend-node/src/routes/popProductionRoutes.ts +++ b/backend-node/src/routes/popProductionRoutes.ts @@ -23,8 +23,8 @@ import { saveMaterialInput, getMaterialInputs, getChecklistItems, - getProcessList, - getProcessResult, + // TODO(mhkim-node merge): getProcessList / getProcessResult 함수가 popProductionController에 정의되어 있지 않음. + // 브랜치 머지 시 함수 구현 누락으로 서버 기동 실패. 복구되면 import 및 router.get 복원 필요. } from "../controllers/popProductionController"; const router = Router(); @@ -53,7 +53,7 @@ router.get("/bom-materials/:processId", getBomMaterials); router.post("/material-input", saveMaterialInput); router.get("/material-inputs/:processId", getMaterialInputs); router.get("/checklist-items/:processId", getChecklistItems); -router.get("/processes", getProcessList); -router.get("/result/:id", getProcessResult); +// router.get("/processes", getProcessList); // TODO: 함수 미구현으로 임시 비활성화 +// router.get("/result/:id", getProcessResult); // TODO: 함수 미구현으로 임시 비활성화 export default router; diff --git a/backend-node/src/services/salesOrderBulkService.ts b/backend-node/src/services/salesOrderBulkService.ts index f83828e0..222d95f3 100644 --- a/backend-node/src/services/salesOrderBulkService.ts +++ b/backend-node/src/services/salesOrderBulkService.ts @@ -255,7 +255,7 @@ export async function excelBulkUpload( // 3) 그룹별 마스터 UPSERT + 디테일 INSERT let autoOrderNo: string | null = null; - for (const [key, items] of groups.entries()) { + for (const [key, items] of Array.from(groups.entries())) { let orderNo = key; if (key === "__AUTO__") { if (!autoOrderNo) autoOrderNo = await allocateOrderNo(payload.companyCode, client);