Contrato — Dashboard
Status: Implementado (unread_notifications aguarda notification_service real)
Termos: Área do Aluno, Matrícula, Plano do Aluno, Onboarding
Controller: dashboard_api_controller
Endpoint
GET /api/v1/platform/dashboard
Authorization: Bearer {wstoken}Resumo cross-product do Aluno. Não exige enrolment_id — agrega
matrículas ativas. Frontend usa para Header, badges e indicadores
gerais da Área do Aluno.
Response 200
{
"enrolments_active": 2,
"has_pending_onboarding": false,
"unread_notifications": 0,
"last_activity": "2026-04-28T15:30:00+00:00"
}| Campo | Tipo | Origem real |
|---|---|---|
enrolments_active |
integer | enrolment_service::find_active_by_userid($USER->id) — count de matrículas ativas |
has_pending_onboarding |
boolean | true se alguma matrícula ativa não tem student_plan criado (mesmo critério de enrolment.onboarding.completed) |
unread_notifications |
integer | Sempre 0 enquanto notification_service for mock (G4) — shape estável, valor real virá quando notifications real |
last_activity |
string | null | ISO-8601 do max(result.completed_at) cross-enrolments do aluno; null se nunca submeteu atividade |
Erros
| HTTP | error |
Causa |
|---|---|---|
| 401 | unauthorized |
wstoken ausente/inválido |
Pendências
unread_notificationspermanece0aténotification_service(G4) ser implementado. Quando estiver, este endpoint começa a retornar contagem real sem mudança de shape.
Referências
- Source:
classes/extensions/platform/controller/dashboard_api_controller.php - Padrão de
has_pending_onboarding:enrolment_api_controller::serialize_enrolment - UC-004 — Área do Aluno