Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 1.96 KB

File metadata and controls

65 lines (46 loc) · 1.96 KB

🧠 CulinaryItem and Recipe Core Model

This document defines the foundational business concepts and relationships that form the backbone of the recipe system.


🧱 CulinaryItem

A CulinaryItem is any discrete food-related object—raw or prepared—that can appear in a recipe system.

🔑 Properties

  • IsRawIngredient (bool)

    • true if the item cannot be broken down into other CulinaryItems (in-app).
    • Examples: Salt, Olive Oil, Basil Leaves
  • IsIngredient (bool, read-only)

    • true if the item appears as an input in at least one Recipe.
    • Derived dynamically based on system data.
  • IsRecipe (bool, read-only)

    • true if the item is produced as an output of at least one Recipe.
    • Derived dynamically based on system data.

🍴 Recipe

A Recipe is a transformation rule that defines how to create one CulinaryItem from others.

🧾 Structure

  • InputItems: List<CulinaryItem>
    Items required to produce the output.

  • OutputItem: CulinaryItem
    The resulting item after following the recipe.

  • Instructions: List<string>
    Steps to combine or transform the inputs.

🔁 Derived Behavior

  • Any item listed in InputItems will have IsIngredient = true
  • The OutputItem of a recipe will have IsRecipe = true

🧪 Example: Pesto Sauce

Recipe: Make Pesto

  • Inputs:
    • Basil (IsRawIngredient)
    • Olive Oil (IsRawIngredient)
    • Parmesan (IsRawIngredient)
    • Garlic (IsRawIngredient)
    • Pine Nuts (IsRawIngredient)
  • Output:
    • Pesto Sauce

Resulting Flags:

  • Basil, Olive Oil, etc. → IsIngredient = true, IsRawIngredient = true
  • Pesto Sauce → IsRecipe = true, IsIngredient = false, IsRawIngredient = false

If later used in a new recipe (e.g., "Pesto Noodles"), Pesto Sauce would also have:

  • IsIngredient = true

This model supports modularity, reuse, nesting, and clean separation of concerns. It forms the conceptual spine of the recipe app.