diff options
| author | zwlucas <lucas.fariamo08@gmail.com> | 2026-07-25 21:23:29 +0000 |
|---|---|---|
| committer | zwlucas <lucas.fariamo08@gmail.com> | 2026-07-25 21:23:29 +0000 |
| commit | ef55d9bb24430610b60c1b77821307cd72c08c55 (patch) | |
| tree | e6935a810b34370b0a4c821e55f6397aac50c832 /api/src/modules/stats/stats.routes.ts | |
| download | helpdesk-ef55d9bb24430610b60c1b77821307cd72c08c55.tar.gz helpdesk-ef55d9bb24430610b60c1b77821307cd72c08c55.zip | |
Signed-off-by: zwlucas <lucas.fariamo08@gmail.com>
Diffstat (limited to 'api/src/modules/stats/stats.routes.ts')
| -rw-r--r-- | api/src/modules/stats/stats.routes.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/api/src/modules/stats/stats.routes.ts b/api/src/modules/stats/stats.routes.ts new file mode 100644 index 0000000..cf02c08 --- /dev/null +++ b/api/src/modules/stats/stats.routes.ts @@ -0,0 +1,22 @@ +/** + * 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<void> { + fastify.get('/', { + schema: { + tags: ['Dashboard'], + summary: 'Retorna métricas e agregados dos chamados', + }, + preHandler: [fastify.authenticate], + handler: getStatsHandler, + }); +} + +export default statsRoutes; |