SLA Alerts and Email Digest
Complaints have a processing deadline per phase and an overall deadline (SLA). The SIG reports delays through alert endpoints, a daily email digest and automatic escalation.
Endpoints
| Method | Endpoint | Access | Description |
|---|---|---|---|
| GET | /api/plaintes/alertes | logged-in user | Overdue complaints and counters |
| GET | /api/plaintes/alertes/stats | logged-in user | Counters only |
| GET | /api/plaintes/alertes/resume | logged-in user | Summary for the user's dashboard |
| POST | /api/plaintes/alertes/check | ROLE_ADMIN | Runs the check and sends the alerts |
GET /api/plaintes/alertes/stats
{
"success": true,
"data": {
"total_ouvertes": 60,
"en_retard_phase": 8,
"en_retard_sla": 5,
"echeance_proche": 12,
"critiques": 2
}
}
critiques counts complaints more than 3 days overdue.
GET /api/plaintes/alertes/resume
{
"success": true,
"data": {
"totalOuvertes": 60,
"enRetardPhase": 8,
"enRetardSla": 5,
"echeanceProche": 12,
"critiques": 2,
"plaintesUrgentes": [
{
"id": "…",
"reference": "PLT-2026-000123",
"plaignant": "…",
"priorite": "haute",
"joursRestantsPhase": -2,
"joursRestantsSla": 1,
"isPhaseEnRetard": true,
"isSlaEnRetard": false
}
],
"hasAlertes": true
}
}
POST /api/plaintes/alertes/check
Response: { "success": true, "message": "Vérification des alertes effectuée", "data": { … } }.
Daily digest
The digest has no endpoint: it is sent by a scheduled command.
php bin/console app:plaintes:send-digest # envoi
php bin/console app:plaintes:send-digest --dry-run # simulation
- Each user receives a single email listing all overdue complaints that concern them, with each complaint's project.
- A complaint already reported in the last 24 hours is not repeated.
- Emails go through the asynchronous queue (Messenger), never through an SMTP call inside the request.
ENABLE_PLAINTE_ALERTS=falsedisables the alerts.
Recommended schedule: once a day at 8 am.
0 8 * * * php bin/console app:plaintes:send-digest
Overdue check
php bin/console app:plaintes:check-overdue [--dry-run] [--stats-only]
Automatic escalation
php bin/console app:plaintes:escalade [--dry-run]
When the workflow phase does not configure its own levels, escalation follows two tiers:
| Level | Recipient | Trigger |
|---|---|---|
| 0 | Agent | No escalation |
| 1 | Component coordinator, based on the complaint's module | Escalation delay exceeded once |
| 2 | National coordinator | Delay exceeded twice |
For sensitive cases, the delay is halved. Recommended schedule: every two hours.
0 */2 * * * php bin/console app:plaintes:escalade
Manual escalation is described in Escalation.