/**
 * Product domain types.
 *
 * The product catalogue is a plain JSON file (`/data/products.json`). These types
 * describe that file's contract and the shapes derived from it.
 */

export type ProductCategory =
  | "Electronics"
  | "Clothing"
  | "Shoes"
  | "Home & Kitchen"
  | "Fitness"
  | "Accessories"
  | "Beauty"
  | "Books";

export interface Product {
  id: number;
  name: string;
  description: string;
  category: string;
  subcategory: string;
  price: number;
  brand: string;
  rating: number;
  stock: number;
  image: string;
  tags: string[];
}

/** A product joined with the fields the UI actually renders. */
export interface ProductView extends Product {
  slug: string;
  inStock: boolean;
}

/** The searchable text representation of a product, one string per indexed document. */
export interface ProductDocument {
  id: number;
  text: string;
}