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); + } }