/** 车辆管理相关类型 */

export type OperationCity = { province: string; city: string };
export type VehicleTypeItem = { value: string; label: string };
export type ModelParamItem = { brand: string; model: string };
export type CustomerItem = { value: string; label: string };
export type DeptItem = { value: string; label: string };

export const OPERATION_STATUS_OPTIONS = [
  { value: 'pending', label: '待运营' },
  { value: 'in_stock', label: '库存' },
  { value: 'lease', label: '租赁' },
  { value: 'self', label: '自营' },
  { value: 'exit', label: '退出运营' },
] as const;

export const LIB_STATUS_OPTIONS = [
  { value: 'new_pending', label: '新车入库-待验车' },
  { value: 'new_license', label: '新车入库-证照办理' },
  { value: 'stock_ok', label: '库存车-可交付车' },
  { value: 'stock_no', label: '库存车-不可交付车' },
  { value: 'stock_slow', label: '库存车-呆滞车' },
  { value: 'out_lease', label: '已交付车-租赁交车' },
  { value: 'out_self', label: '已交付车-自营交车' },
  { value: 'out_replace', label: '已交付车-替换交车' },
  { value: 'exit_scrap', label: '退出运营-报废车' },
  { value: 'exit_third', label: '退出运营-三方退租车' },
  { value: 'exit_sale', label: '退出运营-过户售车' },
] as const;

export const OUTBOUND_STATUS_OPTIONS = [
  { value: 'move', label: '异动出库' },
  { value: 'transfer', label: '调拨出库' },
  { value: 'show', label: '展示出库' },
  { value: 'lease_deliver', label: '租赁交车' },
  { value: 'self_deliver', label: '自营交车' },
  { value: 'replace_deliver', label: '替换交车' },
  { value: 'sale', label: '过户售车' },
  { value: 'lease_return', label: '外租退车' },
  { value: 'scrap', label: '报废出库' },
  { value: 'none', label: '无' },
] as const;

export const PREP_STATUS_OPTIONS = [
  { value: 'pending', label: '待整备' },
  { value: 'doing', label: '整备中' },
  { value: 'normal', label: '正常' },
  { value: 'none', label: '无' },
] as const;

export const TRANSFER_STATUS_OPTIONS = [
  { value: 'doing', label: '过户中' },
  { value: 'internal_done', label: '内部过户完成' },
  { value: 'sale_done', label: '销售过户完成' },
  { value: 'none', label: '无' },
] as const;

export const REPAIR_STATUS_OPTIONS = [
  { value: 'pending', label: '待服务站接单' },
  { value: 'doing', label: '维修中' },
  { value: 'normal', label: '正常' },
] as const;

export const LICENSE_STATUS_OPTIONS = [
  { value: 'normal', label: '正常' },
  { value: 'abnormal', label: '异常' },
] as const;

export const SCRAP_STATUS_OPTIONS = [
  { value: 'doing', label: '报废中' },
  { value: 'done', label: '已报废' },
  { value: 'none', label: '无' },
] as const;

export const ONLINE_STATUS_OPTIONS = [
  { value: 'online', label: '在线' },
  { value: 'offline', label: '离线' },
] as const;

export interface VehicleRecord {
  id: string;
  operationCity: string;
  vin: string;
  plateNo: string;
  vehicleNo: string;
  vehicleType: string;
  brand: string;
  model: string;
  bodyColor: string;
  parkingLot: string;
  customerName: string;
  businessDept: string;
  businessOwner: string;
  operationStatus: string;
  libStatus: string;
  outboundStatus: string;
  preemptStatus: string;
  prepStatus: string;
  transferStatus: string;
  repairStatus: string;
  licenseStatus: string;
  scrapStatus: string;
  registeredOwner: string;
  onlineStatus: string;
  manufactureYear: string;
  mileage: number;
  purchaseTime: string;
  licenseRegisterDate: string;
  licenseExpiry: string;
  lastDeliveryTime: string;
  lastDeliveryMileage: number;
  lastReturnTime: string;
  lastReturnMileage: number;
  forceScrapDate: string;
  contractNo: string;
  currentLocation: string;
  gpsLastTime: string;
}

export interface VehicleFilterForm {
  operationCity?: string[];
  vehicleType?: string;
  brand?: string;
  model?: string;
  customerName?: string;
  businessDept?: string;
  contractNo?: string;
  registeredOwner?: string;
}
