// 订单状态枚举
export enum OrderStatus {
  PENDING_PAYMENT = '待支付',
  WAITING_DEPARTURE = '待出发',
  IN_PROGRESS = '行程中',
  COMPLETED = '已完成',
  CANCELLED = '已取消'
}

// 支付状态枚举
export enum PaymentStatus {
  PENDING = '待支付',
  PAID = '已支付',
  FAILED = '支付失败',
  REFUNDED = '已退款'
}

// 乘客信息接口
export interface Passenger {
  id?: number
  name: string
  idType: string
  idNumber: string
  phone: string
}

// 路线快照接口
export interface RouteSnapshot {
  id: number
  price: number
  availableSeats: number
  departureTime: string
  vehicleModel: string
  startLocation: string
  endLocation: string
  duration: string
  refundPolicy: string
  type?: string
}

// 订单接口
export interface Order {
  id: number
  userId: number
  routeId: number
  passengerCount: number
  totalAmount: number
  status: OrderStatus
  paymentStatus: PaymentStatus
  passengerSnapshots: Passenger[]
  routeSnapshot: RouteSnapshot
  createdAt: Date
  updatedAt: Date
}

// 订单创建请求接口
export interface OrderCreateRequest {
  routeId: number
  passengerCount: number
  passengerSnapshots: Passenger[]
  totalAmount: number
}

// 支付创建请求接口
export interface PaymentCreateRequest {
  orderId: number
  totalAmount: number
  description: string
  openid?: string
}

// 支付创建响应接口
export interface PaymentCreateResponse {
  paymentId: string
  timeStamp: string
  nonceStr: string
  package: string
  signType: string
  paySign: string
}