- **Description:** Implement data aggregation for the admin dashboard - **Activities:** - GET `/api/admin/metrics`: Aggregate total patients, active queues, system load using Prisma `groupBy` and `aggregate`. - GET `/api/admin/queue/analytics`: Calculate historical average wait times vs actual service times. - GET `/api/admin/doctor/performance`: Aggregate doctor throughput and patient load. - Implement caching (Redis) for heavy analytic queries with a 5-minute TTL. - **Dependencies:** backend-phase4-queue - **Deliverables:** Analytics controllers, Redis caching for dashboard queries
/api/admin/metrics: Aggregate total patients, active queues, system load using PrismagroupByandaggregate./api/admin/queue/analytics: Calculate historical average wait times vs actual service times./api/admin/doctor/performance: Aggregate doctor throughput and patient load.