/**
 * DOMAIN LAYER — Entities
 * Pure business objects. No React, no Next.js, no Zustand, no localStorage.
 */

export type Category = 'chicken' | 'beef' | 'lamb' | 'fish';

export type CutCount = 4 | 8 | 10 | 12;

export type CuttingStyleKey = 'nihari' | 'karahi' | 'qeema' | 'boneless' | 'steak';

export type MeatCategory = 'chicken' | 'beef' | 'lamb';

export interface MeatCustomization {
  type: MeatCategory;
  cuts: CutCount;
  cuttingStyle: CuttingStyleKey;
}

export type ProductCustomization = MeatCustomization | { type: 'fish' };

export function isMeatCustomization(
  customization: ProductCustomization
): customization is MeatCustomization {
  return customization.type !== 'fish';
}

export type PriceUnitKey = 'perBird' | 'perPack' | 'perKg';
export type BadgeKey =
  | 'bestseller'
  | 'chefsPick'
  | 'premium'
  | 'popular'
  | 'freshCatch'
  | 'frozen';

export interface Product {
  id: string;
  slug: string;
  category: Category;
  price: number;
  priceUnitKey: PriceUnitKey;
  image: string;
  images: string[];
  badgeKey?: BadgeKey;
  inStock: boolean;
  featured: boolean;
  weight?: string;
  tags: string[];
}

export interface CartItem {
  id: string;
  product: Product;
  quantity: number;
  customization: ProductCustomization;
  customizationLabel: string;
}

export interface User {
  id: string;
  name: string;
  email: string;
  phone: string;
  address: Address;
  createdAt: string;
}

export interface Address {
  street: string;
  city: string;
  state: string;
  zip: string;
}

export interface Order {
  id: string;
  items: CartItem[];
  total: number;
  status: 'pending' | 'confirmed' | 'preparing' | 'out-for-delivery' | 'delivered';
  createdAt: string;
  deliveryAddress: Address;
  paymentMethod: string;
}

export type SortOption = 'featured' | 'price-asc' | 'price-desc' | 'name';

export type OfferBadgeKey = 'fresh' | 'halal';

export interface WeeklyOffer {
  id: string;
  nameKey: string;
  badgeKey: OfferBadgeKey;
  price: number;
  originalPrice?: number;
  priceUnitKey: PriceUnitKey;
  image: string;
  whatsappProduct: string;
  productSlug: string;
}