// 订单信息类型
export interface OrderItem {
  id: number;
  orderNo: string;
  orderName?: string;
  transactionId?: string;
  activityId?: string;
  userId: number;
  phone?: string;
  deviceId: string;
  shopId?: number;
  shopName?: string;
  totalAmount: number;
  paidAmount?: number;
  discountAmount?: number;
  payStatus: string;
  payStatusLabel?: string;
  payType?: string;
  payTime?: string;
  status: number;
  statusText?: string;
  refundStatus?: number;
  refundReason?: string;
  refundTime?: string;
  createTime: string;
  products?: OrderItemDetail[];
  videoUrl?: string;
  confidence?: number;
  /** 用户消费标签：new-新用户, regular-老用户, frequent-常客 */
  userTag?: string;
  /** 用户消费标签中文描述 */
  userTagLabel?: string;
}

// 订单明细类型（与后端 OrderItemVO 对齐）
export interface OrderItemDetail {
  id: number;
  productId?: number;
  code?: string;
  barCode?: string;
  productName: string;
  pic?: string;
  productNum?: number;
  refundedQuantity?: number; // 已退款数量
  money?: number;
  originPrice?: number;
  price?: number;
}

// 搜索表单类型
export interface OrderSearchForm {
  orderNo: string;
  phone: string;
  deviceId: string;
  payStatus: string;
  status: number | string;
  startDate: string;
  endDate: string;
  dateRange?: any;
}

// 退款商品项
export interface RefundProductItem {
  productId: number;
  productName: string;
  pic?: string;
  quantity: number;
  price: number;
}

// 退款申请记录
export interface RefundApplicationItem {
  id: number;
  applicationNo: string;
  orderId: number;
  orderNo: string;
  activityId?: string;
  userId: number;
  refundAmount: number;
  reason: string;
  refundProducts: RefundProductItem[];
  status: number;
  createTime: string;
  reviewTime?: string;
  reviewRemark?: string;
}

// 退款申请搜索表单
export interface RefundApplicationSearchForm {
  orderNo: string;
  status: number | string;
  startDate: string;
  endDate: string;
  dateRange?: any;
}
