import { request } from '../../../utils';
import { API } from '../../../types';
import { ResponseType } from '../response-type';

export interface PostGetRanking extends ResponseType {
  data: {
    user_id: number,
    score_dare: number,
    score_nm: number,
    score_un: number,
    score_unp: number,
    score_tcc: number,
    score_deep: number,
    score_whs: number,
    score_kye: number,
    score_tbt: number,
    score_yes: number,
    score_slow: number,
    rank_tbt: number,
    avatar: string,
    first_name: string,
    last_name: string,
    age: number,
    flag1: string,
    flag2: string,
    badge_1281: number,
    badge_un: number,
    badge_supreme: number,
    badge_tbt: number,
    badge_offline: number,
    patreon: number,
    country: string,
    auth: number,
    rank: number,
    country_rank: number,
    dod: number,
    ukr: number,
    badges: number,
    arrow_nm: number,
    arrow_un: number,
    arrow_unp: number,
    arrow_dare: number,
    arrow_yes: number,
    arrow_whs: number,
    arrow_tcc: number,
    arrow_tbt: number,
    arrow_slow: number,
    arrow_kye: number,
  }[];
};

export const rankingApi = {
  getLimitedRanking: () => request.postForm<PostGetRanking>(API.GET_LIMITED_RANKING),
  getFullRanking: () => request.postForm<PostGetRanking>(API.GET_FULL_RANKING),
  getLpi: () => request.postForm<PostGetRanking>(API.GET_LPI),
  getInHistory: () => request.postForm<PostGetRanking>(API.GET_IN_HISTORY),
  getInMemoriam: () => request.postForm<PostGetRanking>(API.GET_IN_MEMORIAM)
};
