import type { NutritionInfo } from './product.js';
import type { MealType, MealPlanStatus } from '../enums/meal-plan.enums.js';

export interface PlannedMeal {
  id: string; // UUID for UI reference
  type: MealType;
  recipeId?: string;
  recipeName: string; // Denormalized for display without full recipe fetch
  servings: number;
  customName?: string;
  customNutrition?: NutritionInfo;
  perServingNutrition: NutritionInfo;
  notes?: string;
}

export interface MealPlanDay {
  date: string; // ISO date string (YYYY-MM-DD)
  meals: PlannedMeal[];
  dailyNutritionTotal: NutritionInfo; // Computed field
}

export interface MealPlan {
  _id: string;
  householdId: string;
  weekStartDate: string; // Monday of the week (ISO date string YYYY-MM-DD)
  days: MealPlanDay[];
  status: MealPlanStatus;
  shoppingListId?: string;
  createdBy: string;
  createdAt: string;
  updatedAt: string;
}

export interface MealPlanResponse {
  data: MealPlan[];
  pagination: {
    cursor: string | null;
    hasMore: boolean;
    total: number;
  };
}
