import {
  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<{
  _name: string;
  _opisanie: string;
  _do: string;
  _foto: Image[];
}>;

export type Job = Root<{
  id: number;
  _name: string;
  _type: Select[];
  _localtio: Select[];
  _tags: Select[];
}>;

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

export type Station = Root<{
  _name: string;
  _opisanie: string;
  _adress: string;
  _chasyRaboty: Select;
  _lat: number;
  _long: number;
  _avtomojka: boolean;
  _dtCopy: boolean;
  _ai92Copy: boolean;
  _ai95Copy: boolean;
  _z100Copy: boolean;
  _propanCopy: boolean;
  _zaryadnayaStanci: boolean;
  _miniMarketCop: boolean;
  _region: Select[];
  _foto: Image[];
}>;

export type TextResponse = Root<{
  _name: string;
  _znachenie: string | null;
}>;

export type Team = Root<{
  _foto: Image[];
  _zvanie: string;
  _name: string;
}>;

export type History = Root<{
  _name: string;
  _god: string;
  _opisanie: string;
}>;

export type Review = Root<{
  id: number;
  _name: string;
  _otzyv: string;
  _rejting: number;
}>;

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>;
