/** Flock 询价标准化输入（校验后均为 lb/in 整数） */
export type FlockQuoteInput = {
  pickupDate: string;
  pickupZip: string;
  deliveryZip: string;
  palletCount: number;
  totalWeightLb: number;
  lengthIn: number;
  widthIn: number;
  heightIn: number;
  /** 用户自填官网注册信息（可选；未填字段由系统自动生成） */
  registration?: FlockRegistrationOverride;
  /**
   * anonymous = get-a-quote；logged_in_quick = 登录后 Let's build a quote
   * 登录态件数可为 1+，且带包装/地点类型等 RPA 字段
   */
  formMode?: "anonymous" | "logged_in_quick";
  pickupLocationType?: string;
  deliveryLocationType?: string;
  packagingType?: string;
  freightClass?: string;
  description?: string;
  stackable?: boolean;
  turnable?: boolean;
  /** 附加服务 id：blind_shipment / unloading … */
  additionalServices?: string[];
  /** 允许车型 id：box_truck / dry_van / refrigerated / sprinter */
  vehicleTypes?: string[];
  callBeforePickup?: boolean;
  callBeforeDelivery?: boolean;
  /** 调度服务及子字段（总重 >5000 时可用） */
  pickupService?: string;
  deliveryService?: string;
  pickupWindowStartTime?: string;
  pickupWindowEndTime?: string;
  pickupAppointmentTime?: string;
  deliveryWindowStartTime?: string;
  deliveryWindowEndTime?: string;
  deliveryWindowDate?: string;
  deliveryAppointmentTime?: string;
  deliveryAppointmentDate?: string;
  deliveryMustArriveByDate?: string;
  callForDeliveryAppointment?: boolean;
  /** 地点类型附属：尾板 / 室内 / 托盘车叉车 */
  pickupLiftgate?: boolean;
  pickupInside?: boolean;
  pickupPalletJack?: boolean;
  deliveryLiftgate?: boolean;
  deliveryInside?: boolean;
  deliveryPalletJack?: boolean;
};

/** 官网弱注册字段（全部可选，与 createFreshFlockTestAccount 字段对齐） */
export type FlockRegistrationOverride = {
  firstName?: string;
  lastName?: string;
  company?: string;
  email?: string;
  phone?: string;
  shipmentsPerMonth?: string;
};

export type FlockQuoteLine = {
  tier: "flock_direct" | "standard";
  serviceLevel: "guaranteed" | "standard";
  rateOption: "fastest" | "lowest";
  carrier: "Flock Freight";
  label: string;
  totalUsd: number;
  transitDays: string;
  transitDescription: string;
  reference?: string | null;
};

export type FlockRunQuoteResult = {
  ok: boolean;
  quotes: FlockQuoteLine[];
  reference?: string | null;
  errorMessage?: string;
};
