import type {
  AllMonitoringSettings,
  ProductionMonitoringSettings,
  ProductionDisplayFields,
  EquipmentMonitoringSettings,
  EquipmentDisplayFields,
  QualityMonitoringSettings,
  QualityInspectionTypes,
  QualityTableColumns,
} from "@/types/monitoringSettings";

// ─── 생산모니터링 기본값 ─────────────────────────────────────

export const DEFAULT_PRODUCTION_FIELDS: ProductionDisplayFields = {
  workInstructionNo: true,
  itemName: true,
  spec: true,
  customerName: true,
  worker: true,
  dueDate: true,
  equipment: true,
  processProgress: true,
  progressBar: true,
  priority: true,
  salesOrderNo: false,
  quantityInfo: false,
};

export const DEFAULT_PRODUCTION_SETTINGS: ProductionMonitoringSettings = {
  theme: "dark",
  layout: "grid",
  refreshInterval: 30,
  autoRefresh: true,
  soundEnabled: false,
  displayFields: { ...DEFAULT_PRODUCTION_FIELDS },
};

// ─── 설비모니터링 기본값 ─────────────────────────────────────

export const DEFAULT_EQUIPMENT_FIELDS: EquipmentDisplayFields = {
  equipmentName: true,
  equipmentType: true,
  equipmentLocation: true,
  operationStatus: true,
  utilizationBar: true,
  dailyOperationTime: true,
  dailyProductionQty: true,
  worker: true,
  currentWorkInstruction: true,
  sensorData: true,
  cumulativeOperationTime: false,
  nextInspectionDate: false,
};

export const DEFAULT_EQUIPMENT_SETTINGS: EquipmentMonitoringSettings = {
  theme: "dark",
  refreshInterval: 30,
  autoRefresh: true,
  alarmEnabled: true,
  displayFields: { ...DEFAULT_EQUIPMENT_FIELDS },
};

// ─── 품질모니터링 기본값 ─────────────────────────────────────

export const DEFAULT_QUALITY_INSPECTION_TYPES: QualityInspectionTypes = {
  incoming: true,
  process: true,
  shipping: true,
};

export const DEFAULT_QUALITY_COLUMNS: QualityTableColumns = {
  inspectionNo: true,
  inspectionType: true,
  itemName: true,
  spec: true,
  inspectionQty: true,
  passFailQty: true,
  defectRate: true,
  resultBar: true,
  judgment: true,
  inspector: true,
  inspectedAt: true,
  inspectionCriteria: false,
};

export const DEFAULT_QUALITY_SETTINGS: QualityMonitoringSettings = {
  theme: "dark",
  refreshInterval: 30,
  autoRefresh: true,
  alarmEnabled: true,
  inspectionTypes: { ...DEFAULT_QUALITY_INSPECTION_TYPES },
  tableColumns: { ...DEFAULT_QUALITY_COLUMNS },
};

// ─── 전체 기본값 ─────────────────────────────────────────────

export const DEFAULT_ALL_SETTINGS: AllMonitoringSettings = {
  production: { ...DEFAULT_PRODUCTION_SETTINGS },
  equipment: { ...DEFAULT_EQUIPMENT_SETTINGS },
  quality: { ...DEFAULT_QUALITY_SETTINGS },
};
