Mission Built

The MealStack Schema 0.9.3 · Field set

Ingredient

A thing with macros per unit, and what one unit of it is worth.

An ingredient is a name, a unit, and the macros in exactly one of that unit. Everything else in the schema is built from ingredients. The app ships about two hundred built-in ingredients; a person adds their own; a document declares the ones the app doesn't have built in.

Reusable: a portion carries the ingredient it is a portion of under portion.ingredient.*, so a logged plate stays whole even after the ingredient changes or goes.

Reused as

  • portion.ingredientThe ingredient this portion is of.

Fields

  1. ingredient.id core keyword required

    A stable identifier: starts with a letter, then letters, digits, ., _ and -. Built-in ids are short and unprefixed (chicken_raw, rice_cooked). An ingredient declared in a file is prefixed import. on import so it can never collide with a built-in one; a person's own is prefixed custom..

    Pattern^[A-Za-z][A-Za-z0-9._-]*$

    Examplechicken_raw

  2. ingredient.name core keyword required

    The ingredient's name as it appears on a plate and in search.

    Examplechicken breast

  3. ingredient.unit core keyword required

    The unit the figures are for. Quantities of this ingredient are always in this unit: grams for a gram ingredient, cups for a cup ingredient, scoops for a scoop ingredient. A cup is 240 ml.

    Valuesgramounceeachcuptbsptspscooppacketbottle

    Exampleounce

  4. ingredient.per core object required

    The macros in exactly one unit of the ingredient. Per gram for a gram ingredient, per ounce for an ounce ingredient, per piece, cup, spoon, scoop, packet or bottle otherwise. Ceilings above which a figure is refused as being for the wrong unit: 9.1 kcal per gram, 260 per ounce, 50 per tsp, 140 per tbsp, 1,000 per cup or each, 400 per scoop or packet, 800 per bottle.

    Example{"protein": 6.5, "carbs": 0, "fat": 1}

  5. ingredient.qualifier extended keyword

    What the figure is for, so two figures for one ingredient tell apart: "raw weight", "cooked weight", "from the label", "1 cup = 240 ml".

    Exampleraw weight

  6. ingredient.source extended keyword

    Built into the app, the person's own, or an import.

    Valuesbuilt_incustomimported

    Examplebuilt_in

  7. ingredient.built_in_version extended integer

    For a built-in ingredient, which release of the built-in ingredients the figures are from, so a plate priced against an older release can be re-priced when a figure is corrected.

    Example4