import { BaseResponse } from "@/app/[name]/(Main)/types/Types";

export interface ServiceArea {
  type: "Polygon";
  coordinates: number[][][];
}

export interface Score {
  scoreAmount: string;
  scoreCredit: string;
  birthdayScore: string;
  purchaseScore: string;
  referrerScore: string;
  registerScore: string;
  purchaseAmount: string;
  marriageDateScore: string;
}

export interface Shop {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  name: string;
  slug: string;
  logo: string | null;
  address: string | null;
  menuColor: string | null;
  latitude: number | null;
  longitude: number | null;
  serviceArea: ServiceArea;
  isActive: boolean;
  establishedYear: number | null;
  phoneNumber: string | null;
  phone: string;
  instagram: string | null;
  telegram: string | null;
  whatsapp: string | null;
  description: string | null;
  seoTitle: string | null;
  seoDescription: string | null;
  tagNames: string[] | null;
  images: string[] | null;
  vat: number;
  domain: string;
  score: Score;
  plan: 'base' | 'premium';
}

export interface ReviewProduct {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  restaurant: string;
  category: string;
  title: string;
  desc: string | null;
  content: string | null;
  price: number;
  points: number | null;
  order: number | null;
  prepareTime: number | null;
  sat: boolean;
  sun: boolean;
  mon: boolean;
  breakfast: boolean;
  noon: boolean;
  dinner: boolean;
  stock: number;
  stockDefault: number;
  isActive: boolean;
  images: string[];
  inPlaceServe: boolean;
  pickupServe: boolean;
  rate: number;
  discount: number;
  isSpecialOffer: boolean;
}

export interface ReviewUser {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  firstName: string;
  lastName: string;
  birthDate: string;
  marriageDate: string;
  referrer: string | null;
  isActive: boolean;
  gender: boolean;
  wallet: number;
  points: number;
  phone: string;
}

export interface Review {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  order: string;
  /** API returns "food" key */
  food: ReviewProduct;
  user: ReviewUser;
  comment: string;
  rating: number;
  positivePoints: string[];
  negativePoints: string[];
  isApproved: boolean;
}

export interface Schedule {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  weekDay: number;
  openTime: string;
  closeTime: string;
  isActive: boolean;
  restId: string;
}

export type AboutResponse = BaseResponse<Shop>;
export type ReviewsResponse = BaseResponse<Review[]>;
export type SchedulesResponse = BaseResponse<Schedule[]>;
