/**
 * 代理充值相关类型定义
 */

// 充值状态
export enum AgentRechargeStatus {
  PENDING = 1, // 待支付
  COMPLETED = 2, // 已完成
  CANCELLED = 3 // 已取消
}

// 支付方式
export type AgentRechargePaymentMethod = 'wechat' | 'offline'

// 支付通道
export type AgentRechargePaymentChannel = 'wechat_direct' | 'fuyou' | 'offline'

// 代理充值订单
export interface AgentRecharge {
  id: number
  recharge_no: string
  agent_wallet_id: number
  shop_id: number
  shop_name: string
  amount: number // 充值金额（单位：分）
  status: AgentRechargeStatus
  payment_method: AgentRechargePaymentMethod
  payment_channel: AgentRechargePaymentChannel
  payment_config_id: number | null
  payment_transaction_id: string
  created_at: string
  paid_at: string | null
  completed_at: string | null
  updated_at: string
}

// 查询代理充值订单列表参数
export interface AgentRechargeQueryParams {
  page?: number
  page_size?: number
  shop_id?: number
  status?: AgentRechargeStatus
  start_date?: string
  end_date?: string
  dateRange?: string[] | any // For date range picker in UI
}

// 代理充值订单列表响应
export interface AgentRechargeListResponse {
  page: number
  page_size: number
  total: number
  items: AgentRecharge[]
  list: AgentRecharge[] // 兼容旧字段
}

// 创建代理充值订单请求
export interface CreateAgentRechargeRequest {
  amount: number // 充值金额（单位：分），范围 10000 ~ 100000000
  payment_method: AgentRechargePaymentMethod
  shop_id: number
}

// 确认线下充值请求
export interface ConfirmOfflinePaymentRequest {
  operation_password: string
}
