import { Operator } from "@/app/api/jo";
import {
  Material,
  MaterialDatabase,
  ProcessData,
  QualityCheckItem,
} from "./types";

export const materialDatabase: MaterialDatabase[] = [
  { name: "Steel Sheet", lotPattern: /^SS-\d{6}-\d{3}$/, required: true },
  { name: "Aluminum Rod", lotPattern: /^AL-\d{6}-\d{3}$/, required: false },
  { name: "Plastic Pellets", lotPattern: /^PP-\d{6}-\d{3}$/, required: false },
  { name: "Copper Wire", lotPattern: /^CW-\d{6}-\d{3}$/, required: false },
  { name: "Rubber Gasket", lotPattern: /^RG-\d{6}-\d{3}$/, required: false },
  { name: "Glass Panel", lotPattern: /^GP-\d{6}-\d{3}$/, required: false },
  { name: "Hydraulic Oil", lotPattern: /^HO-\d{6}-\d{3}$/, required: false },
  { name: "Cutting Fluid", lotPattern: /^CF-\d{6}-\d{3}$/, required: false },
  { name: "Welding Rod", lotPattern: /^WR-\d{6}-\d{3}$/, required: false },
  { name: "Adhesive", lotPattern: /^AD-\d{6}-\d{3}$/, required: false },
];

const operatorDatabase: Operator[] = [
  { id: 1, name: "John Smith", username: "EMP001" },
  { id: 2, name: "Maria Garcia", username: "EMP002" },
  { id: 3, name: "David Chen", username: "EMP003" },
  { id: 4, name: "Sarah Johnson", username: "EMP004" },
  { id: 5, name: "Mike Wilson", username: "EMP005" },
];

const initialMaterial1: Material[] = [
  { id: 1, name: "Steel Sheet", isUsed: false, lotNumbers: [], required: true },
  {
    id: 2,
    name: "Aluminum Rod",
    isUsed: false,
    lotNumbers: [],
    required: false,
  },
  {
    id: 3,
    name: "Plastic Pellets",
    isUsed: false,
    lotNumbers: [],
    required: false,
  },
];

const initialMaterial2: Material[] = [
  {
    id: 4,
    name: "Copper Wire",
    isUsed: false,
    lotNumbers: [],
    required: false,
  },
  {
    id: 5,
    name: "Rubber Gasket",
    isUsed: false,
    lotNumbers: [],
    required: false,
  },
  {
    id: 6,
    name: "Glass Panel",
    isUsed: false,
    lotNumbers: [],
    required: false,
  },
];

const initialMaterial3: Material[] = [
  {
    id: 7,
    name: "Hydraulic Oil",
    isUsed: false,
    lotNumbers: [],
    required: false,
  },
  {
    id: 8,
    name: "Cutting Fluid",
    isUsed: false,
    lotNumbers: [],
    required: false,
  },
  {
    id: 9,
    name: "Welding Rod",
    isUsed: false,
    lotNumbers: [],
    required: false,
  },
  { id: 10, name: "Adhesive", isUsed: false, lotNumbers: [], required: false },
];

export const processData: ProcessData[] = [
  {
    id: "1",
    processName: "Material Preparation",
    status: "Not Started",
    materials: initialMaterial1,
  },
  {
    id: "2",
    processName: "Assembly Line 1",
    status: "Not Started",
    materials: initialMaterial2,
  },
  {
    id: "3",
    processName: "Quality Control",
    status: "Not Started",
    materials: initialMaterial3,
  },
];

export const sampleItem: QualityCheckItem = {
  id: 1,
  code: "QC-001",
  name: "Steel Beam Section A",
  description: "testing",
  category: "Structural Steel",
};

export const defectOptions: QualityCheckItem[] = [
  {
    id: 1,
    code: "DEF001",
    name: "Crack in wall",
    description: "Visible cracks in wall surface",
  },
  {
    id: 2,
    code: "DEF002",
    name: "Paint peeling",
    description: "Paint coming off surfaces",
  },
  {
    id: 3,
    code: "DEF003",
    name: "Loose tiles",
    description: "Tiles not properly secured",
  },
  {
    id: 4,
    code: "DEF004",
    name: "Water damage",
    description: "Damage caused by water exposure",
  },
  {
    id: 5,
    code: "DEF005",
    name: "Electrical issue",
    description: "Problems with electrical systems",
  },
  {
    id: 6,
    code: "DEF006",
    name: "Plumbing leak",
    description: "Water leaking from pipes or fixtures",
  },
  {
    id: 7,
    code: "DEF007",
    name: "Door not closing properly",
    description: "Door alignment or hardware issues",
  },
  {
    id: 8,
    code: "DEF008",
    name: "Window seal broken",
    description: "Damaged or missing window seals",
  },
  {
    id: 9,
    code: "DEF009",
    name: "Missing screws",
    description: "Hardware missing from fixtures",
  },
  {
    id: 10,
    code: "DEF010",
    name: "Damaged flooring",
    description: "Floor surface damage or wear",
  },
  {
    id: 11,
    code: "DEF011",
    name: "Ceiling stain",
    description: "Discoloration on ceiling surface",
  },
  {
    id: 12,
    code: "DEF012",
    name: "Broken fixture",
    description: "Non-functioning or damaged fixtures",
  },
  {
    id: 13,
    code: "DEF013",
    name: "Poor ventilation",
    description: "Inadequate air circulation",
  },
  {
    id: 14,
    code: "DEF014",
    name: "Noise issue",
    description: "Excessive or unwanted noise",
  },
  {
    id: 15,
    code: "DEF015",
    name: "Temperature control problem",
    description: "HVAC or insulation issues",
  },
];
