feat(backend): persist plan scores on MealPlanItem

- Migration 0012 adds score (float) and components (jsonb) to meal_plan_item
- generate.py: populates score and components at create time
- schemas/MealPlanItemResponse: include score + components fields
- GET /api/meal-plans/{id}: returns persisted values instead of zeros
This commit is contained in:
2026-05-24 20:20:11 -07:00
parent c96b41ec26
commit e22eae1ecd
5 changed files with 32 additions and 5 deletions
+2
View File
@@ -196,6 +196,8 @@ def generate_meal_plan(
meal_type=meal_type,
approval_status=MealPlanItemStatus.pending,
estimated_cost=scored_recipe.cost.total_cost,
score=scored_recipe.score,
components=scored_recipe.components,
)
db.add(item)