Files
api-AT/src/costo/costo.controller.ts
T

26 lines
857 B
TypeScript
Raw Normal View History

2026-02-27 10:56:57 -06:00
import { Controller, Get, Param, UseGuards } from '@nestjs/common';
2026-02-23 14:37:55 -06:00
import { CostoService } from './costo.service';
2026-02-23 18:16:17 -06:00
import { JwtAuthGuard } from 'src/user/jwt.guard';
2026-03-02 14:49:15 -06:00
import { RolesGuard } from 'src/roles.guard';
import { Role } from 'src/role.enum';
import { Roles } from 'src/roles.decorator';
2026-02-23 14:37:55 -06:00
@Controller('costo')
export class CostoController {
2026-02-25 13:01:34 -06:00
constructor(private readonly costoService: CostoService) { }
2026-02-23 14:37:55 -06:00
2026-03-02 14:49:15 -06:00
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR,Role.ATENCION_USUARIOS,Role.SERVICIO_SOCIAL,Role.PCPUMA)
2026-02-23 14:37:55 -06:00
@Get()
findAll() {
return this.costoService.findAll();
}
2026-02-27 19:23:56 -06:00
2026-03-02 14:49:15 -06:00
@UseGuards(JwtAuthGuard, RolesGuard)
@Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR)
2026-02-25 13:01:34 -06:00
@Get('/:id_servicio')
find(@Param('id_servicio') id_servicio: number) {
return this.costoService.find(id_servicio);
}
2026-02-23 14:37:55 -06:00
}