export type DeviceStatus = "online" | "offline" | "unknown" | "busy"

export type DeviceType = Device

export interface Device {
  id: string
  name: string
  wechatId?: string
  group?: string
  tags?: string[]
  os: "Android" | "iOS" | "Windows" | "Mac"
  status: DeviceStatus
  owner?: string
  lastSeen?: string
}

export interface CreateDeviceParams {
  name: string
  wechatId?: string
  group?: string
  tags?: string[]
  os: "Android" | "iOS" | "Windows" | "Mac"
}

export interface UpdateDeviceParams extends Partial<CreateDeviceParams> {
  id: string
}

export interface QueryDeviceParams {
  keyword?: string
  tags?: string[]
  dateRange?: { start: string; end: string }
  page?: number
  pageSize?: number
}

export interface DeviceStats {
  id: string
  tasksToday: number
  uptimePercent: number
}

export interface DeviceTaskRecord {
  id: string
  deviceId: string
  type: string
  status: "success" | "failed"
  time: string
}

export interface PaginatedResponse<T> {
  items: T[]
  total: number
  page: number
  pageSize: number
  totalPages: number
}

export interface ApiResponse<T> {
  code: number
  message: string
  data: T | null
}
