// 交易模块类型定义

// 订单状态
export type OrderStatus = 'pending' | 'paid' | 'shipped' | 'received' | 'completed' | 'cancelled'

// 订单商品
export interface OrderProduct {
  id: number
  productId: number
  productName: string
  productImg: string
  spec: string
  price: number
  quantity: number
}

// 订单
export interface Order {
  id: number
  orderNo: string
  status: OrderStatus
  statusText: string
  products: OrderProduct[]
  totalAmount: number
  payAmount: number
  freight: number
  createTime: string
  payTime?: string
  shipTime?: string
  receiveTime?: string
  address: {
    name: string
    phone: string
    address: string
  }
  remark?: string
}

// 售后申请
export interface AfterSale {
  id: number
  orderNo: string
  type: 'refund' | 'return' | 'exchange'
  reason: string
  amount: number
  status: string
  createTime: string
}

// 订单评价
export interface OrderEvaluation {
  id: number
  orderNo: string
  productId: number
  productName: string
  rating: number
  content: string
  images?: string[]
  createTime: string
}
