import type { ProductCategory, ServingUnit, ProductSource } from '../enums/product.enums.js';

export interface NutritionInfo {
  calories: number; // kcal per serving
  protein: number; // grams
  carbs: number; // grams
  fat: number; // grams
  fiber?: number; // grams
  sugar?: number; // grams
  sodium?: number; // mg
  saturatedFat?: number; // grams
  cholesterol?: number; // mg
}

export interface Product {
  id: string;
  householdId: string;
  name: string;
  brand?: string;
  barcode?: string; // EAN-13 / UPC-A, digits only
  category: ProductCategory;
  servingSize: number; // quantity of one serving in `servingUnit`
  servingUnit: ServingUnit; // metric or discrete only
  densityGPerMl?: number; // optional, enables volume↔mass conversion in Phase 6
  nutrition: NutritionInfo; // values are PER serving (size = servingSize servingUnit)
  tags: string[];
  imageUrl?: string;
  source: ProductSource;
  createdBy: string; // userId
  createdAt: Date;
  updatedAt: Date;
  deletedAt?: Date; // soft delete
}
