diff options
Diffstat (limited to 'lib/items-tech/table/hull/import-item-handler.tsx')
| -rw-r--r-- | lib/items-tech/table/hull/import-item-handler.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/items-tech/table/hull/import-item-handler.tsx b/lib/items-tech/table/hull/import-item-handler.tsx index aa0c7992..8c8fc57d 100644 --- a/lib/items-tech/table/hull/import-item-handler.tsx +++ b/lib/items-tech/table/hull/import-item-handler.tsx @@ -4,11 +4,11 @@ import { z } from "zod" import { createOffshoreHullItem } from "../../service" // 해양 HULL 기능(공종) 유형 enum -const HULL_WORK_TYPES = ["HA", "HE", "HH", "HM", "NC"] as const; +const HULL_WORK_TYPES = ["HA", "HE", "HH", "HM", "HO", "HP", "NC"] as const; // 아이템 데이터 검증을 위한 Zod 스키마 const itemSchema = z.object({ - itemCode: z.string().min(1, "아이템 코드는 필수입니다"), + itemCode: z.string().optional(), workType: z.enum(HULL_WORK_TYPES, { required_error: "기능(공종)은 필수입니다", }), @@ -19,7 +19,7 @@ const itemSchema = z.object({ interface ProcessResult { successCount: number; errorCount: number; - errors?: Array<{ row: number; message: string }>; + errors: Array<{ row: number; message: string; itemCode?: string; workType?: string }>; } /** @@ -45,7 +45,7 @@ export async function processHullFileImport( // 데이터 행이 없으면 빈 결과 반환 if (dataRows.length === 0) { - return { successCount: 0, errorCount: 0 }; + return { successCount: 0, errorCount: 0, errors: [] }; } // 각 행에 대해 처리 @@ -89,7 +89,7 @@ export async function processHullFileImport( // 해양 HULL 아이템 생성 const result = await createOffshoreHullItem({ itemCode: cleanedRow.itemCode, - workType: cleanedRow.workType as "HA" | "HE" | "HH" | "HM" | "NC", + workType: cleanedRow.workType as "HA" | "HE" | "HH" | "HM" | "HO" | "HP" | "NC", itemList: cleanedRow.itemList, subItemList: cleanedRow.subItemList, }); |
