/* eslint-disable @typescript-eslint/no-explicit-any */
export interface IAdmin extends ITimestamp {
  id: number;
  email: string;
  username: string;
  fullname: string;
  password?: string;
  is_system_account: boolean;
  permissions: [];
}

export interface IKey extends ITimestamp {
  id: number;
  client_key: string;
}

export interface ITimestamp {
  created_at: string;
  updated_at: string;
}

export interface IHistory extends ITimestamp {
  id: number;
  price: number;
}

export interface IOutBidLog extends ITimestamp {
  id: number;
  model: string;
  lot_id: string;
  out_price: number;
  raw_data: string;
}

export interface IScrapConfig extends ITimestamp {
  id: number;
  search_url: string;
  keywords: string;
  enable: boolean | "0" | "1";
  scrap_items: IScrapItem[];
}

export interface IScrapItem extends ITimestamp {
  id: number;
  url: string;
  model: string;
  image_url: string | null;
  keyword: string;
}

export interface IWebBid extends ITimestamp {
  created_at: string;
  updated_at: string;
  id: number;
  origin_url: string;
  url: string | null;
  username: string | null;
  password: string | null;
  active: boolean;
  arrival_offset_seconds: number;
  early_tracking_seconds: number;
  snapshot_at: string | null;
  children: IBid[];
  scrap_config: IScrapConfig;
}

export interface IMetadata extends ITimestamp {
  id: number;
  key_name: string;
  value: any;
}

export interface IBid extends ITimestamp {
  id: number;
  max_price: number;
  reserve_price: number;
  current_price: number;
  name: string | null;
  quantity: number;
  url: string;
  model: string;
  lot_id: string;
  plus_price: number;
  close_time: string | null;
  close_time_ts: string | null;
  start_bid_time: string | null;
  first_bid: boolean;
  status: "biding" | "out-bid" | "win-bid";
  histories: IHistory[];
  web_bid: IWebBid;
  metadata: IMetadata[];
}

export interface IConfig extends ITimestamp {
  id: number;
  key_name: string;
  value: string;
  type: "string" | "number";
}

export interface IPermission extends ITimestamp {
  id: number;
  name: string;
  description: string;
}
export interface ISendMessageHistory extends ITimestamp {
  id: number;
  message: string;
  bid: IBid;
}
