feat: Add snack, drink, and dessert (#6149)

Co-authored-by: Michael Genson <71845777+michael-genson@users.noreply.github.com>
Co-authored-by: Michael Genson <genson.michael@gmail.com>
This commit is contained in:
Cash Prokop-Weaver
2025-12-05 09:54:00 -08:00
committed by GitHub
parent c115e6d83f
commit 6695314588
10 changed files with 54 additions and 8 deletions

View File

@@ -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" },
];

View File

@@ -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[];
}

View File

@@ -342,6 +342,9 @@
"breakfast": "Breakfast",
"lunch": "Lunch",
"dinner": "Dinner",
"snack": "Snack",
"drink": "Drink",
"dessert": "Dessert",
"type-any": "Any",
"day-any": "Any",
"editor": "Editor",

View File

@@ -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;

View File

@@ -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')"
/>
</div>
</v-col>

View File

@@ -83,6 +83,9 @@ const plan = computed<Days[]>(() => {
{ 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<Days[]>(() => {
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);