/**
 * Booking Types
 */

export enum BookingStatus {
  DRAFT = 'draft',
  CONFIRMED = 'confirmed',
  IN_PROGRESS = 'in_progress',
  COMPLETED = 'completed',
  CANCELLED = 'cancelled',
}

export enum ContainerType {
  DRY_20 = '20ft',
  DRY_40 = '40ft',
  HIGH_CUBE_40 = '40ft HC',
  REEFER_20 = '20ft Reefer',
  REEFER_40 = '40ft Reefer',
}

export interface Address {
  name: string;
  street: string;
  city: string;
  state?: string;
  postalCode: string;
  country: string;
}

export interface Container {
  id: string;
  type: ContainerType;
  containerNumber?: string;
  sealNumber?: string;
  vgm?: number;
  temperature?: number;
}

export interface RateQuote {
  id: string;
  carrierName: string;
  carrierScac: string;
  origin: string;
  destination: string;
  priceValue: number;
  priceCurrency: string;
  etd?: string;
  eta?: string;
  transitDays?: number;
  validUntil?: string;
}

export interface Booking {
  id: string;
  bookingNumber: string;
  status: BookingStatus;
  shipper: Address;
  consignee: Address;
  containers: Container[];
  rateQuote: RateQuote;
  createdAt: string;
  updatedAt: string;
}

export interface BookingFilters {
  status?: BookingStatus[];
  search?: string;
  carrier?: string;
  originPort?: string;
  destinationPort?: string;
  shipper?: string;
  consignee?: string;
  createdFrom?: string;
  createdTo?: string;
  etdFrom?: string;
  etdTo?: string;
  sortBy?: string;
  sortOrder?: 'asc' | 'desc';
  page?: number;
  pageSize?: number;
}

export interface BookingListResponse {
  bookings: Booking[];
  total: number;
  page: number;
  pageSize: number;
}

export enum ExportFormat {
  CSV = 'csv',
  EXCEL = 'excel',
  JSON = 'json',
}

export interface ExportOptions {
  format: ExportFormat;
  fields?: string[];
  bookingIds?: string[];
}
