import { IResponse } from "../../../types/response.types";

export type CreateGroupIconType = {
  name: string;
};

export type GroupIconType = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  name: string;
  icons: unknown[];
};

export interface GroupIconsResponse extends IResponse<GroupIconType[]> {
  statusCode: number;
}

export type CreateIconType = {
  url: string;
  groupId: string;
};

export type IconGroupType = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  name: string;
};

export type IconType = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  url: string;
  group: IconGroupType;
};

export interface IconsResponse extends IResponse<IconType[]> {
  statusCode: number;
}

export type ReportItem = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  subject: string;
  content: string;
  phone: string | null;
  scope: string;
  status: string;
};

export interface ReportsResponse extends IResponse<ReportItem[]> {
  statusCode: number;
}

export type ScoreType = {
  scoreAmount: string;
  scoreCredit: string;
  birthdayScore: string;
  purchaseScore: string;
  referrerScore: string;
  registerScore: string;
  purchaseAmount: string;
  marriageDateScore: string;
};

export type RestaurantType = {
  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: string | null;
  isActive: boolean;
  establishedYear: number;
  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: ScoreType | null;
  plan: string;
  subscriptionId: string;
  subscriptionEndDate: string;
  subscriptionStartDate: string;
};

export type PagerType = {
  page: number;
  limit: number;
  totalItems: number;
  totalPages: number;
  prevPage: boolean;
  nextPage: string | false;
};

export type RestaurantsData = {
  pager: PagerType;
  restaurants: RestaurantType[];
};

export interface RestaurantsResponse {
  statusCode: number;
  success: boolean;
  data: RestaurantsData;
}

export interface RestaurantResponse extends IResponse<RestaurantType> {
  statusCode: number;
}

export type RestaurantAdminRoleType = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  name: string;
  isSystem: boolean;
  restaurant: string | null;
};

export type RestaurantAdminRoleItemType = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  admin: string;
  role: RestaurantAdminRoleType;
  restaurant: string;
};

export type RestaurantAdminType = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  firstName: string;
  lastName: string;
  phone: string;
  roles: RestaurantAdminRoleItemType[];
};

export interface RestaurantAdminsResponse
  extends IResponse<RestaurantAdminType[]> {
  statusCode: number;
}

export type RestaurantSmsCountItem = {
  restaurantId: string;
  restaurantName: string;
  smsCount: number;
};

export interface RestaurantSmsCountResponse
  extends IResponse<RestaurantSmsCountItem[]> {
  statusCode: number;
}

export type AddAdminRestaurantType = {
  restaurantId: string;
  phone: string;
  firstName: string;
  lastName: string;
  roleId: string;
};

export type PermissionType = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  name: string;
  title: string;
};

export type SystemRoleType = {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  name: string;
  isSystem: boolean;
  restaurant: string | null;
  permissions: PermissionType[];
};

export interface SystemRolesResponse extends IResponse<SystemRoleType[]> {
  statusCode: number;
}

export type UpdateRestaurantType = {
  name?: string;
  slug?: string;
  establishedYear?: number;
  phone?: string;
  plan?: string;
  subscriptionId?: string;
  subscriptionEndDate?: string;
  subscriptionStartDate?: string;
  isActive?: boolean;
};
