export interface TableColumn {
  key: string;
  label: string;
  alwaysVisible?: boolean;
}

// export interface TableRowType {
//   id: string;
//   route_detail: Array<{
//     est_start: string;
//     est_finish: string;
//     vehicle_number: string;
//     est_distance: number;
//     est_distance_2:number;
//     est_duration: number;
//     status: string;
//   }>;
//   route_name: string;
//   depot_id: string;
//   tomtom_id: string;
//   route_crew_info: Array<{
//     crew1_id: string;
//     crew1: string;
//     crew2_id: string;
//     crew2: string;
//     crew_instructions: string;
//   }>;
//   assets: string;
//   total_weight: number;
//   total_cube: number;
//   contains_heavy_item: boolean;
//   contains_collection: boolean;
//   // Add an index signature
//   [key: string]: any;
// }

// //orders data
export interface TableRowType {
  depot_id:number,
  gsit_order_id:number,
  customer_id:number,
  trading_name:string,
  recipient_reference:string,
  order_locked:boolean,
  lock_notes:any,
  order_type_id:any,
  allow_live_tracking:any,
  weight:number,
  cube:number,
  rescheduled:boolean,
  zone_code:string,
  status:string,
  order_status_note:string,
  print_pod:boolean,
  order_number:string,
  consignment:string,
  action_date:any,
  other_instructions:any,
  schedule_after:any,
  vehicle_type:string,
  order_recipient:OrderRecipientData[],
  order_services_detail:OrderServicesDetails[],
  order_services:OrderServicesData[],
  order_type:any,
  order_routes:OrderRoutesData[],
  id:number

  // Add an index signature
  [key: string]: any;


}


export interface OrderRecipientData{
  id: number,
  order_id: number,
  recipient_name :string,
  address: any,
  postcode: any,
  postcode_district:any,
  postcode_short:any,
  latitude:any,
  longitude:any,
  what_3words_address:any,
  contact_home:any,
  contact_work:any,
  contact_mobile:any,
  contact_email:any,
  is_comms_enabled:boolean,
}

export interface OrderServicesDetails{
  order_id:number,
  timed_service_id:number,
  order_delivery_point_id:number,
  order_service_level_id:number,
  heavy_order:boolean,
  heavy_item:boolean,
  bulky_order:boolean,
  bulky_item:boolean,
  id:number,
}
export interface OrderServicesData{
  order_id:number,
  order_service_list_id:number,
  service_time:any,
  is_refused:boolean,
  service_note:string,
  id:number,
}
export interface OrderRoutesData{
  id:number,
  order_id:number,
  route_id:number,
  est_arrival:string,
  est_departure:string,

  drop_time:string,
  delivery_instructions:string,
}
export interface TableDataInterface {
  tableHead: TableColumn[];
}
export interface FilterRoute {
  id: number;
  icon: string;
  label: string;
  value: string;
}

// types

export type PrintData = {
  icon: string;
  label: string;
};

export type RouteDetailType = {
  vehicle_number: string;
  est_start: string;
  est_finish: string;
  est_distance: number;
  est_distance_2:number;
  est_duration: string;
  est_drive_time: string | null;
  vehicle_size: string;
  start_location: string;
  start_mileage: number;
  start_latitude: number;
  start_longitude: number;
  end_location: string;
  end_mileage: number;
  end_latitude: number;
  end_longitude: number;
  actual_start_time: string;
  actual_finish_time: string;
  finish_date: string;
  paper_work_printed: string;
  allow_label_scanning: number;
  allow_live_tracking: boolean;
  route_zone: number;
  actual_distance: number;
  actual_duration: string;
  actual_drive_time: string | null;
};

export interface CrewInfoType {
  crew1: string;
  crew1_id: number;
  crew2: string;
  crew2_id: number;
  crew_instructions: string;
}

export interface RouteInfoType {
  id: number;
  depot_id: number;
  tomtom_id: number;
  route_name: string;
  action_date: string;
  assets: string;
  fuel_card_id: number;
  total_weight: number;
  total_cube: number;
  contains_collection: boolean;
  contains_heavy_item: boolean;
  route_detail: RouteDetailType[];
  route_crew_info: CrewInfoType[];
  route_breaks: any;
}

export interface PaginationData {
  firstPage: number;
  lastPage: number;
  next_page: number;
  page: number;
  previous_page: number;
  total: number;
  totalPages: number;

  // Add other properties if available
}

export type OrderViewType = 'view' | 'edit' | 'add';

// export interface OrderProps {
//   data?: any; 
//   action: (path: string, view: OrderViewType, id?: number) => {};
// }
