diff --git a/docs/docs/overrides/api.html b/docs/docs/overrides/api.html index 7fab21795..5c6749702 100644 --- a/docs/docs/overrides/api.html +++ b/docs/docs/overrides/api.html @@ -14,7 +14,7 @@
diff --git a/frontend/components/Domain/Household/GroupMealPlanRuleForm.vue b/frontend/components/Domain/Household/GroupMealPlanRuleForm.vue index bd8257fa7..3d8fb76d6 100644 --- a/frontend/components/Domain/Household/GroupMealPlanRuleForm.vue +++ b/frontend/components/Domain/Household/GroupMealPlanRuleForm.vue @@ -58,6 +58,9 @@ const MEAL_TYPE_OPTIONS = [ { title: i18n.t("meal-plan.lunch"), value: "lunch" }, { title: i18n.t("meal-plan.dinner"), value: "dinner" }, { title: i18n.t("meal-plan.side"), value: "side" }, + { title: i18n.t("meal-plan.snack"), value: "snack" }, + { title: i18n.t("meal-plan.drink"), value: "drink" }, + { title: i18n.t("meal-plan.dessert"), value: "dessert" }, { title: i18n.t("meal-plan.type-any"), value: "unset" }, ]; diff --git a/frontend/composables/use-group-mealplan.ts b/frontend/composables/use-group-mealplan.ts index f8dcb402f..95f9d6be0 100644 --- a/frontend/composables/use-group-mealplan.ts +++ b/frontend/composables/use-group-mealplan.ts @@ -15,6 +15,9 @@ export function usePlanTypeOptions() { { text: i18n.t("meal-plan.lunch"), value: "lunch" }, { text: i18n.t("meal-plan.dinner"), value: "dinner" }, { text: i18n.t("meal-plan.side"), value: "side" }, + { text: i18n.t("meal-plan.snack"), value: "snack" }, + { text: i18n.t("meal-plan.drink"), value: "drink" }, + { text: i18n.t("meal-plan.dessert"), value: "dessert" }, ] as PlanOption[]; } diff --git a/frontend/lang/messages/en-US.json b/frontend/lang/messages/en-US.json index 3d507365f..2f5a3453f 100644 --- a/frontend/lang/messages/en-US.json +++ b/frontend/lang/messages/en-US.json @@ -342,6 +342,9 @@ "breakfast": "Breakfast", "lunch": "Lunch", "dinner": "Dinner", + "snack": "Snack", + "drink": "Drink", + "dessert": "Dessert", "type-any": "Any", "day-any": "Any", "editor": "Editor", diff --git a/frontend/lib/api/types/meal-plan.ts b/frontend/lib/api/types/meal-plan.ts index 7cee5eb50..aa4f27115 100644 --- a/frontend/lib/api/types/meal-plan.ts +++ b/frontend/lib/api/types/meal-plan.ts @@ -5,9 +5,9 @@ /* Do not modify it by hand - just update the pydantic models and then re-run the script */ -export type PlanEntryType = "breakfast" | "lunch" | "dinner" | "side"; +export type PlanEntryType = "breakfast" | "lunch" | "dinner" | "side" | "snack" | "drink" | "dessert"; export type PlanRulesDay = "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday" | "unset"; -export type PlanRulesType = "breakfast" | "lunch" | "dinner" | "side" | "unset"; +export type PlanRulesType = "breakfast" | "lunch" | "dinner" | "side" | "snack" | "drink" | "dessert" | "unset"; export type LogicalOperator = "AND" | "OR"; export type RelationalKeyword = "IS" | "IS NOT" | "IN" | "NOT IN" | "CONTAINS ALL" | "LIKE" | "NOT LIKE"; export type RelationalOperator = "=" | "<>" | ">" | "<" | ">=" | "<="; @@ -53,7 +53,6 @@ export interface QueryFilterJSONPart { attributeName?: string | null; relationalOperator?: RelationalKeyword | RelationalOperator | null; value?: string | string[] | null; - [k: string]: unknown; } export interface PlanRulesSave { day?: PlanRulesDay; @@ -106,14 +105,12 @@ export interface RecipeCategory { 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; @@ -121,7 +118,6 @@ export interface RecipeTool { name: string; slug: string; householdsWithTool?: string[]; - [k: string]: unknown; } export interface SavePlanEntry { date: string; diff --git a/frontend/pages/household/mealplan/planner/edit.vue b/frontend/pages/household/mealplan/planner/edit.vue index 2a1b6a5e9..c5fd2e71e 100644 --- a/frontend/pages/household/mealplan/planner/edit.vue +++ b/frontend/pages/household/mealplan/planner/edit.vue @@ -178,6 +178,26 @@ text: $t('meal-plan.lunch'), event: 'randomLunch', }, + { + icon: $globals.icons.diceMultiple, + text: $t('meal-plan.side'), + event: 'randomSide', + }, + { + icon: $globals.icons.diceMultiple, + text: $t('meal-plan.snack'), + event: 'randomSnack', + }, + { + icon: $globals.icons.diceMultiple, + text: $t('meal-plan.drink'), + event: 'randomDrink', + }, + { + icon: $globals.icons.diceMultiple, + text: $t('meal-plan.dessert'), + event: 'randomDessert', + }, ], }, { @@ -201,6 +221,9 @@ @random-lunch="randomMeal(plan.date, 'lunch')" @random-dinner="randomMeal(plan.date, 'dinner')" @random-side="randomMeal(plan.date, 'side')" + @random-snack="randomMeal(plan.date, 'snack')" + @random-drink="randomMeal(plan.date, 'drink')" + @random-dessert="randomMeal(plan.date, 'dessert')" /> diff --git a/frontend/pages/household/mealplan/planner/view.vue b/frontend/pages/household/mealplan/planner/view.vue index 13203b7b8..9e4049a55 100644 --- a/frontend/pages/household/mealplan/planner/view.vue +++ b/frontend/pages/household/mealplan/planner/view.vue @@ -83,6 +83,9 @@ const plan = computed(() => { { title: i18n.t("meal-plan.lunch"), meals: [] }, { title: i18n.t("meal-plan.dinner"), meals: [] }, { title: i18n.t("meal-plan.side"), meals: [] }, + { title: i18n.t("meal-plan.snack"), meals: [] }, + { title: i18n.t("meal-plan.drink"), meals: [] }, + { title: i18n.t("meal-plan.dessert"), meals: [] }, ], recipes: [], }; @@ -100,6 +103,15 @@ const plan = computed(() => { else if (meal.entryType === "side") { out.sections[3].meals.push(meal); } + else if (meal.entryType === "snack") { + out.sections[4].meals.push(meal); + } + else if (meal.entryType === "drink") { + out.sections[5].meals.push(meal); + } + else if (meal.entryType === "dessert") { + out.sections[6].meals.push(meal); + } if (meal.recipe) { out.recipes.push(meal.recipe); diff --git a/mealie/db/models/household/mealplan.py b/mealie/db/models/household/mealplan.py index b29cfb312..0131000d8 100644 --- a/mealie/db/models/household/mealplan.py +++ b/mealie/db/models/household/mealplan.py @@ -39,7 +39,7 @@ class GroupMealPlanRules(BaseMixins, SqlAlchemyBase): ) # "MONDAY", "TUESDAY", "WEDNESDAY", etc... entry_type: Mapped[str] = mapped_column( String, nullable=False, default="" - ) # "breakfast", "lunch", "dinner", "side" + ) # "breakfast", "lunch", "dinner", etc ... query_filter_string: Mapped[str] = mapped_column(String, nullable=False, default="") # Old filters - deprecated in favor of query filter strings diff --git a/mealie/schema/meal_plan/new_meal.py b/mealie/schema/meal_plan/new_meal.py index c766bf49e..a5e7cc62b 100644 --- a/mealie/schema/meal_plan/new_meal.py +++ b/mealie/schema/meal_plan/new_meal.py @@ -21,6 +21,9 @@ class PlanEntryType(str, Enum): lunch = "lunch" dinner = "dinner" side = "side" + snack = "snack" + drink = "drink" + dessert = "dessert" class CreateRandomEntry(MealieModel): diff --git a/mealie/schema/meal_plan/plan_rules.py b/mealie/schema/meal_plan/plan_rules.py index 284eb0aca..3358e503c 100644 --- a/mealie/schema/meal_plan/plan_rules.py +++ b/mealie/schema/meal_plan/plan_rules.py @@ -38,6 +38,9 @@ class PlanRulesType(str, Enum): lunch = "lunch" dinner = "dinner" side = "side" + snack = "snack" + drink = "drink" + dessert = "dessert" unset = "unset"