feat: add plan entry type of snack

This commit is contained in:
Cameron Pickle 2025-07-06 07:43:30 -06:00
commit 27cd066a03
No known key found for this signature in database
GPG key ID: 07BF6689121CF92C
6 changed files with 9 additions and 1 deletions

View file

@ -73,6 +73,7 @@ export default defineNuxtComponent({
{ 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.type-any"), value: "unset" },
];

View file

@ -15,6 +15,7 @@ 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" },
] as PlanOption[];
}

View file

@ -334,6 +334,7 @@
"quick-week": "Quick Week",
"side": "Side",
"sides": "Sides",
"snack": "Snack",
"start-date": "Start Date",
"rule-day": "Rule Day",
"meal-type": "Meal Type",

View file

@ -7,7 +7,7 @@
import type { HouseholdSummary } from "./household";
export type PlanEntryType = "breakfast" | "lunch" | "dinner" | "side";
export type PlanEntryType = "breakfast" | "lunch" | "dinner" | "side" | "snack";
export type PlanRulesDay = "monday" | "tuesday" | "wednesday" | "thursday" | "friday" | "saturday" | "sunday" | "unset";
export type PlanRulesType = "breakfast" | "lunch" | "dinner" | "side" | "unset";
export type LogicalOperator = "AND" | "OR";

View file

@ -79,6 +79,7 @@ export default defineNuxtComponent({
{ 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: [] },
],
recipes: [],
};
@ -96,6 +97,9 @@ export default defineNuxtComponent({
else if (meal.entryType === "side") {
out.sections[3].meals.push(meal);
}
else if (meal.entryType === "snack") {
out.sections[4].meals.push(meal);
}
if (meal.recipe) {
out.recipes.push(meal.recipe);

View file

@ -21,6 +21,7 @@ class PlanEntryType(str, Enum):
lunch = "lunch"
dinner = "dinner"
side = "side"
snack = "snack"
class CreateRandomEntry(MealieModel):