edtech / tasks /todo.md
CognxSafeTrack
fix(super-admin): guard null wabaId, org.id, amount in profiles/templates/billing/AI pages
b5dcbdb
# 📋 État des Tâches : XAMLÉ AI
## ✅ Complété
### Stabilité & Infrastructure
- [x] Bug Timeout Gateway : Architecture Async-First (200 OK immédiat)
- [x] Instabilité Jour 1 : Idempotence Redis (300s) + DB avant MSG
- [x] FFMPEG non-bloquant : subprocess asynchrone
- [x] Docker-compose : services api + whatsapp-worker avec healthchecks
### Sécurité
- [x] SQL Injection analytics : whitelist SELECT uniquement
- [x] JWT secret fallback supprimé : crash hard si absent
- [x] Admin routes : role guard SUPER_ADMIN ajouté
### Pédagogie
- [x] Collecte Équipe Visuelle Jour 11 : enforcement photo obligatoire, extraction AI teamMembers
- [x] BusinessProfile persistance validée
- [x] Rapport mensuel par email (cron 1er du mois, 07h30 UTC)
- [x] Filtre alertes quota par plan (GROWTH/SCALE/ENTERPRISE uniquement)
### Super-Admin Interface (10 pages)
- [x] PlatformDashboard, OrganizationsManager, UsersManager
- [x] WhatsAppNumbers avec flow OTP 2 étapes (register → verify)
- [x] WhatsAppTemplates avec création complète + preview live
- [x] WhatsAppProfiles, MonitoringAlerts, BillingManager
- [x] AuditLogs, AIInsights (commandes NL → actions exécutées)
- [x] 20+ routes backend super-admin (stats, CRUD orgs/users, WA, billing, audit, monitoring, AI)
### Features Admin
- [x] KB Auto-Generation : description métier → FAQ GPT → embeddings → indexation
- [x] CSV export transactions billing
- [x] Reset password utilisateur (email avec lien)
- [x] Org delete soft, suspend/réactiver
- [x] Impersonation org (JWT court-terme ORG_ADMIN)
### Tests
- [x] 31 tests routes API : validation schema, SQL injection guards, auth
## 🔜 Dépend de l'environnement externe
- [ ] Test OTP WhatsApp en prod (nécessite numéro validé Meta)
- [ ] Test création template (nécessite WABA approuvé Meta)
- [ ] Déploiement Railway avec les nouveaux services docker-compose