feat: Add recipe as ingredient (#4800)

Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
This commit is contained in:
gpotter@gmail.com
2025-11-03 21:57:57 -08:00
committed by GitHub
parent ff42964537
commit 60d9294861
27 changed files with 1037 additions and 80 deletions

View File

@@ -309,6 +309,7 @@ export interface RecipeIngredient {
quantity?: number | null;
unit?: IngredientUnit | CreateIngredientUnit | null;
food?: IngredientFood | CreateIngredientFood | null;
referencedRecipe?: Recipe | null;
note?: string | null;
display?: string;
title?: string | null;
@@ -396,6 +397,129 @@ export interface CreateIngredientFoodAlias {
name: string;
[k: string]: unknown;
}
export interface Recipe {
id?: string | null;
userId?: string;
householdId?: string;
groupId?: string;
name?: string | null;
slug?: string;
image?: unknown;
recipeServings?: number;
recipeYieldQuantity?: number;
recipeYield?: string | null;
totalTime?: string | null;
prepTime?: string | null;
cookTime?: string | null;
performTime?: string | null;
description?: string | null;
recipeCategory?: RecipeCategory[] | null;
tags?: RecipeTag[] | null;
tools?: RecipeTool[];
rating?: number | null;
orgURL?: string | null;
dateAdded?: string | null;
dateUpdated?: string | null;
createdAt?: string | null;
updatedAt?: string | null;
lastMade?: string | null;
recipeIngredient?: RecipeIngredient[];
recipeInstructions?: RecipeStep[] | null;
nutrition?: Nutrition | null;
settings?: RecipeSettings | null;
assets?: RecipeAsset[] | null;
notes?: RecipeNote[] | null;
extras?: {
[k: string]: unknown;
} | null;
comments?: RecipeCommentOut[] | null;
[k: string]: unknown;
}
export interface RecipeCategory {
id?: string | null;
groupId?: string | null;
name: string;
slug: string;
[k: string]: unknown;
}
export interface RecipeTag {
id?: string | null;
groupId?: string | null;
name: string;
slug: string;
[k: string]: unknown;
}
export interface RecipeTool {
id: string;
groupId?: string | null;
name: string;
slug: string;
householdsWithTool?: string[];
[k: string]: unknown;
}
export interface RecipeStep {
id?: string | null;
title?: string | null;
summary?: string | null;
text: string;
ingredientReferences?: IngredientReferences[];
[k: string]: unknown;
}
export interface IngredientReferences {
referenceId?: string | null;
[k: string]: unknown;
}
export interface Nutrition {
calories?: string | null;
carbohydrateContent?: string | null;
cholesterolContent?: string | null;
fatContent?: string | null;
fiberContent?: string | null;
proteinContent?: string | null;
saturatedFatContent?: string | null;
sodiumContent?: string | null;
sugarContent?: string | null;
transFatContent?: string | null;
unsaturatedFatContent?: string | null;
[k: string]: unknown;
}
export interface RecipeSettings {
public?: boolean;
showNutrition?: boolean;
showAssets?: boolean;
landscapeView?: boolean;
disableComments?: boolean;
locked?: boolean;
[k: string]: unknown;
}
export interface RecipeAsset {
name: string;
icon: string;
fileName?: string | null;
[k: string]: unknown;
}
export interface RecipeNote {
title: string;
text: string;
[k: string]: unknown;
}
export interface RecipeCommentOut {
recipeId: string;
text: string;
id: string;
createdAt: string;
updatedAt: string;
userId: string;
user: UserBase;
[k: string]: unknown;
}
export interface UserBase {
id: string;
username?: string | null;
admin: boolean;
fullName?: string | null;
[k: string]: unknown;
}
export interface ShoppingListAddRecipeParamsBulk {
recipeIncrementQuantity?: number;
recipeIngredients?: RecipeIngredient[] | null;
@@ -413,6 +537,7 @@ export interface ShoppingListItemBase {
quantity?: number;
unit?: IngredientUnit | CreateIngredientUnit | null;
food?: IngredientFood | CreateIngredientFood | null;
referencedRecipe?: Recipe | null;
note?: string | null;
display?: string;
shoppingListId: string;
@@ -429,6 +554,7 @@ export interface ShoppingListItemCreate {
quantity?: number;
unit?: IngredientUnit | CreateIngredientUnit | null;
food?: IngredientFood | CreateIngredientFood | null;
referencedRecipe?: Recipe | null;
note?: string | null;
display?: string;
shoppingListId: string;
@@ -453,6 +579,7 @@ export interface ShoppingListItemOut {
quantity?: number;
unit?: IngredientUnit | null;
food?: IngredientFood | null;
referencedRecipe?: Recipe | null;
note?: string | null;
display?: string;
shoppingListId: string;
@@ -492,6 +619,7 @@ export interface ShoppingListItemUpdate {
quantity?: number;
unit?: IngredientUnit | CreateIngredientUnit | null;
food?: IngredientFood | CreateIngredientFood | null;
referencedRecipe?: Recipe | null;
note?: string | null;
display?: string;
shoppingListId: string;
@@ -509,6 +637,7 @@ export interface ShoppingListItemUpdateBulk {
quantity?: number;
unit?: IngredientUnit | CreateIngredientUnit | null;
food?: IngredientFood | CreateIngredientFood | null;
referencedRecipe?: Recipe | null;
note?: string | null;
display?: string;
shoppingListId: string;
@@ -595,28 +724,6 @@ export interface RecipeSummary {
updatedAt?: string | null;
lastMade?: string | null;
}
export interface RecipeCategory {
id?: string | null;
groupId?: string | null;
name: string;
slug: string;
[k: string]: unknown;
}
export interface RecipeTag {
id?: string | null;
groupId?: string | null;
name: string;
slug: string;
[k: string]: unknown;
}
export interface RecipeTool {
id: string;
groupId?: string | null;
name: string;
slug: string;
householdsWithTool?: string[];
[k: string]: unknown;
}
export interface ShoppingListRemoveRecipeParams {
recipeDecrementQuantity?: number;
}
@@ -682,6 +789,7 @@ export interface RecipeIngredientBase {
quantity?: number | null;
unit?: IngredientUnit | CreateIngredientUnit | null;
food?: IngredientFood | CreateIngredientFood | null;
referencedRecipe?: Recipe | null;
note?: string | null;
display?: string;
}

View File

@@ -214,6 +214,7 @@ export interface RecipeIngredient {
quantity?: number | null;
unit?: IngredientUnit | CreateIngredientUnit | null;
food?: IngredientFood | CreateIngredientFood | null;
referencedRecipe?: Recipe | null;
note?: string | null;
display?: string;
title?: string | null;
@@ -349,6 +350,7 @@ export interface RecipeIngredientBase {
quantity?: number | null;
unit?: IngredientUnit | CreateIngredientUnit | null;
food?: IngredientFood | CreateIngredientFood | null;
referencedRecipe?: Recipe | null;
note?: string | null;
display?: string;
}