/**
 * ItemForm 상수 정의
 */

// 부품 유형별 분류 체계
export const PART_TYPE_CATEGORIES = {
  ASSEMBLY: {
    label: "조립 부품 (Assembly Part)",
    categories: [
      { value: "guide_rail", label: "가이드레일", code: "R" },
      { value: "case", label: "케이스", code: "C" },
      { value: "bottom_finish", label: "하단마감재", code: "B" },
    ]
  },
  BENDING: {
    label: "절곡 부품 (Bending Part)",
    categories: [
      { value: "guide_rail_wall", label: "가이드레일(벽면형)", code: "R" },
      { value: "guide_rail_side", label: "가이드레일(측면형)", code: "S" },
      { value: "case", label: "케이스", code: "C" },
      { value: "bottom_finish_screen", label: "하단마감재(스크린)", code: "B" },
      { value: "bottom_finish_steel", label: "하단마감재(철재)", code: "T" },
      { value: "l_bar", label: "L-Bar", code: "L" },
      { value: "smoke_barrier", label: "연기차단재", code: "G" },
    ]
  },
  PURCHASED: {
    label: "구매 부품 (Purchased Part)",
    categories: [
      { value: "electric_opener", label: "전동개폐기", code: "E" },
      { value: "motor", label: "모터", code: "M" },
      { value: "chain", label: "체인", code: "CH" },
    ]
  }
} as const;

// 부품 분류별 종류 옵션
export const PART_ITEM_NAMES: Record<string, Array<{value: string, label: string, code: string}>> = {
  guide_rail_wall: [
    { value: "RM", label: "분체", code: "M" },
    { value: "RT", label: "분체(철재)", code: "T" },
    { value: "RC", label: "C형", code: "C" },
    { value: "RD", label: "D형", code: "D" },
    { value: "RS", label: "SUS 마감재", code: "S" },
    { value: "RM2", label: "분체티딩", code: "M" },
  ],
  guide_rail_side: [
    { value: "SC", label: "C형", code: "C" },
    { value: "SD", label: "D형", code: "D" },
    { value: "SS", label: "SUS 마감재①", code: "S" },
    { value: "SU", label: "SUS 마감재②", code: "U" },
    { value: "SF", label: "전면부", code: "F" },
    { value: "SP", label: "점검구", code: "P" },
  ],
  case: [
    { value: "CF", label: "전면부", code: "F" },
    { value: "CP", label: "점검구", code: "P" },
    { value: "CL", label: "린텔부", code: "L" },
    { value: "CB", label: "후면코너부", code: "B" },
  ],
  bottom_finish_screen: [
    { value: "BS", label: "SUS", code: "S" },
    { value: "BE", label: "EGI", code: "E" },
  ],
  bottom_finish_steel: [
    { value: "TS", label: "SUS", code: "S" },
    { value: "TE", label: "EGI", code: "E" },
  ],
  l_bar: [
    { value: "LA", label: "스크린용", code: "A" },
  ],
  smoke_barrier: [
    { value: "GI", label: "화이바원단(W50)", code: "I" },
    { value: "GI2", label: "화이바원단(W80)", code: "I" },
  ],
};

// 필드명 한글 매핑 (에러 메시지용)
export const FIELD_NAME_MAP: Record<string, string> = {
  'productName': '상품명',
  'itemName': '품목명',
  'itemType': '품목 유형',
  'partType': '부품 유형',
  'category1': '품목명',
  'material': '재질',
  'length': '폭 합계',
  'bendingLength': '모양&길이',
  'sideSpecWidth': '측면 규격 (가로)',
  'sideSpecHeight': '측면 규격 (세로)',
  'assemblyLength': '길이',
  'specification': '규격',
  'unit': '단위',
};