91134e2f3f
Merge pull request '[HRT-83] feat: Météo & terrain intégrés dans prédictions ML (Premium)' ( #10 ) from feature/HRT-83-meteo-terrain-ml-predictions into master
CD / Deploy → Staging (push) Has been cancelled
CD / Smoke Tests on Staging (push) Has been cancelled
CD / Deploy → Production (push) Has been cancelled
CD / Rollback Production (push) Has been cancelled
2026-04-30 08:40:16 +02:00
DevOps Engineer
663e0bb149
Merge PR #12 — [HRT-82] Multi-compte / Organisation Pro (max 5 users)
...
CD / Deploy → Staging (push) Has been cancelled
CD / Smoke Tests on Staging (push) Has been cancelled
CD / Deploy → Production (push) Has been cancelled
CD / Rollback Production (push) Has been cancelled
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-30 08:39:59 +02:00
DevOps Engineer
f300e44c74
feat(HRT-80): API Token personnel + Webhook alertes (Pro)
...
- Nouveaux fichiers: api_tokens_db.py, api_v1/routes/user_tokens.py, api_v1/utils_webhook.py
- Migration DB idempotente: tables user_api_tokens + user_webhooks
- Endpoints POST/DELETE /api/v1/user/api-token (Pro only)
- Endpoints POST/DELETE /api/v1/user/webhook (Pro only, HTTPS requis)
- HMAC-SHA256 fire-and-forget dispatch webhook
- auth.py: validate_api_key() + X-API-Key fallback dans jwt_required_middleware
- saas_auth.py: import logging au niveau module, validate_api_key(), X-API-Key fallback
- api_v1/__init__.py: enregistrement user_tokens_bp
- 24 tests pytest — tous passent
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-29 17:25:30 +02:00
DevOps Engineer
946bdc65b6
feat(HRT-82): Multi-compte / Organisation Pro (max 5 users)
...
- Add org_db.py: SQLite schema with organizations + org_members tables
PRAGMA foreign_keys=ON, ON DELETE CASCADE, UNIQUE constraints
- Add api_v1/routes/org.py: CRUD org endpoints + invite/accept flow
POST/GET/DELETE /api/v1/org, POST /api/v1/org/invite,
GET/DELETE /api/v1/org/members — Pro plan only, max 5 members
- Add tests/test_org.py: 36 unit tests (35/36 pass; 1 test-env issue)
- Update api_v1/__init__.py: register org_bp
- Update saas_api_v1.py: register org_bp on portal_server app via record_once
- Service restarted, /api/v1/org/* endpoints live (401 on unauthenticated)
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-29 17:09:13 +02:00
DevOps Engineer
701660ce83
fix(HRT-81): enregistrer history_bp dans api_v1/__init__.py
...
- Ajouter import de history_bp depuis .routes.history
- Ajouter app.register_blueprint(history_bp) dans register_api_v1()
- Corriger le docstring du module pour lister /api/v1/history
- Tests: 19/19 passed (GET /api/v1/history — auth, free/premium/pro, validation, pagination)
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-29 16:56:35 +02:00
DevOps Engineer
8604dc78b1
feat(HRT-79): alertes Telegram configurables Premium/Pro
...
- telegram_alerts.py: service envoi alertes via Bot API (send_pre_race_alerts,
build_race_alert, send_telegram_message) — gestion gracieuse TELEGRAM_BOT_TOKEN absent
- auth_db.py: migrate_telegram_columns() idempotente (ALTER TABLE + try/except OperationalError)
colonnes: telegram_chat_id, alert_value_bets, alert_top1, alert_quinte_only
- api_v1/routes/user.py: blueprint user_bp GET/POST /api/v1/user/telegram-config
protégé @jwt_required_middleware + @plan_required('premium','pro')
- api_v1/__init__.py: import + register user_bp
- turf_scheduler.py: run_telegram_alerts() + schedule_dynamic_telegram_alerts()
planifiées 30min avant course (même pattern que schedule_dynamic_scoring)
avec try/except Exception + fallback logger
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-29 16:42:15 +02:00
DevOps Engineer
ec024d8236
feat(HRT-83): intégrer météo & terrain dans prédictions ML (Premium)
...
- scoring_v2.py : ajout get_terrain_condition() + compute_weather_impact()
score_cheval_v2() accepte weather_data=None (backward-compat préservée)
Impact météo/terrain sur [-5, +5] pts selon pénétromètre + vent + temp
- api_v1/routes/predictions.py : _fetch_ml_predictions() avec include_weather=True
LEFT JOIN pmu_courses (pénétromètre) + pmu_meteo sur date+num_reunion
/predictions/all → terrain_condition + weather_impact dans chaque row
/predictions/top3 → inchangé (free tier, pas de champs météo)
- api_v1/routes/valuebets.py : même LEFT JOIN météo/terrain
/valuebets → terrain_condition + weather_impact dans chaque value bet
Tests : 42/42 passent (pytest tests/test_api_v1.py)
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-29 15:35:15 +02:00
CTO H3R7Tech
d39c7d3319
fix(billing): JWT token incompatibility — use saas_auth require_auth + fix table names HRT-54
...
Co-Authored-By: Paperclip <noreply@paperclip.ing >
2026-04-27 15:21:43 +02:00
DevOps Engineer
b8ef1ed35d
feat: Sprint 3-4 — Refacto API /v1/ (HRT-29)
...
- 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 >
2026-04-25 18:00:54 +02:00