mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-10-27 08:14:30 -04:00
Feature/automated meal planner (#939)
* cleanup oversized buttons * add get all by category function to reciep repos * fix shopping-list can_merge logic * use randomized data for testing * add random getter to repository for meal-planner * add stub route for random meals * cleanup global namespace * add rules database type * fix type * add plan rules schema * test plan rules methods * add mealplan rules controller * add new repository * update frontend types * formatting * fix regression * update autogenerated types * add api class for mealplan rules * add tests and fix bugs * fix data returns * proof of concept rules editor * add tag support * remove old group categories * add tag support * implement random by rules api * change snack to sides * remove incorrect typing * split repo for custom methods * fix query and use and_ clause * use repo function * remove old test * update changelog
This commit is contained in:
@@ -89,7 +89,7 @@ export interface Recipe {
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: RecipeTag[];
|
||||
recipeCategory?: RecipeCategory[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
@@ -107,14 +107,20 @@ export interface Recipe {
|
||||
};
|
||||
comments?: RecipeCommentOut[];
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
id?: number;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeIngredient {
|
||||
@@ -143,8 +149,8 @@ export interface IngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
id: number;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface MultiPurposeLabelSummary {
|
||||
name: string;
|
||||
@@ -156,7 +162,6 @@ export interface CreateIngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface RecipeStep {
|
||||
id?: string;
|
||||
|
||||
@@ -45,7 +45,7 @@ export interface Recipe {
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: RecipeTag[];
|
||||
recipeCategory?: RecipeCategory[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
@@ -63,14 +63,20 @@ export interface Recipe {
|
||||
};
|
||||
comments?: RecipeCommentOut[];
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
id?: number;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeIngredient {
|
||||
@@ -99,8 +105,8 @@ export interface IngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
id: number;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface MultiPurposeLabelSummary {
|
||||
name: string;
|
||||
@@ -112,7 +118,6 @@ export interface CreateIngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface RecipeStep {
|
||||
id?: string;
|
||||
|
||||
@@ -180,8 +180,8 @@ export interface IngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
id: number;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface MultiPurposeLabelSummary {
|
||||
name: string;
|
||||
@@ -234,7 +234,7 @@ export interface RecipeSummary {
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: RecipeTag[];
|
||||
recipeCategory?: RecipeCategory[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
@@ -243,14 +243,20 @@ export interface RecipeSummary {
|
||||
dateAdded?: string;
|
||||
dateUpdated?: string;
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
id?: number;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeIngredient {
|
||||
@@ -272,7 +278,6 @@ export interface CreateIngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface SaveInviteToken {
|
||||
usesLeft: number;
|
||||
|
||||
@@ -5,8 +5,19 @@
|
||||
/* Do not modify it by hand - just update the pydantic models and then re-run the script
|
||||
*/
|
||||
|
||||
export type PlanEntryType = "breakfast" | "lunch" | "dinner" | "snack";
|
||||
export type PlanEntryType = "breakfast" | "lunch" | "dinner" | "side";
|
||||
export type PlanRulesDay = "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday" | "unset";
|
||||
export type PlanRulesType = "breakfast" | "lunch" | "dinner" | "unset";
|
||||
|
||||
export interface Category {
|
||||
id: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface CreatRandomEntry {
|
||||
date: string;
|
||||
entryType?: PlanEntryType & string;
|
||||
}
|
||||
export interface CreatePlanEntry {
|
||||
date: string;
|
||||
entryType?: PlanEntryType & string;
|
||||
@@ -48,6 +59,32 @@ export interface MealPlanOut {
|
||||
id: number;
|
||||
shoppingList?: number;
|
||||
}
|
||||
export interface PlanRulesCreate {
|
||||
day?: PlanRulesDay & string;
|
||||
entryType?: PlanRulesType & string;
|
||||
categories?: Category[];
|
||||
tags?: Tag[];
|
||||
}
|
||||
export interface Tag {
|
||||
id: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface PlanRulesOut {
|
||||
day?: PlanRulesDay & string;
|
||||
entryType?: PlanRulesType & string;
|
||||
categories?: Category[];
|
||||
tags?: Tag[];
|
||||
groupId: string;
|
||||
id: string;
|
||||
}
|
||||
export interface PlanRulesSave {
|
||||
day?: PlanRulesDay & string;
|
||||
entryType?: PlanRulesType & string;
|
||||
categories?: Category[];
|
||||
tags?: Tag[];
|
||||
groupId: string;
|
||||
}
|
||||
export interface ReadPlanEntry {
|
||||
date: string;
|
||||
entryType?: PlanEntryType & string;
|
||||
@@ -71,7 +108,7 @@ export interface RecipeSummary {
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: RecipeTag[];
|
||||
recipeCategory?: RecipeCategory[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
@@ -80,14 +117,20 @@ export interface RecipeSummary {
|
||||
dateAdded?: string;
|
||||
dateUpdated?: string;
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
id?: number;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeIngredient {
|
||||
@@ -116,8 +159,8 @@ export interface IngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
id: number;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface MultiPurposeLabelSummary {
|
||||
name: string;
|
||||
@@ -129,7 +172,6 @@ export interface CreateIngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface SavePlanEntry {
|
||||
date: string;
|
||||
|
||||
@@ -42,13 +42,6 @@ export interface CreateIngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface MultiPurposeLabelSummary {
|
||||
name: string;
|
||||
color?: string;
|
||||
groupId: string;
|
||||
id: string;
|
||||
}
|
||||
export interface CreateIngredientUnit {
|
||||
name: string;
|
||||
@@ -65,10 +58,12 @@ export interface CreateRecipeBulk {
|
||||
tags?: RecipeTag[];
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
@@ -100,8 +95,14 @@ export interface IngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
id: number;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface MultiPurposeLabelSummary {
|
||||
name: string;
|
||||
color?: string;
|
||||
groupId: string;
|
||||
id: string;
|
||||
}
|
||||
/**
|
||||
* A list of ingredient references.
|
||||
@@ -160,7 +161,7 @@ export interface Recipe {
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: RecipeTag[];
|
||||
recipeCategory?: RecipeCategory[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
@@ -179,9 +180,9 @@ export interface Recipe {
|
||||
comments?: RecipeCommentOut[];
|
||||
}
|
||||
export interface RecipeTool {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
id?: number;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeStep {
|
||||
@@ -281,7 +282,7 @@ export interface RecipeSummary {
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: RecipeTag[];
|
||||
recipeCategory?: RecipeCategory[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
|
||||
@@ -121,7 +121,7 @@ export interface RecipeSummary {
|
||||
cookTime?: string;
|
||||
performTime?: string;
|
||||
description?: string;
|
||||
recipeCategory?: RecipeTag[];
|
||||
recipeCategory?: RecipeCategory[];
|
||||
tags?: RecipeTag[];
|
||||
tools?: RecipeTool[];
|
||||
rating?: number;
|
||||
@@ -130,14 +130,20 @@ export interface RecipeSummary {
|
||||
dateAdded?: string;
|
||||
dateUpdated?: string;
|
||||
}
|
||||
export interface RecipeCategory {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTag {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
}
|
||||
export interface RecipeTool {
|
||||
id?: number;
|
||||
name: string;
|
||||
slug: string;
|
||||
id?: number;
|
||||
onHand?: boolean;
|
||||
}
|
||||
export interface RecipeIngredient {
|
||||
@@ -166,8 +172,8 @@ export interface IngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
id: number;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface MultiPurposeLabelSummary {
|
||||
name: string;
|
||||
@@ -179,7 +185,6 @@ export interface CreateIngredientFood {
|
||||
name: string;
|
||||
description?: string;
|
||||
labelId?: string;
|
||||
label?: MultiPurposeLabelSummary;
|
||||
}
|
||||
export interface ResetPassword {
|
||||
token: string;
|
||||
|
||||
Reference in New Issue
Block a user