munch-ease-backend/meals/db.py

303 lines
8.4 KiB
Python
Raw Normal View History

2025-10-18 03:26:42 +00:00
import datetime
from typing import AsyncIterator, ClassVar, List, Optional
2024-04-25 04:57:39 +00:00
Squashed commit of the following: commit 4189d9f824f681b480f797b109e963762eb22e9c Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:41:57 2025 +1100 Openapi complete commit bebf8c30cba0b85a889198fe44879614065a0c34 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:35:39 2025 +1100 Removed unversioned api commit dd9cc2eae75d66fceebe14c918c3ed8498376ee6 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:07:03 2025 +1100 Spec updates commit b993c4530688f79ea983278283f984e9d8e83860 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:01:50 2025 +1100 docs(spec): update doof-back-spec with v1 RFC7807 422, reusable Problem* responses, and shopping/current aliasing; tests passing; openapi.json refreshed commit 30bac7e57367b14ce924667a7955845de949d779 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:00:13 2025 +1100 openapi polish commit eb7f7f224f7085fa5b3fadc7716db0ebb7f47eb0 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:54:52 2025 +1100 OpenAPI reusable responses: Added components.responses for `Problem400`, `Problem404`, and `Problem422`; v1 routes reference these consistently. - Units enum: Exposed advisory enum in schema for `Ingredient.unit` using existing units list (no runtime enforcement). commit 037037e17d684a89b264f2406377970a0de7ec99 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:43:01 2025 +1100 Add `total` counts to v1 page responses for recipes/persons; push persons name filter into SQL for v1 when `q` is provided. commit 07e7735076aae8cbd04bb10f9aa324c1a3d80ae4 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:40:17 2025 +1100 Add parameter descriptions for `cursor`, `limit`, and `q` on v1 list endpoints; include example `Page` envelopes in 200 responses. commit e5bf9396b0fe870501d1b4712cba2555dd2ef9b1 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:36:27 2025 +1100 DB pagination commit 782315cd2a0c18cc50e4deaf28e7ec6e4b58c6e2 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:29:38 2025 +1100 camelcase tests commit b207c33e2844c00fc9e531fb9cf8c07a3f5cd543 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:24:57 2025 +1100 OpenAPI enrichment, Error responses commit dc84681ab743008e5cd8bec7f3ccb0d05b557518 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:16:39 2025 +1100 v1 tests: Added basic tests to assert `Page` envelopes and RFC7807 responses for v1 endpoints without affecting legacy tests. commit 1524b7a98ffe04af11c2731c8125ac9348751cff Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:14:51 2025 +1100 Pagination commit 92e91d7acf15c09b14bc76f7b16a7a47e65129ec Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:03:50 2025 +1100 Use middleware for naming case changes commit c68f964f9b8e3d8f8ef020661e747e0990459c81 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:00:09 2025 +1100 Openapi gen
2025-10-18 05:44:36 +00:00
from pydantic import Field
from common import ApiModel
2024-04-25 04:57:39 +00:00
import persons
2025-10-18 03:26:42 +00:00
from ingredients import (
Ingredient,
delete_ingredients_by_meal_id,
find_ingredients_by_meal_id,
insert_ingredient,
)
2024-04-25 04:57:39 +00:00
from persons import Person
2025-10-18 03:26:42 +00:00
from recipes import Recipe, load_recipe_ingredients, row_to_recipe
2024-01-13 07:18:25 +00:00
Squashed commit of the following: commit 4189d9f824f681b480f797b109e963762eb22e9c Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:41:57 2025 +1100 Openapi complete commit bebf8c30cba0b85a889198fe44879614065a0c34 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:35:39 2025 +1100 Removed unversioned api commit dd9cc2eae75d66fceebe14c918c3ed8498376ee6 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:07:03 2025 +1100 Spec updates commit b993c4530688f79ea983278283f984e9d8e83860 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:01:50 2025 +1100 docs(spec): update doof-back-spec with v1 RFC7807 422, reusable Problem* responses, and shopping/current aliasing; tests passing; openapi.json refreshed commit 30bac7e57367b14ce924667a7955845de949d779 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:00:13 2025 +1100 openapi polish commit eb7f7f224f7085fa5b3fadc7716db0ebb7f47eb0 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:54:52 2025 +1100 OpenAPI reusable responses: Added components.responses for `Problem400`, `Problem404`, and `Problem422`; v1 routes reference these consistently. - Units enum: Exposed advisory enum in schema for `Ingredient.unit` using existing units list (no runtime enforcement). commit 037037e17d684a89b264f2406377970a0de7ec99 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:43:01 2025 +1100 Add `total` counts to v1 page responses for recipes/persons; push persons name filter into SQL for v1 when `q` is provided. commit 07e7735076aae8cbd04bb10f9aa324c1a3d80ae4 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:40:17 2025 +1100 Add parameter descriptions for `cursor`, `limit`, and `q` on v1 list endpoints; include example `Page` envelopes in 200 responses. commit e5bf9396b0fe870501d1b4712cba2555dd2ef9b1 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:36:27 2025 +1100 DB pagination commit 782315cd2a0c18cc50e4deaf28e7ec6e4b58c6e2 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:29:38 2025 +1100 camelcase tests commit b207c33e2844c00fc9e531fb9cf8c07a3f5cd543 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:24:57 2025 +1100 OpenAPI enrichment, Error responses commit dc84681ab743008e5cd8bec7f3ccb0d05b557518 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:16:39 2025 +1100 v1 tests: Added basic tests to assert `Page` envelopes and RFC7807 responses for v1 endpoints without affecting legacy tests. commit 1524b7a98ffe04af11c2731c8125ac9348751cff Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:14:51 2025 +1100 Pagination commit 92e91d7acf15c09b14bc76f7b16a7a47e65129ec Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:03:50 2025 +1100 Use middleware for naming case changes commit c68f964f9b8e3d8f8ef020661e747e0990459c81 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:00:09 2025 +1100 Openapi gen
2025-10-18 05:44:36 +00:00
class MealRecipe(ApiModel):
meal_id: int
recipe_id: int
servings: float
recipe: Optional[Recipe] = None
2025-10-18 03:26:42 +00:00
Squashed commit of the following: commit 4189d9f824f681b480f797b109e963762eb22e9c Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:41:57 2025 +1100 Openapi complete commit bebf8c30cba0b85a889198fe44879614065a0c34 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:35:39 2025 +1100 Removed unversioned api commit dd9cc2eae75d66fceebe14c918c3ed8498376ee6 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:07:03 2025 +1100 Spec updates commit b993c4530688f79ea983278283f984e9d8e83860 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:01:50 2025 +1100 docs(spec): update doof-back-spec with v1 RFC7807 422, reusable Problem* responses, and shopping/current aliasing; tests passing; openapi.json refreshed commit 30bac7e57367b14ce924667a7955845de949d779 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 16:00:13 2025 +1100 openapi polish commit eb7f7f224f7085fa5b3fadc7716db0ebb7f47eb0 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:54:52 2025 +1100 OpenAPI reusable responses: Added components.responses for `Problem400`, `Problem404`, and `Problem422`; v1 routes reference these consistently. - Units enum: Exposed advisory enum in schema for `Ingredient.unit` using existing units list (no runtime enforcement). commit 037037e17d684a89b264f2406377970a0de7ec99 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:43:01 2025 +1100 Add `total` counts to v1 page responses for recipes/persons; push persons name filter into SQL for v1 when `q` is provided. commit 07e7735076aae8cbd04bb10f9aa324c1a3d80ae4 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:40:17 2025 +1100 Add parameter descriptions for `cursor`, `limit`, and `q` on v1 list endpoints; include example `Page` envelopes in 200 responses. commit e5bf9396b0fe870501d1b4712cba2555dd2ef9b1 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:36:27 2025 +1100 DB pagination commit 782315cd2a0c18cc50e4deaf28e7ec6e4b58c6e2 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:29:38 2025 +1100 camelcase tests commit b207c33e2844c00fc9e531fb9cf8c07a3f5cd543 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:24:57 2025 +1100 OpenAPI enrichment, Error responses commit dc84681ab743008e5cd8bec7f3ccb0d05b557518 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:16:39 2025 +1100 v1 tests: Added basic tests to assert `Page` envelopes and RFC7807 responses for v1 endpoints without affecting legacy tests. commit 1524b7a98ffe04af11c2731c8125ac9348751cff Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:14:51 2025 +1100 Pagination commit 92e91d7acf15c09b14bc76f7b16a7a47e65129ec Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:03:50 2025 +1100 Use middleware for naming case changes commit c68f964f9b8e3d8f8ef020661e747e0990459c81 Author: jableader <jacobdunk@gmail.com> Date: Sat Oct 18 15:00:09 2025 +1100 Openapi gen
2025-10-18 05:44:36 +00:00
class Meal(ApiModel):
2025-10-18 03:26:42 +00:00
KEYS: ClassVar[List[str]] = ["id", "suggested_date", "consumed_date", "purchase_date"]
2024-05-20 10:09:57 +00:00
id: int = -1
2024-05-25 02:09:32 +00:00
suggested_date: datetime.datetime
2024-05-25 02:33:41 +00:00
consumed_date: Optional[datetime.datetime] = None
2024-04-25 04:57:39 +00:00
2025-10-18 03:26:42 +00:00
chefs: List[Person] = Field(default_factory=list)
cleanup: List[Person] = Field(default_factory=list)
consumers: List[Person] = Field(default_factory=list)
recipes: List[MealRecipe] = Field(default_factory=list)
extra_ingredients: List[Ingredient] = Field(default_factory=list)
2024-01-13 07:18:25 +00:00
2024-05-25 02:33:41 +00:00
# Set from shopping list
purchase_date: Optional[datetime.datetime] = None
2025-10-18 03:26:42 +00:00
2024-01-13 07:18:25 +00:00
async def create(conn):
2025-10-18 03:26:42 +00:00
await conn.execute(
"""
2024-01-13 07:18:25 +00:00
CREATE TABLE IF NOT EXISTS Meal (
id INTEGER PRIMARY KEY,
2024-10-14 05:59:05 +00:00
suggested_date DATETIME,
consumed_date DATETIME DEFAULT NULL,
2024-10-14 06:36:56 +00:00
deleted_date DATETIME DEFAULT NULL,
purchase_date DATETIME DEFAULT NULL
2025-10-18 03:26:42 +00:00
);"""
)
await conn.execute(
"""
2024-01-13 07:18:25 +00:00
CREATE TABLE IF NOT EXISTS MealParticipant (
meal_id INTEGER,
person_id INTEGER,
role TEXT,
FOREIGN KEY(meal_id) REFERENCES Meal(id),
FOREIGN KEY(person_id) REFERENCES Person(id)
2025-10-18 03:26:42 +00:00
);"""
)
await conn.execute(
"""
2024-01-13 07:18:25 +00:00
CREATE TABLE IF NOT EXISTS MealRecipe (
meal_id INTEGER,
recipe_id INTEGER,
servings REAL,
2024-01-13 07:18:25 +00:00
FOREIGN KEY(meal_id) REFERENCES Meal(id),
FOREIGN KEY(recipe_id) REFERENCES Recipe(id)
2025-10-18 03:26:42 +00:00
);"""
)
2024-01-13 07:42:23 +00:00
async def insert_meal_participant(conn, meal_id: int, person_id: int, role: str):
2025-10-18 03:26:42 +00:00
await conn.execute(
"""
2024-01-13 07:42:23 +00:00
INSERT INTO MealParticipant (meal_id, person_id, role)
VALUES (?, ?, ?)
2025-10-18 03:26:42 +00:00
""",
(meal_id, person_id, role),
)
2024-01-13 07:42:23 +00:00
2024-05-02 11:20:52 +00:00
async def sync_meal_participants(conn, meal_id: int, participants: List[Person], role: str):
2025-10-18 03:26:42 +00:00
await conn.execute(
"""
2024-05-02 11:20:52 +00:00
DELETE FROM MealParticipant
WHERE meal_id = ? AND role = ?
2025-10-18 03:26:42 +00:00
""",
(meal_id, role),
)
2024-05-02 11:20:52 +00:00
for person in participants:
await insert_meal_participant(conn, meal_id, person.id, role)
2025-10-18 03:26:42 +00:00
async def insert_meal_recipe(conn, r: MealRecipe):
if r.meal_id < 0:
2025-10-18 03:26:42 +00:00
raise ValueError("Meal must be inserted before meal recipe")
if r.recipe_id < 0 and r.recipe:
r.recipe_id = r.recipe.id
if r.recipe_id < 0:
2025-10-18 03:26:42 +00:00
raise ValueError("Recipe must be inserted before meal")
await conn.execute(
"""
INSERT INTO MealRecipe (meal_id, recipe_id, servings)
VALUES (?, ?, ?)
2025-10-18 03:26:42 +00:00
""",
(r.meal_id, r.recipe_id, r.servings),
)
2024-01-17 10:39:48 +00:00
2024-01-13 07:18:25 +00:00
async def insert_meal(conn, meal: Meal):
2025-10-18 03:26:42 +00:00
async with conn.execute(
"""
2024-05-25 02:09:32 +00:00
INSERT INTO Meal (suggested_date)
2024-01-13 07:18:25 +00:00
VALUES (?)
2025-10-18 03:26:42 +00:00
""",
(meal.suggested_date.isoformat(),),
) as cursor:
2024-01-13 07:42:23 +00:00
meal.id = cursor.lastrowid
2025-10-18 03:26:42 +00:00
await sync_meal_participants(conn, meal.id, meal.chefs, "chef")
await sync_meal_participants(conn, meal.id, meal.cleanup, "cleanup")
await sync_meal_participants(conn, meal.id, meal.consumers, "consumer")
2024-01-13 07:18:25 +00:00
for meal_recipe in meal.recipes:
meal_recipe.meal_id = meal.id
2025-10-18 03:26:42 +00:00
await insert_meal_recipe(conn, meal_recipe)
2024-01-17 10:39:48 +00:00
2024-05-02 11:20:52 +00:00
await sync_extra_ingredients(conn, meal.id, meal.extra_ingredients)
2024-01-17 10:39:48 +00:00
2025-10-18 03:26:42 +00:00
async def find_meal_by_id(conn, meal_id: int) -> Optional[Meal]:
async with conn.execute(
f"""
2024-01-13 07:18:25 +00:00
SELECT {','.join(Meal.KEYS)} FROM Meal
WHERE id = ?
LIMIT 1
2025-10-18 03:26:42 +00:00
""",
(meal_id,),
) as cursor:
2024-01-13 07:18:25 +00:00
async for row in cursor:
2025-10-18 03:26:42 +00:00
meal = Meal(**{k: v for k, v in zip(Meal.KEYS, row)})
2024-05-20 23:57:56 +00:00
2024-05-18 07:05:01 +00:00
await load_participants(conn, meal)
await load_recipes(conn, meal)
await load_extra_ingredients(conn, meal)
return meal
2025-10-18 03:26:42 +00:00
return None
2024-01-13 07:18:25 +00:00
2025-10-18 03:26:42 +00:00
async def find_upcoming_meals_by_date_range(
conn, start: datetime.datetime, end: datetime.datetime
) -> AsyncIterator[Meal]:
async with conn.execute(
f"""
2024-01-13 07:42:23 +00:00
SELECT {','.join(Meal.KEYS)} FROM Meal
2024-09-28 05:04:12 +00:00
WHERE suggested_date >= ? AND suggested_date <= ? AND consumed_date IS NULL AND deleted_date IS NULL
2025-10-18 03:26:42 +00:00
""",
(start, end),
) as cursor:
2024-01-13 07:42:23 +00:00
async for row in cursor:
2025-10-18 03:26:42 +00:00
yield Meal(**{k: v for k, v in zip(Meal.KEYS, row)})
2024-01-13 07:42:23 +00:00
async def load_participants(conn, meal: Meal) -> None:
2025-10-18 03:26:42 +00:00
async with conn.execute(
"""
2024-01-13 07:42:23 +00:00
SELECT person_id, role FROM MealParticipant
WHERE meal_id = ?
2025-10-18 03:26:42 +00:00
""",
(meal.id,),
) as cursor:
2024-01-13 07:42:23 +00:00
async for row in cursor:
2024-04-25 04:57:39 +00:00
person = await persons.get_by_id(conn, row[0])
2025-10-18 03:26:42 +00:00
if row[1] == "chef":
if person:
meal.chefs.append(person)
elif row[1] == "cleanup":
if person:
meal.cleanup.append(person)
elif row[1] == "consumer":
if person:
meal.consumers.append(person)
2024-01-13 07:42:23 +00:00
else:
2025-10-18 03:26:42 +00:00
raise Exception(f"Unknown role: {row[1]}")
2024-01-17 10:39:48 +00:00
async def load_recipes(conn, meal: Meal) -> None:
2025-10-18 03:26:42 +00:00
async with conn.execute(
f"""
SELECT {','.join(Recipe.KEYS)}, MealRecipe.servings as requested_servings
FROM Recipe
2024-01-17 10:39:48 +00:00
JOIN MealRecipe ON MealRecipe.recipe_id = Recipe.id
WHERE MealRecipe.meal_id = ?
2025-10-18 03:26:42 +00:00
""",
(meal.id,),
) as cursor:
2024-01-17 10:39:48 +00:00
async for row in cursor:
2025-10-18 03:26:42 +00:00
recipe = row_to_recipe(list(zip(Recipe.KEYS, row[:-1])))
2024-04-25 04:57:39 +00:00
await load_recipe_ingredients(conn, recipe)
2025-10-18 03:26:42 +00:00
meal.recipes.append(
MealRecipe(meal_id=meal.id, recipe_id=recipe.id, servings=row[-1], recipe=recipe)
)
2024-01-17 10:39:48 +00:00
async def load_extra_ingredients(conn, meal: Meal) -> None:
async for ingredient in find_ingredients_by_meal_id(conn, meal.id):
meal.extra_ingredients.append(ingredient)
2024-01-17 11:43:16 +00:00
2025-10-18 03:26:42 +00:00
2024-01-17 11:43:16 +00:00
async def delete_meal(conn, meal_id: int) -> None:
2025-10-18 03:26:42 +00:00
await conn.execute(
"""
2024-09-28 05:04:12 +00:00
UPDATE Meal
SET deleted_date = ?
2024-01-17 11:43:16 +00:00
WHERE id = ?
2025-10-18 03:26:42 +00:00
""",
(datetime.datetime.now().astimezone().isoformat(), meal_id),
)
2024-05-02 11:20:52 +00:00
async def sync_extra_ingredients(conn, meal_id: int, ingredients: List[Ingredient]) -> None:
await delete_ingredients_by_meal_id(conn, meal_id)
for ingredient in ingredients:
ingredient.meal_id = meal_id
ingredient.recipe_id = None
await insert_ingredient(conn, ingredient)
2025-10-18 03:26:42 +00:00
async def sync_meal_recipes(conn, meal_id: int, recipes: List[MealRecipe]) -> None:
await conn.execute(
"""
2024-05-02 11:20:52 +00:00
DELETE FROM MealRecipe
WHERE meal_id = ?
2025-10-18 03:26:42 +00:00
""",
(meal_id,),
)
2024-05-02 11:20:52 +00:00
for meal_recipe in recipes:
if meal_recipe.meal_id >= 0 and meal_recipe.meal_id != meal_id:
2025-10-18 03:26:42 +00:00
raise ValueError("Already associated with another meal")
meal_recipe.meal_id = meal_id
await insert_meal_recipe(conn, meal_recipe)
2024-05-02 11:20:52 +00:00
2025-10-18 03:26:42 +00:00
2024-05-02 11:20:52 +00:00
async def update_meal(conn, meal: Meal) -> None:
2025-10-18 03:26:42 +00:00
await conn.execute(
"""
2024-05-02 11:20:52 +00:00
UPDATE Meal
2024-05-25 02:09:32 +00:00
SET suggested_date = ?
2024-05-02 11:20:52 +00:00
WHERE id = ?
2025-10-18 03:26:42 +00:00
""",
(meal.suggested_date.isoformat(), meal.id),
)
2024-05-02 11:20:52 +00:00
2025-10-18 03:26:42 +00:00
await sync_meal_participants(conn, meal.id, meal.chefs, "chef")
await sync_meal_participants(conn, meal.id, meal.cleanup, "cleanup")
await sync_meal_participants(conn, meal.id, meal.consumers, "consumer")
2024-05-02 11:20:52 +00:00
await sync_extra_ingredients(conn, meal.id, meal.extra_ingredients)
await sync_meal_recipes(conn, meal.id, meal.recipes)
2024-05-20 23:57:56 +00:00
2025-10-18 03:26:42 +00:00
2024-10-14 05:59:05 +00:00
async def mark_consumed(conn, meal: Meal, date: datetime.datetime) -> None:
2024-05-25 02:33:41 +00:00
meal.consumed_date = date
2025-10-18 03:26:42 +00:00
await conn.execute(
"""
2024-05-25 02:33:41 +00:00
UPDATE Meal
SET consumed_date = ?
WHERE id = ?
2025-10-18 03:26:42 +00:00
""",
(date.isoformat(), meal.id),
)
2024-05-25 02:33:41 +00:00
async def mark_purchased(conn, meal: Meal) -> Meal:
2024-10-14 05:59:05 +00:00
meal.purchase_date = datetime.datetime.now().astimezone()
2025-10-18 03:26:42 +00:00
await conn.execute(
"""
UPDATE Meal
SET purchase_date = ?
WHERE id = ?
2025-10-18 03:26:42 +00:00
""",
(meal.purchase_date.isoformat(), meal.id),
)
2025-10-18 03:26:42 +00:00
return meal