nutrition: detect recipe refs in ingredients, show in edit UI with multiplier
All checks were successful
CI / update (push) Successful in 5m35s

Skip embedding matching for anchor-tag ingredients that reference other
recipes. Instead, mark them with recipeRef/recipeRefMultiplier fields so
their nutrition is resolved via resolveReferencedNutrition with a
user-configurable fraction. The edit UI shows these as teal REF badges
with an editable "Anteil" input.
This commit is contained in:
2026-04-04 09:43:43 +02:00
parent 97969f8151
commit 4a0cddf4b7
6 changed files with 124 additions and 49 deletions

View File

@@ -180,6 +180,8 @@ const RecipeSchema = new mongoose.Schema(
unitConversionSource: { type: String, enum: ['direct', 'density', 'usda_portion', 'estimate', 'manual', 'none'] },
manuallyEdited: { type: Boolean, default: false },
excluded: { type: Boolean, default: false },
recipeRef: { type: String },
recipeRefMultiplier: { type: Number, default: 1 },
}],
// Translation metadata for tracking changes