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

// 支付方式枚举
export type PaymentMethod = 'wechat' | 'alipay' | 'bank';

// 订单项
export interface OrderItem {
  id: string;
  orderId: string;
  productName: string;
  productImage: string;
  quantity: number;
  price: number;
  subtotal: number;
}

// 订单基本信息
export interface Order {
  id: string;
  orderNo: string;
  customerName: string;
  customerPhone: string;
  customerEmail?: string;
  items: OrderItem[];
  totalAmount: number;
  status: OrderStatus;
  paymentMethod: PaymentMethod;
  paymentTime?: string;
  shippingAddress?: string;
  shippingCompany?: string;
  shippingNo?: string;
  shippedAt?: string;
  completedAt?: string;
  cancelledAt?: string;
  cancelReason?: string;
  remark?: string;
  createdAt: string;
  updatedAt: string;
}

// 订单列表查询参数
export interface OrderListParams {
  current?: number;
  pageSize?: number;
  orderNo?: string;
  customerName?: string;
  status?: OrderStatus;
  paymentMethod?: PaymentMethod;
  timeRange?: [string, string];
  amountRange?: [number, number];
}

// 发货表单
export interface ShipForm {
  shippingCompany: string;
  shippingNo: string;
}

// 取消订单表单
export interface CancelForm {
  reason: string;
  description?: string;
}
