// ── Discover profile (AI-powered attributes set by cafe owner) ────────────────

export interface CafeDiscoverProfile {
  themes: string[];
  size: string | null;
  floors: string | null;
  vibes: string[];
  occasions: string[];
  spaceFeatures: string[];
  noiseLevel: string | null;
  priceTier: string | null;
}

// ── Badge ─────────────────────────────────────────────────────────────────────

export interface CafeBadge {
  key: string;
  label: string;
  icon: string;
}

// ── Working hours ─────────────────────────────────────────────────────────────

export interface DaySchedule {
  isOpen: boolean;
  open: string | null;
  close: string | null;
}

export interface WorkingHours {
  sat: DaySchedule | null;
  sun: DaySchedule | null;
  mon: DaySchedule | null;
  tue: DaySchedule | null;
  wed: DaySchedule | null;
  thu: DaySchedule | null;
  fri: DaySchedule | null;
}

// ── Cafe (search result card) ─────────────────────────────────────────────────

export interface CafeDiscoverDto {
  id: string;
  name: string;
  slug: string;
  city: string | null;
  address: string | null;
  logoUrl: string | null;
  coverImageUrl: string | null;
  isVerified: boolean;
  averageRating: number;
  reviewCount: number;
  discoverProfile: CafeDiscoverProfile;
  badges: CafeBadge[];
  galleryUrls: string[];
  isOpenNow: boolean;
  instagramHandle: string | null;
  websiteUrl: string | null;
  relevanceScore: number;
}

// ── Cafe (full detail page) ───────────────────────────────────────────────────

export interface CafePublicDto {
  id: string;
  name: string;
  nameAr: string | null;
  nameEn: string | null;
  slug: string;
  city: string | null;
  address: string | null;
  phone: string | null;
  logoUrl: string | null;
  coverImageUrl: string | null;
  description: string | null;
  isVerified: boolean;
  averageRating: number;
  reviewCount: number;
  discoverProfile: CafeDiscoverProfile;
  badges: CafeBadge[];
  galleryUrls: string[];
  isOpenNow: boolean;
  instagramHandle: string | null;
  websiteUrl: string | null;
  workingHours: WorkingHours | null;
}

// ── Menu ──────────────────────────────────────────────────────────────────────

export interface PublicMenuItemDto {
  id: string;
  categoryId: string;
  name: string;
  nameAr: string | null;
  nameEn: string | null;
  description: string | null;
  price: number;
  discountPercent: number;
  imageUrl: string | null;
  isAvailable: boolean;
}

export interface PublicMenuCategoryDto {
  id: string;
  name: string;
  nameAr: string | null;
  nameEn: string | null;
  icon: string | null;
  imageUrl: string | null;
  items: PublicMenuItemDto[];
}

export interface PublicMenuDto {
  cafeId: string;
  cafeName: string;
  slug: string;
  categories: PublicMenuCategoryDto[];
}

// ── Review ────────────────────────────────────────────────────────────────────

export interface CafeReviewDto {
  id: string;
  authorName: string;
  rating: number;
  comment: string | null;
  createdAt: string;
  photoUrls: string[];
}

// ── NLP parse result ─────────────────────────────────────────────────────────

export interface NlpHints {
  themes: string[];
  vibes: string[];
  occasions: string[];
  spaceFeatures: string[];
  noiseLevel: string | null;
  priceTier: string | null;
  size: string | null;
}

// ── API wrapper ───────────────────────────────────────────────────────────────

export interface ApiResponse<T> {
  success: boolean;
  data: T | null;
  error?: { code: string; message: string };
}

// ── Search filters ────────────────────────────────────────────────────────────

export interface DiscoverFilters {
  city?: string;
  q?: string;
  minRating?: number;
  sort?: string;
  themes?: string[];
  vibes?: string[];
  occasions?: string[];
  spaceFeatures?: string[];
  noise?: string;
  priceTier?: string;
  size?: string;
  openNow?: boolean;
}
