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.
This commit is contained in:
kjs
2026-04-24 18:23:32 +09:00
parent 3d339f4846
commit 5518288f18
3 changed files with 6 additions and 6 deletions

View File

@@ -80,7 +80,7 @@ async function upsertInventoryStock(
*
* 전략: routingDetailId가 있으면 원본 템플릿에서, 없으면 마스터의 기존 결과에서 복사
*/
async function copyChecklistToSplit(
export async function copyChecklistToSplit(
client: { query: (text: string, values?: any[]) => Promise<any> },
masterProcessId: string,
newProcessId: string,

View File

@@ -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;

View File

@@ -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);