# Entity: Meal from fastapi import APIRouter, Depends, HTTPException, status from sqlalchemy.orm import Session from typing import List from core.database import get_db from models.meal import Meal from schemas.meal import MealSchema from helpers.meal_helpers import get_all_meals, get_meals_by_category router = APIRouter() @router.get("/meals", status_code=200, response_model=List[MealSchema]) async def get_meals( category: str = None, db: Session = Depends(get_db) ): """Get all meals with optional category filter""" if category: meals = get_meals_by_category(db, category) else: meals = get_all_meals(db) return meals