- Blueprint Flask api_v1 avec prefix /api/v1/
- GET /api/v1/health — healthcheck public
- GET /api/v1/courses/today — courses du jour (paginé, filtré)
- GET /api/v1/courses/{id}/predictions — prédictions ML pour une course
- GET /api/v1/predictions/top3 — top 3 global (free tier)
- GET /api/v1/predictions/all — toutes prédictions (premium+)
- GET /api/v1/valuebets — value bets du jour (premium+)
- GET /api/v1/backtest — résultats backtest historiques (pro)
- GET /api/v1/export/csv — export CSV prédictions/paris (pro)
- GET /api/v1/metrics — métriques perf ML (premium+)
- Swagger/OpenAPI via flasgger à /api/v1/docs
- Erreurs uniformes {status, message, code}
- Pagination limit/offset sur toutes les listes
- 42 tests d'intégration passants
Co-Authored-By: Paperclip <noreply@paperclip.ing>
44 lines
1.5 KiB
Python
44 lines
1.5 KiB
Python
#!/usr/bin/env python3
|
|
"""
|
|
API v1 Blueprint package — Turf SaaS
|
|
Sprint 3-4: HRT-29 — Refacto API /v1/
|
|
Sprint 5-6: HRT-31 — Billing Stripe
|
|
|
|
Registers sub-blueprints:
|
|
/api/v1/health — public health-check
|
|
/api/v1/courses/ — courses du jour
|
|
/api/v1/predictions/— predictions ML
|
|
/api/v1/valuebets — value bets (premium+)
|
|
/api/v1/backtest — backtest historique (pro)
|
|
/api/v1/export/ — export CSV (pro)
|
|
/api/v1/metrics — métriques perf ML (premium+)
|
|
/api/v1/billing/ — Stripe checkout, portal, webhook, status
|
|
/api/v1/docs — Swagger UI (via flasgger, registered on app)
|
|
"""
|
|
|
|
from flask import Blueprint
|
|
|
|
from .routes.health import health_bp
|
|
from .routes.courses import courses_bp
|
|
from .routes.predictions import predictions_bp
|
|
from .routes.valuebets import valuebets_bp
|
|
from .routes.backtest import backtest_bp
|
|
from .routes.export import export_bp
|
|
from .routes.metrics import metrics_bp
|
|
from .routes.billing import billing_bp
|
|
|
|
# Master blueprint that aggregates all sub-routes under /api/v1
|
|
api_v1_bp = Blueprint("api_v1", __name__, url_prefix="/api/v1")
|
|
|
|
|
|
def register_api_v1(app):
|
|
"""Register all API v1 blueprints onto the Flask app."""
|
|
app.register_blueprint(health_bp)
|
|
app.register_blueprint(courses_bp)
|
|
app.register_blueprint(predictions_bp)
|
|
app.register_blueprint(valuebets_bp)
|
|
app.register_blueprint(backtest_bp)
|
|
app.register_blueprint(export_bp)
|
|
app.register_blueprint(metrics_bp)
|
|
app.register_blueprint(billing_bp)
|