/**
 * 资产信息页面类型定义
 */

// 资产类型枚举
export type AssetType = 'card' | 'device'

// 资产基本信息接口
export interface AssetInfo {
  id: number
  asset_id: number
  asset_type: AssetType
  identifier: string
  iccid?: string
  imei?: string
  msisdn?: string
  carrier_name?: string
  real_name_status?: number
  network_status?: string
  current_month_used_data?: number
  device_type?: string
  device_name?: string
  device_status?: number
  online_status?: number
  virtual_no?: string
  sn?: string
  cards?: BindingCard[]
  status?: number
}

// 设备绑定卡信息
export interface BindingCard {
  id: number
  iccid: string
  is_current: boolean
  status?: number
  carrier_name?: string
}

// 设备实时信息接口
export interface DeviceRealtimeInfo {
  device_id?: number
  status?: string
  online_status?: number
  report_time?: string
  boot_time?: string
  running_time?: string
  rssi?: string
  rsrp?: string
  rsrq?: string
  sinr?: string
  band?: string
  pci?: string
  wifi_enabled?: number
  wifi_ssid?: string
  wifi_password?: string
  network_type?: string
  ip_address?: string
  apn?: string
  current_iccid?: string
  uplink_rate?: number
  downlink_rate?: number
  uplink_speed_limit?: number
  downlink_speed_limit?: number
  switch_mode?: string
  imei?: string
  model?: string
  firmware_version?: string
}

// 套餐信息接口
export interface PackageInfo {
  id: number
  package_id: number
  package_name: string
  package_price: number
  package_total_data: number
  real_data_used: number
  real_data_remaining: number
  real_data_total: number
  virtual_data_used: number
  virtual_data_remaining: number
  virtual_data_total: number
  start_time: string
  expire_time: string
  status: number
  duration_days?: number
}

// 钱包信息接口 (使用已有的 AssetWalletResponse)
export interface WalletInfo {
  total_balance: number
  available_balance: number
  frozen_balance: number
  status: number
}

// 限速表单接口
export interface SpeedLimitForm {
  download_speed: number
  upload_speed: number
}

// 切卡表单接口
export interface SwitchCardForm {
  target_iccid: string
}

// WiFi配置表单接口
export interface WiFiForm {
  enabled: number
  ssid: string
  password: string
}

// 充值表单接口
export interface RechargeForm {
  package_id?: number
  payment_method: 'wallet' | 'offline'
  payment_voucher?: string
}

// 流量详单日记录
export interface DailyRecord {
  date: string
  data_used: number
}

// 流量详单数据
export interface DailyRecordsData {
  package_info: PackageInfo
  records: DailyRecord[]
}

// 订单历史数据
export interface OrderHistoryData {
  current_order?: any
  previous_orders: any[]
  total: number
  replacement_chain?: string[]
}
