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
-
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 prefixedimport.on import so it can never collide with a built-in one; a person's own is prefixedcustom..Pattern
^[A-Za-z][A-Za-z0-9._-]*$Example
chicken_raw -
The ingredient's name as it appears on a plate and in search.
Example
chicken breast -
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.
Values
gramounceeachcuptbsptspscooppacketbottleExample
ounce -
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} -
What the figure is for, so two figures for one ingredient tell apart: "raw weight", "cooked weight", "from the label", "1 cup = 240 ml".
Example
raw weight -
Built into the app, the person's own, or an import.
Values
built_incustomimportedExample
built_in -
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.
Example
4