export interface BaseResponse<T = unknown> {
  statusCode?: number;
  success: boolean;
  data: T;
  message?: string;
}

export interface Category {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  title: string;
  isActive: boolean;
  restaurant: string;
  avatarUrl: string | null;
}

export type CategoriesResponse = BaseResponse<Category[]>;

export type FoodImage = string | { url: string; alt?: string | null };

export interface RestaurantRef {
  id: string;
}

export interface InventoryRef {
  id: string;
}

export type MealType = "breakfast" | "lunch" | "dinner" | "snack";

/** آیتم منو در لیست غذاهای رستوران */
export interface Food {
  id: string;
  category: string;
  title: string;
  desc: string;
  content: string[];
  price: number;
  prepareTime: number;
  isActive: boolean;
  images: string[];
  inPlaceServe: boolean;
  pickupServe: boolean;
  discount: number;
  isSpecialOffer: boolean;
  isAvailable: boolean;
  unavailabilityMessage: string | null;
}

/** جزئیات کامل یک غذا (endpoint تکی) */
export interface FoodDetail {
  id: string;
  createdAt: string;
  updatedAt: string;
  deletedAt: string | null;
  restaurant: RestaurantRef;
  category: Category;
  inventory: InventoryRef;
  title: string;
  desc: string;
  content: string[];
  price: number;
  order: number | null;
  prepareTime: number | null;
  weekDays: number[];
  mealTypes: MealType[];
  isActive: boolean;
  images: string[];
  inPlaceServe: boolean;
  pickupServe: boolean;
  score: number;
  discount: number;
  isSpecialOffer: boolean;
  isAvailable: boolean;
  unavailabilityMessage: string | null;
  reviews: unknown[];
  favorites: unknown[];
  isFavorite: boolean;

  name?: string;
  foodName?: string;
  description?: string;
  image?: string | null;
  points?: number | null;
  sat?: boolean;
  sun?: boolean;
  mon?: boolean;
  breakfast?: boolean;
  noon?: boolean;
  dinner?: boolean;
  stock?: number;
  stockDefault?: number;
  rate?: number;
  [key: string]: unknown;
}

export type FoodsResponse = BaseResponse<Food[]>;
export type FoodResponse = BaseResponse<FoodDetail>;

export interface NotificationsCountData {
  count: number;
}

export type NotificationsCountResponse = BaseResponse<NotificationsCountData>;

export interface Slider {
  id: string;
  createdAt?: string;
  updatedAt?: string;
  deletedAt?: string | null;
  imageUrl: string;
  title?: string | null;
  link?: string | null;
  order?: number;
  isActive?: boolean;
}

export type SlidersResponse = BaseResponse<Slider[]>;
