diff --git a/src/auth/auth.service.ts b/src/auth/auth.service.ts index 681a9b12..98655a64 100644 --- a/src/auth/auth.service.ts +++ b/src/auth/auth.service.ts @@ -53,7 +53,6 @@ export class AuthService { RoleEnum.admin, RoleEnum.aprovador_financeiro, RoleEnum.lancador_financeiro, - RoleEnum.admin_finan, ] : [RoleEnum.user]; diff --git a/src/cnab/cnab.controller.ts b/src/cnab/cnab.controller.ts index 007307a6..e12b4a78 100644 --- a/src/cnab/cnab.controller.ts +++ b/src/cnab/cnab.controller.ts @@ -34,7 +34,12 @@ export class CnabController { @Get('clientes-favorecidos') @UseGuards(AuthGuard('jwt'), RolesGuard) - @Roles(RoleEnum.master, RoleEnum.admin, RoleEnum.admin_finan, RoleEnum.lancador_financeiro, RoleEnum.aprovador_financeiro) + @Roles( + RoleEnum.master, // + RoleEnum.admin, + RoleEnum.lancador_financeiro, + RoleEnum.aprovador_financeiro, + ) @ApiBearerAuth() @ApiQuery({ name: 'nome', description: 'Pesquisa por parte do nome, sem distinção de acento ou maiúsculas.', required: false, type: String }) @ApiQuery({ name: 'nomeNot', description: 'Ignora nomes com parte do nome, sem distinção de acento ou maiúsculas.', required: false, type: String }) @@ -55,8 +60,12 @@ export class CnabController { @Get('extratoLancamento') @HttpCode(HttpStatus.OK) @UseGuards(AuthGuard('jwt'), RolesGuard) - @Roles(RoleEnum.master, RoleEnum.admin_finan, RoleEnum.lancador_financeiro, RoleEnum.aprovador_financeiro) - @ApiOperation({description: 'Verifica o saldo do '}) + @Roles( + RoleEnum.master, // + RoleEnum.lancador_financeiro, + RoleEnum.aprovador_financeiro, + ) + @ApiOperation({ description: 'Verifica o saldo do ' }) @ApiBearerAuth() @ApiQuery({ name: 'conta', required: true, type: String }) @ApiQuery({ name: 'dt_inicio', required: true, type: String, example: '2024-01-01' }) diff --git a/src/database/seeds/role/role-seed.service.ts b/src/database/seeds/role/role-seed.service.ts index a961bc84..58cc3a29 100644 --- a/src/database/seeds/role/role-seed.service.ts +++ b/src/database/seeds/role/role-seed.service.ts @@ -90,20 +90,5 @@ export class RoleSeedService { }), ); } - - const admin_finan = await this.roleRepository.count({ - where: { - id: RoleEnum.admin_finan, - }, - }); - - if (!admin_finan) { - await this.roleRepository.save( - this.roleRepository.create({ - id: RoleEnum.admin_finan, - name: 'Admin Finan', - }), - ); - } } } diff --git a/src/database/seeds/user/user-seed-data.service.ts b/src/database/seeds/user/user-seed-data.service.ts index 664c670e..955d957d 100644 --- a/src/database/seeds/user/user-seed-data.service.ts +++ b/src/database/seeds/user/user-seed-data.service.ts @@ -156,14 +156,14 @@ LIMIT 5 fullName: 'Simone Costa', email: 'simonecosta.smtr@gmail.com', password: this.generateRandomPassword(), - role: new Role(RoleEnum.admin_finan), + role: new Role(RoleEnum.aprovador_financeiro), status: new Status(StatusEnum.active), }, { fullName: 'Luciana Fernandes', email: 'lucianafernandes.smtr@gmail.com', password: this.generateRandomPassword(), - role: new Role(RoleEnum.admin_finan), + role: new Role(RoleEnum.aprovador_financeiro), status: new Status(StatusEnum.active), }, @@ -267,14 +267,6 @@ LIMIT 5 role: { id: RoleEnum.user } as Role, status: { id: StatusEnum.active } as Status, }, - { - fullName: 'Administrador Financeiro Teste', - email: 'finan.admin@example.com', - password: 'ob>&+H%=