import {Resource} from '@/lib/models'

export type User = {
  id: number
  admin_id: number
  phone: string
  has_password: boolean
  username: string
  email: string
  name: string
  avatar: string
  status: number
  balance: number
  id_type: number
  id_no: string
  id_token: string
  contact_qq: string
  contact_wechat: string
  last_login: Date
  last_login_host: string
  last_login_agent: string
  created_at: Date
  updated_at: Date
}

export type Bill = {
  id: number
  user_id: number
  trade_id: number
  refund_id: number
  resource_id: number
  bill_no: string
  info: string
  type: number
  amount: number
  created_at: Date
  updated_at: Date
  trade: Trade
  refund: Refund
  resource: Resource
}

export type Trade = {
  id: number
  user_id: number
  inner_no: string
  outer_no: string
  type: number
  subject: string
  remark: string
  amount: number
  payment: number
  method: number
  platform: number
  status: number
  paid_at: Date
  cancel_at: Date
  created_at: Date
  updated_at: Date
}

export type Refund = {
  id: number
  product_id: number
  trade_id: number
  amount: number
  reason: string
  status: number
  created_at: Date
  updated_at: Date
}

export type Channel = {
  id: number
  user_id: number
  proxy_id: number
  node_id: number
  proxy_host: string
  proxy_port: number
  user_host: string
  node_host: string
  auth_ip: boolean
  whitelists: string
  auth_pass: boolean
  protocol: number
  username: string
  password: string
  expiration: Date
  created_at: Date
  updated_at: Date
  proxy?: Proxy
  port: number
  expired_at: Date
  host: string
  batch_no: string
}
export type Proxy = {
  id: number
  ip: string
  msc: string
  secret: string
  type: number
  status: number
  created_at: Date
  updated_at: Date
  deleted_at: Date | null
  channels: Channel[] | null
  version: number
}

export type Announcement = {
  id: number
  title: string
  content: string
  type: number
  status: number
  pin: boolean
  sort: number
  created_at: Date
  updated_at: Date
}
