package de.effigenix.domain.production;

/**
 * Draft for adding an ingredient to a recipe. Application layer builds this from raw command inputs.
 * The Ingredient entity validates and constructs VOs internally.
 *
 * @param position      Position in the recipe (required, > 0)
 * @param articleId     Reference to the article (required)
 * @param quantity      Quantity amount as string (required)
 * @param uom           Unit of measure as string (required)
 * @param subRecipeId   Optional reference to a sub-recipe
 * @param substitutable Whether this ingredient can be substituted
 */
public record IngredientDraft(
        int position,
        String articleId,
        String quantity,
        String uom,
        String subRecipeId,
        boolean substitutable
) {
    public IngredientDraft {
        if (quantity == null) throw new IllegalArgumentException("quantity must not be null");
        if (uom == null) throw new IllegalArgumentException("uom must not be null");
    }
}
