package dev.ulfrx.recipe.ui.screens.mealplaneditor

import dev.ulfrx.recipe.ui.components.recipe.MealSlot
import kotlinx.datetime.LocalDate

/**
 * Ingredient appended to a recipe inside the editor (not part of the recipe's
 * original ingredient list). Removed by id — never deduped into the recipe's
 * exclusion set.
 */
data class AddedIngredientUi(
    val ingredientId: String,
    val name: String,
    val amount: Double,
    val unit: String,
)

/** Catalog entry shown in the "Dodaj składnik" search panel. */
data class AddableIngredientUi(
    val ingredientId: String,
    val name: String,
    val defaultAmount: Double,
    val defaultUnit: String,
)

/**
 * Payload emitted by [MealPlanEditorViewModel.confirm] when the user adds the
 * meal to the plan. Persistence to `planStore` and the sync engine lands in
 * Phase 6+; the editor itself produces this value-type only.
 */
data class PlannedMealUi(
    val recipeId: String,
    val date: LocalDate,
    val slot: MealSlot,
    val servings: Int,
    val substitutions: Map<String, String>,
    val excludedIngredients: Set<String>,
    val addedIngredients: List<AddedIngredientUi>,
)
