From 04290f4097dc2ae4c301e3a98f91e3e17fa71cc5 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Tue, 3 Mar 2026 17:41:06 -0600 Subject: [PATCH] merge axel --- .../detalle_servicio.controller.ts | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/detalle_servicio/detalle_servicio.controller.ts b/src/detalle_servicio/detalle_servicio.controller.ts index 96a54c6..0a730d4 100644 --- a/src/detalle_servicio/detalle_servicio.controller.ts +++ b/src/detalle_servicio/detalle_servicio.controller.ts @@ -25,16 +25,17 @@ export class DetalleServicioController { return this.detalleServicioService.findByDateRange(data.desde, data.hasta); } - -@Get('totales-por-periodo') -async getTotalesPorPeriodo( - @Query('periodoInicio') periodoInicio?: string, - @Query('periodoFin') periodoFin?: string, - @Query('servicioId') servicioId?: string, -) { - const inicio = periodoInicio ? parseInt(periodoInicio) : undefined; - const fin = periodoFin ? parseInt(periodoFin) : undefined; - const servicio = servicioId ? parseInt(servicioId) : undefined; - return this.detalleServicioService.getTotalesPorServicioYPeriodo(inicio, fin, servicio); -} + @UseGuards(JwtAuthGuard, RolesGuard) + @Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR) + @Get('totales-por-periodo') + async getTotalesPorPeriodo( + @Query('periodoInicio') periodoInicio?: string, + @Query('periodoFin') periodoFin?: string, + @Query('servicioId') servicioId?: string, + ) { + const inicio = periodoInicio ? parseInt(periodoInicio) : undefined; + const fin = periodoFin ? parseInt(periodoFin) : undefined; + const servicio = servicioId ? parseInt(servicioId) : undefined; + return this.detalleServicioService.getTotalesPorServicioYPeriodo(inicio, fin, servicio); + } }