/** 订单商品项（对应后端 OrderItemVO） */
export interface OrderItem {
  id: number
  productId: number
  productName: string
  productImage: string
  skuId: number
  skuName: string
  price: number
  quantity: number
  totalAmount: number
}

/** 提交订单商品项 */
export interface OrderSubmitItem {
  skuId: number
  quantity: number
}

/** 提交订单请求 */
export interface OrderSubmitReq {
  items: OrderSubmitItem[]
  addressId: number
  /** 优惠券领取记录 ID（可不传） */
  couponId?: number
  remark?: string
}

/** 提交订单返回 */
export interface OrderSubmitResult {
  orderId: number
  orderNo: string
}

/** 获取支付宝支付链接返回 */
export interface OrderPayUrlResult {
  payUrl: string
}

/** 订单（对应后端 OrderDetailVO） */
export interface OrderDetail {
  id: number
  orderNo: string
  userId: number
  totalAmount: number
  freightAmount: number
  discountAmount: number
  couponAmount: number
  payAmount: number
  /** 状态码：0-待付款 1-待发货 2-待收货 3-已完成 4-已取消 5-已退款 */
  status: number
  statusText: string
  /** 状态标签类型（Element Plus） */
  statusTagType: string
  receiverName: string
  receiverPhone: string
  receiverAddress: string
  remark: string
  trackingCompany: string
  trackingNo: string
  payTime: string
  deliverTime: string
  receiveTime: string
  cancelTime: string
  createTime: string
  items: OrderItem[]
  totalQuantity: number
}
