feat: add base multiplier support for recipe references

Add optional baseMultiplier field to ingredient and instruction references, allowing base recipes to be included at scaled amounts (e.g., 0.5 for half the recipe).

- Add baseMultiplier field to Recipe schema with default value of 1
- Update TypeScript types to include baseMultiplier
- Add multiplier input field to BaseRecipeSelector modal
- Apply baseMultiplier to ingredient amounts during flattening
- Combine baseMultiplier with recipe multiplier in links
- Display and allow editing baseMultiplier in recipe editor

The multiplier cascades through nested references and works alongside the standard recipe multiplier for compound scaling.
This commit is contained in:
2026-01-13 19:08:24 +01:00
parent bb63555991
commit bf7210dc2e
7 changed files with 95 additions and 15 deletions
+4
View File
@@ -46,6 +46,7 @@ const RecipeSchema = new mongoose.Schema(
includeIngredients: { type: Boolean, default: true },
showLabel: { type: Boolean, default: true },
labelOverride: { type: String, default: "" },
baseMultiplier: { type: Number, default: 1 },
itemsBefore: [{
name: { type: String, default: "" },
unit: String,
@@ -70,6 +71,7 @@ const RecipeSchema = new mongoose.Schema(
includeInstructions: { type: Boolean, default: true },
showLabel: { type: Boolean, default: true },
labelOverride: { type: String, default: "" },
baseMultiplier: { type: Number, default: 1 },
stepsBefore: [String],
stepsAfter: [String],
}],
@@ -115,6 +117,7 @@ const RecipeSchema = new mongoose.Schema(
includeIngredients: { type: Boolean, default: true },
showLabel: { type: Boolean, default: true },
labelOverride: { type: String, default: "" },
baseMultiplier: { type: Number, default: 1 },
itemsBefore: [{
name: { type: String, default: "" },
unit: String,
@@ -134,6 +137,7 @@ const RecipeSchema = new mongoose.Schema(
includeInstructions: { type: Boolean, default: true },
showLabel: { type: Boolean, default: true },
labelOverride: { type: String, default: "" },
baseMultiplier: { type: Number, default: 1 },
stepsBefore: [String],
stepsAfter: [String],
}],