// @unocss-include
export enum WorkStatus {
  Drafting = 'Drafting',
  InternalAuditing = 'Internal Auditing',
  InternalRejected = 'Internal Rejected',
  ExternalAuditing = 'External Auditing',
  Approved = 'Approved',
  Scheduled = 'Scheduled',
  SiteOpen = 'Site Open',
  SiteClosed = 'Site Closed',
  Completed = 'Completed',
  Cancelled = 'Cancelled',
}

export type Comment = {
  id: string;
  user: string;
  content: string;
  time: Date;
  page: number;
  position: { x: number; y: number };
};

export type Remark = {
  id: string;
  user: string;
  content: string;
  time: Date;
};

export const workStatusColor: Record<WorkStatus, string> = {
  [WorkStatus.Drafting]: 'bg-gold-1 text-gold-6 border border-gold-3',
  [WorkStatus.InternalAuditing]:
    'bg-orange-1 text-orange-6 border border-orange-3',
  [WorkStatus.InternalRejected]: 'bg-red-1 text-red-6 border border-red-3',
  [WorkStatus.ExternalAuditing]: 'bg-cyan-1 text-cyan-6 border border-cyan-3',
  [WorkStatus.Approved]:
    'bg-green-1 text-green-6 border border-green-3 rounded-sm',
  [WorkStatus.Scheduled]: 'bg-blue-1 text-blue-6 border border-blue-3',
  [WorkStatus.SiteOpen]: 'bg-green-1 text-green-6 border border-green-3',
  [WorkStatus.SiteClosed]: 'bg-gray-1 text-gray-6 border border-gray-3',
  [WorkStatus.Completed]: 'bg-teal-1 text-teal-6 border border-teal-3',
  [WorkStatus.Cancelled]: 'bg-gray-1 text-gray-6 border border-gray-3',
};

export type Person = { name: string; tel: string };

export type Job = {
  jobId: string;
  contactPerson: Person;
  connectionStatus: string;
  status: WorkStatus;
  lastInspected?: string;
  siteStartAt?: Date;
  siteEndAt?: Date;
  expectedStartAt?: Date;
  expectedEndAt?: Date;
  permittedRange?: Date[][];
  approvedAt?: Date;
  approvedBy?: Person;
  createdBy: Person;
  createdAt: Date;
  tta?: TTA;
  spvIds?: string[];
  district?: string;
  description?: string;
  planImage?: string[];
};

//Proposed Date
//Permitted Date
//Scheduled Date

export type TTA = {
  rotation: number;
  workArea?: number[][];
  plan?: number[][];
};
