// 자재기준 Config
// 재고 관리와 관련된 자재 정보를 관리합니다
const materialMasterConfig = {
  id: 'material',
  title: '자재기준 목록',
  description: '자재 재고 관리를 위한 기준 정보를 관리합니다',
  icon: 'Package',
  tabs: [
    { id: 'hierarchy', label: '계층구조', icon: 'GitBranch' },
    { id: 'section', label: '섹션', icon: 'Layers' },
    { id: 'field', label: '항목', icon: 'ClipboardList' },
    { id: 'attribute', label: '속성', icon: 'Settings' },
  ],
  entityTypes: [
    { id: 1, code: 'RAW', name: '원자재', description: '철판, 코일 등 원자재', sortOrder: 1, isActive: true },
    { id: 2, code: 'PART', name: '구매부품', description: '모터, 부속품 등', sortOrder: 2, isActive: true },
    { id: 3, code: 'SUB', name: '부자재', description: '스크린 원단 등', sortOrder: 3, isActive: true },
    { id: 4, code: 'CONS', name: '소모품', description: '볼트, 너트 등', sortOrder: 4, isActive: true },
  ],
  categories: [
    { id: 1, code: 'STEEL', name: '철강재', parentId: null, level: 1, path: '/1', sortOrder: 1 },
    { id: 2, code: 'STEEL-COIL', name: '코일', parentId: 1, level: 2, path: '/1/2', sortOrder: 1 },
    { id: 3, code: 'STEEL-PLATE', name: '철판', parentId: 1, level: 2, path: '/1/3', sortOrder: 2 },
    { id: 4, code: 'MOTOR', name: '모터', parentId: null, level: 1, path: '/4', sortOrder: 2 },
    { id: 5, code: 'MOTOR-TUB', name: '튜블러모터', parentId: 4, level: 2, path: '/4/5', sortOrder: 1 },
    { id: 6, code: 'MOTOR-GRD', name: '기어드모터', parentId: 4, level: 2, path: '/4/6', sortOrder: 2 },
    { id: 7, code: 'FABRIC', name: '원단', parentId: null, level: 1, path: '/7', sortOrder: 3 },
    { id: 8, code: 'FABRIC-SCR', name: '스크린원단', parentId: 7, level: 2, path: '/7/8', sortOrder: 1 },
  ],
  masterFields: [
    { id: 1, fieldKey: 'materialCode', fieldName: '자재코드', inputType: 'text', isRequired: true, validations: { maxLength: 20, pattern: '^[A-Z0-9-]+$' }, description: '자재 식별 코드' },
    { id: 2, fieldKey: 'materialName', fieldName: '자재명', inputType: 'text', isRequired: true, validations: { maxLength: 100 }, description: '자재 이름' },
    { id: 3, fieldKey: 'category', fieldName: '분류', inputType: 'select', isRequired: false, options: { source: 'api', apiUrl: '/api/material-categories' }, description: '자재 분류' },
    { id: 4, fieldKey: 'materialType', fieldName: '자재유형', inputType: 'select', isRequired: true, options: { items: ['원자재', '구매부품', '부자재', '소모품'] }, description: '자재 유형' },
    { id: 5, fieldKey: 'unit', fieldName: '단위', inputType: 'select', isRequired: true, options: { items: ['EA', 'SET', 'M', 'KG', 'TON', 'L', 'BOX'] }, description: '수량 단위' },
    { id: 6, fieldKey: 'spec', fieldName: '규격', inputType: 'text', isRequired: false, description: '자재 규격' },
    { id: 7, fieldKey: 'safetyStock', fieldName: '안전재고', inputType: 'number', isRequired: true, validations: { min: 0 }, description: '안전재고 수량' },
    { id: 8, fieldKey: 'minStock', fieldName: '최소재고', inputType: 'number', isRequired: false, validations: { min: 0 }, description: '최소재고 수량' },
    { id: 9, fieldKey: 'maxStock', fieldName: '최대재고', inputType: 'number', isRequired: false, validations: { min: 0 }, description: '최대재고 수량' },
    { id: 10, fieldKey: 'warehouseCode', fieldName: '창고코드', inputType: 'text', isRequired: false, description: '기본 창고 코드' },
    { id: 11, fieldKey: 'warehouseName', fieldName: '창고명', inputType: 'text', isRequired: false, description: '기본 창고 이름' },
    { id: 12, fieldKey: 'locationCode', fieldName: '위치코드', inputType: 'text', isRequired: false, description: '창고 내 위치 코드' },
    { id: 13, fieldKey: 'locationName', fieldName: '위치명', inputType: 'text', isRequired: false, description: '창고 내 위치 이름' },
    { id: 14, fieldKey: 'leadTime', fieldName: '리드타임', inputType: 'number', isRequired: false, validations: { min: 0 }, description: '조달 소요일' },
    { id: 15, fieldKey: 'inspectionRequired', fieldName: '입고검사 필요', inputType: 'checkbox', isRequired: false, description: '입고 시 검사 필요 여부' },
    { id: 16, fieldKey: 'lotManagement', fieldName: 'LOT 관리', inputType: 'checkbox', isRequired: false, description: 'LOT별 관리 여부' },
    { id: 17, fieldKey: 'supplier', fieldName: '기본공급업체', inputType: 'text', isRequired: false, description: '주 공급업체' },
    { id: 18, fieldKey: 'price', fieldName: '기준단가', inputType: 'number', isRequired: false, validations: { min: 0 }, description: '기준 단가' },
    { id: 19, fieldKey: 'description', fieldName: '설명', inputType: 'textarea', isRequired: false, description: '자재 상세 설명' },
  ],
  masterSections: [
    { id: 1, sectionKey: 'basicInfo', sectionName: '기본정보', sectionType: 'general', applicableTypes: ['RAW', 'PART', 'SUB', 'CONS'], description: '자재 기본 정보', fields: [1, 2, 3, 4, 5, 6] },
    { id: 2, sectionKey: 'stockInfo', sectionName: '재고정보', sectionType: 'general', applicableTypes: ['RAW', 'PART', 'SUB', 'CONS'], description: '재고 관리 정보', fields: [7, 8, 9, 16] },
    { id: 3, sectionKey: 'warehouseInfo', sectionName: '창고정보', sectionType: 'general', applicableTypes: ['RAW', 'PART', 'SUB', 'CONS'], description: '창고 및 위치 정보', fields: [10, 11, 12, 13] },
    { id: 4, sectionKey: 'purchaseInfo', sectionName: '구매정보', sectionType: 'general', applicableTypes: ['RAW', 'PART', 'SUB', 'CONS'], description: '구매 관련 정보', fields: [14, 17, 18] },
    { id: 5, sectionKey: 'qualityInfo', sectionName: '품질정보', sectionType: 'module', applicableTypes: ['RAW', 'PART', 'SUB'], description: '품질 검사 정보', fields: [15] },
  ],
  pageTemplates: [
    {
      id: 1,
      pageCode: 'material_registration',
      pageName: '자재 등록',
      pagePath: '/자재관리/자재_등록',
      itemTypes: ['RAW'],
      sections: [
        { sectionId: 1, sectionKey: 'basicInfo', sectionName: '기본정보', sortOrder: 1, fields: [
          { fieldId: 1, fieldKey: 'materialCode', fieldName: '자재코드', inputType: 'text', isRequired: true },
          { fieldId: 2, fieldKey: 'materialName', fieldName: '자재명', inputType: 'text', isRequired: true },
          { fieldId: 3, fieldKey: 'category', fieldName: '분류', inputType: 'select', isRequired: false },
          { fieldId: 4, fieldKey: 'materialType', fieldName: '자재유형', inputType: 'select', isRequired: true },
          { fieldId: 5, fieldKey: 'unit', fieldName: '단위', inputType: 'select', isRequired: true },
          { fieldId: 6, fieldKey: 'spec', fieldName: '규격', inputType: 'text', isRequired: false },
        ]},
        { sectionId: 2, sectionKey: 'stockInfo', sectionName: '재고정보', sortOrder: 2, fields: [
          { fieldId: 7, fieldKey: 'safetyStock', fieldName: '안전재고', inputType: 'number', isRequired: true },
          { fieldId: 8, fieldKey: 'minStock', fieldName: '최소재고', inputType: 'number', isRequired: false },
          { fieldId: 9, fieldKey: 'maxStock', fieldName: '최대재고', inputType: 'number', isRequired: false },
          { fieldId: 16, fieldKey: 'lotManagement', fieldName: 'LOT 관리', inputType: 'checkbox', isRequired: false },
        ]},
        { sectionId: 3, sectionKey: 'warehouseInfo', sectionName: '창고정보', sortOrder: 3, fields: [
          { fieldId: 10, fieldKey: 'warehouseCode', fieldName: '창고코드', inputType: 'text', isRequired: false },
          { fieldId: 11, fieldKey: 'warehouseName', fieldName: '창고명', inputType: 'text', isRequired: false },
          { fieldId: 12, fieldKey: 'locationCode', fieldName: '위치코드', inputType: 'text', isRequired: false },
          { fieldId: 13, fieldKey: 'locationName', fieldName: '위치명', inputType: 'text', isRequired: false },
        ]},
      ],
      conditions: []
    }
  ],
};

export default materialMasterConfig;
