export const AI_CONTAINER_TYPES = ['20FT', '40FT', 'BULK', 'RO_RO'] as const;
export type AiContainerType = (typeof AI_CONTAINER_TYPES)[number];

export const AI_DIRECTIONS = ['IMPORT', 'EXPORT'] as const;
export type AiDirection = (typeof AI_DIRECTIONS)[number];

export const AI_RECOMMENDATION_ACTIONS = [
  'CREATE_DRAFT_BOOKING',
  'REQUEST_MISSING_INFORMATION',
] as const;
export type AiRecommendationAction = (typeof AI_RECOMMENDATION_ACTIONS)[number];

export interface AiExtractedBooking {
  customerName: string | null;
  origin: string | null;
  destination: string | null;
  cargoType: string | null;
  containerType: AiContainerType | null;
  quantity: number | null;
  direction: AiDirection | null;
  weightKg: number | null;
  pickupRequired: boolean | null;
  deliveryRequired: boolean | null;
}

export interface AiValidationResult {
  valid: boolean;
  errors: string[];
}

export interface AiRecommendation {
  action: AiRecommendationAction;
  message: string;
  confidence: number;
}

/**
 * Payload returned by the extract endpoint. The global
 * ResponseTransformInterceptor wraps it as
 * `{ success: true, data: AiBookingResult, timestamp }` on the wire.
 */
export interface AiBookingResult {
  provider: 'mock';
  extracted: AiExtractedBooking;
  validation: AiValidationResult;
  recommendation: AiRecommendation;
}
