// 订单表单数据相关类型定义
export interface OrderFormData {
  // 基本信息
  customerName: string
  customerPhone: string
  customerEmail?: string

  // 产品信息
  productId: string
  productName: string
  quantity: number
  unitPrice: number
  totalAmount: number

  // 订单详情
  orderType: "online" | "offline" | "phone"
  paymentMethod: "wechat" | "alipay" | "card" | "cash" | "transfer"
  deliveryMethod: "pickup" | "delivery" | "express"

  // 地址信息（如需配送）
  deliveryAddress?: {
    province: string
    city: string
    district: string
    street: string
    zipCode?: string
  }

  // 时间信息
  orderDate: string
  expectedDeliveryDate?: string

  // 备注和标签
  notes?: string
  tags?: string[]

  // 来源信息
  source: "website" | "app" | "phone" | "store" | "social" | "referral"
  campaign?: string
  referrer?: string

  // 状态
  status: "pending" | "confirmed" | "processing" | "shipped" | "delivered" | "cancelled"

  // 元数据
  metadata?: Record<string, any>
}

export interface OrderStats {
  totalOrders: number
  totalRevenue: number
  avgOrderValue: number
  conversionRate: number
  topProducts: Array<{
    productId: string
    productName: string
    quantity: number
    revenue: number
  }>
}

export interface OrderFilter {
  dateRange?: {
    start: string
    end: string
  }
  status?: OrderFormData["status"]
  paymentMethod?: OrderFormData["paymentMethod"]
  source?: OrderFormData["source"]
  minAmount?: number
  maxAmount?: number
  customerPhone?: string
  productId?: string
}
