nutrition: detect recipe refs in ingredients, show in edit UI with multiplier

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 b99333c889
commit 5d7a959355
6 changed files with 124 additions and 49 deletions
+2
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