import {
  presentCertificates,
  presentCharities,
  presentDiscounts,
  presentHistoryItems,
  presentJobs,
  presentPartners,
  presentReviews,
  presentStations,
  presentTeamMembers,
} from '../presenters';

export type Root<T> = { records: T[] };

export interface Image {
  url: string;
  name: string;
}

export interface Select {
  name: string;
}

export type Discount = Root<{
  zagolovok: string;
  opisanie: string;
  do: string;
  foto: Image[];
}>;

export type Job = Root<{
  id: number;
  zagolovok: string;
  tip: Select[];
  lokaciya: Select[];
  tegi: Select[];
}>;

export type Partner = Root<{
  id: number;
  nazvanie: string;
  izobrozhenie: Image[];
}>;

export type Station = Root<{
  imya: string;
  opisanie: string;
  adress: string;
  chasyRaboty: Select[];
  lat: number;
  long: number;
  avtomojka: boolean;
  ai92: boolean;
  ai95: boolean;
  z100: boolean;
  propan: boolean;
  zaryadnayaStanciya: boolean;
  dt: boolean;
  miniMarket: boolean;
  tualet: boolean;
  region: Select[];
  foto: Image[];
}>;

export type TextResponse = Root<{
  klyuchNeIzmenyat: string;
  znachenie: string | null;
}>;

export type MediaResponse = Root<{
  mestopolozheniya: string;
  foto: Image[];
  klyuchNeIzmenyat: string;
}>;

export type Team = Root<{
  foto: Image[];
  zvanie: string;
  polnoeImya: string;
}>;

export type History = Root<{
  zagolovok: string;
  god: string;
  opisanie: string;
}>;

export type Review = Root<{
  id: number;
  polnoeImya: string;
  otzyv: string;
  rejting: number;
}>;

export type Charity = Root<{
  zagolovok: string;
  opisanie: string;
  data: string;
  lokaciya: string;
  foto: Image[];
}>;

export type Certificate = Root<{
  nazvanie: string;
  opisanie: string;
  dataVydachi: string;
  dejstvitelenDo: string;
  foto: Image[];
}>;

export type TeamMembers = ReturnType<typeof presentTeamMembers>;
export type HistoryItems = ReturnType<typeof presentHistoryItems>;
export type Stations = ReturnType<typeof presentStations>;
export type Partners = ReturnType<typeof presentPartners>;
export type Jobs = ReturnType<typeof presentJobs>;
export type Discounts = ReturnType<typeof presentDiscounts>;
export type Reviews = ReturnType<typeof presentReviews>;
export type Charities = ReturnType<typeof presentCharities>;
export type Certificates = ReturnType<typeof presentCertificates>;
