feat: Add referential routes for listing available plans and remove plans endpoint from admin routes

This commit is contained in:
JSC
2025-07-16 15:44:57 +02:00
parent e874d0665f
commit 010f18bff4
3 changed files with 19 additions and 12 deletions

17
app/routes/referential.py Normal file
View File

@@ -0,0 +1,17 @@
"""Referential routes for reference data."""
from flask import Blueprint
bp = Blueprint("referential", __name__)
@bp.route("/plans")
def list_plans() -> dict:
"""List all available plans."""
from app.models.plan import Plan
plans = Plan.query.order_by(Plan.id).all()
return {
"plans": [plan.to_dict() for plan in plans],
"total": len(plans)
}