From 9f3b8915ab20f177edafd3c4a4cc1ca0da0fc766 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 13 Jun 2025 07:22:04 +0000
Subject: (최겸) 기술영업 아이템 수정(컬럼명 및 item table FK 삭제, rfq에서
 사용하는 service 수정)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 lib/items-tech/table/update-items-sheet.tsx | 58 +++++------------------------
 1 file changed, 9 insertions(+), 49 deletions(-)

(limited to 'lib/items-tech/table/update-items-sheet.tsx')

diff --git a/lib/items-tech/table/update-items-sheet.tsx b/lib/items-tech/table/update-items-sheet.tsx
index efab4b1a..16dfcb71 100644
--- a/lib/items-tech/table/update-items-sheet.tsx
+++ b/lib/items-tech/table/update-items-sheet.tsx
@@ -61,29 +61,26 @@ const offshoreHullWorkTypes = [
   { value: "NC", label: "NC" },
 ] as const
 
-interface CommonItemFields {
+
+type ShipbuildingItem = {
   id: number
-  itemId: number
   itemCode: string
-  itemName: string
-  description: string | null
-  createdAt: Date
-  updatedAt: Date
-}
-
-type ShipbuildingItem = CommonItemFields & {
   workType: "기장" | "전장" | "선실" | "배관" | "철의"
   shipTypes: string
   itemList: string | null
 }
 
-type OffshoreTopItem = CommonItemFields & {
+type OffshoreTopItem = {
+  id: number
+  itemCode: string
   workType: "TM" | "TS" | "TE" | "TP"
   itemList: string | null
   subItemList: string | null
 }
 
-type OffshoreHullItem = CommonItemFields & {
+type OffshoreHullItem = {
+  id: number
+  itemCode: string
   workType: "HA" | "HE" | "HH" | "HM" | "NC"
   itemList: string | null
   subItemList: string | null
@@ -91,12 +88,9 @@ type OffshoreHullItem = CommonItemFields & {
 
 type UpdateItemSchema = {
   itemCode?: string
-  itemName?: string
-  description?: string
   workType?: string
   shipTypes?: string
   itemList?: string
-  subItemList?: string
 }
 
 interface UpdateItemSheetProps {
@@ -112,8 +106,6 @@ export function UpdateItemSheet({ item, itemType, open, onOpenChange }: UpdateIt
   // 초기값 설정
   const form = useForm<UpdateItemSchema>({
     defaultValues: {
-      itemName: item.itemName,
-      description: item.description || "",
       workType: item.workType,
       ...getItemTypeSpecificDefaults(item, itemType),
     },
@@ -127,7 +119,7 @@ export function UpdateItemSheet({ item, itemType, open, onOpenChange }: UpdateIt
       case 'shipbuilding':
         return {
           shipTypes: (item as ShipbuildingItem).shipTypes,
-          itemList: (item as ShipbuildingItem).itemList || ""
+          itemList: (item as ShipbuildingItem).itemList || "",
         };
       case 'offshoreTop':
       case 'offshoreHull':
@@ -279,25 +271,8 @@ export function UpdateItemSheet({ item, itemType, open, onOpenChange }: UpdateIt
                     </FormItem>
                   )}
                 />
-                <FormField
-                  control={form.control}
-                  name="itemList"
-                  render={({ field }) => (
-                    <FormItem>
-                      <FormLabel>아이템 리스트</FormLabel>
-                      <FormControl>
-                        <Input placeholder="아이템 리스트를 입력하세요" {...field} />
-                      </FormControl>
-                      <FormMessage />
-                    </FormItem>
-                  )}
-                />
               </>
             )}
-
-            {/* 해양 TOP 또는 HULL 아이템 전용 필드 */}
-            {(itemType === 'offshoreTop' || itemType === 'offshoreHull') && (
-              <>
                 <FormField
                   control={form.control}
                   name="itemList"
@@ -311,21 +286,6 @@ export function UpdateItemSheet({ item, itemType, open, onOpenChange }: UpdateIt
                     </FormItem>
                   )}
                 />
-                <FormField
-                  control={form.control}
-                  name="subItemList"
-                  render={({ field }) => (
-                    <FormItem>
-                      <FormLabel>서브 아이템 리스트</FormLabel>
-                      <FormControl>
-                        <Input placeholder="서브 아이템 리스트를 입력하세요" {...field} />
-                      </FormControl>
-                      <FormMessage />
-                    </FormItem>
-                  )}
-                />
-              </>
-            )}
             <SheetFooter>
               <SheetClose asChild>
                 <Button variant="outline">취소</Button>
-- 
cgit v1.2.3

