/** * stats.routes.ts * * GET /api/v1/stats → retorna agregados para o dashboard */ import type { FastifyInstance } from 'fastify'; import { statsResponseSchema } from './stats.schema.js'; import { getStatsHandler } from './stats.controller.js'; async function statsRoutes(fastify: FastifyInstance): Promise { fastify.get('/', { schema: { tags: ['Dashboard'], summary: 'Retorna métricas e agregados dos chamados', }, preHandler: [fastify.authenticate], handler: getStatsHandler, }); } export default statsRoutes;