import type { AssemblyMonitoringUnitProcessStatusDbDto } from 'src/api/monitoring/cp/assembly/dto/internal/unit-process-status.db.dto';

export const createProcessStatusRow = (
  overrides: Partial<AssemblyMonitoringUnitProcessStatusDbDto> = {},
): AssemblyMonitoringUnitProcessStatusDbDto => ({
  Gubun: '1',
  CurrentLeadTimeDays: 0,
  WaitingDays: null,
  CHK: 1,
  ProdPlanSeq: 1000,
  ProdPlanNo: 'PLAN1000',
  TemplateSeq: 100,
  TemplatProcNo: '10',
  ProcTypeSeq: 50,
  ProcTypeName: 'DriveUnit',
  ToProcTypeSeq: 51,
  ToProcTypeName: 'NextProcess',
  CurProcCompleteDate: '',
  IsCurProcCompletedYn: 'N',
  IsWaitingYn: 'N',
  ModelSerialList: 'CP42RZ1 / 1038',
  StartDT: new Date(2026, 0, 1, 8, 0),
  EndDT: null,
  WorkerCount: 1,
  TotalWorkHour: 1,
  ...overrides,
});

export const unitProcessStatusFixtures = {
  serviceRows: [
    createProcessStatusRow({
      CurrentLeadTimeDays: 5,
      ProdPlanSeq: 1001,
      ProdPlanNo: 'PLAN1001',
      TemplateSeq: 100,
      TemplatProcNo: '10',
      ProcTypeSeq: 50,
      ProcTypeName: 'DriveUnit',
      ToProcTypeSeq: 51,
      ToProcTypeName: 'NextProcess',
      ModelSerialList: 'CP42RZ1 / 1038',
      StartDT: new Date(2026, 0, 8, 13, 0),
      EndDT: null,
      WorkerCount: 3,
      TotalWorkHour: 2.5,
    }),
  ],
  waitingRows: [
    createProcessStatusRow({
      Gubun: '4',
      CurrentLeadTimeDays: 10,
      CHK: 2,
      ProdPlanSeq: 1002,
      ProdPlanNo: 'PLAN1002',
      TemplateSeq: 101,
      TemplatProcNo: '11',
      ProcTypeSeq: 50,
      ProcTypeName: 'DriveUnit',
      ToProcTypeSeq: 51,
      ToProcTypeName: 'NextProcess',
      ModelSerialList: 'CP42RZ1 / 1038',
      StartDT: new Date(2026, 0, 8, 13, 0),
      EndDT: null,
      WorkerCount: 3,
      TotalWorkHour: 2.5,
    }),
  ],
  transformerRows: [
    createProcessStatusRow({
      ProcTypeName: 'DriveUnit',
      ModelSerialList: 'CP42RZ1 / 1038',
      StartDT: new Date(2026, 0, 8, 13, 0),
      EndDT: new Date(2026, 0, 9, 9, 30),
      WorkerCount: 3,
      TotalWorkHour: 2.5,
      Gubun: '2',
      WaitingDays: 4,
    }),
    createProcessStatusRow({
      ProcTypeName: 'Unknown',
      ModelSerialList: 'X / 1',
      StartDT: new Date(2026, 0, 1, 0, 0),
      Gubun: '1',
    }),
  ],
};
