| Total Complexity | 2 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import { |
||
| 15 | |||
| 16 | @Controller('users/savings-records') |
||
| 17 | @ApiTags('Human Resource') |
||
| 18 | @ApiBearerAuth() |
||
| 19 | @UseGuards(AuthGuard('bearer'), RolesGuard) |
||
| 20 | export class GetUsersSavingsRecordsAction { |
||
| 21 | constructor( |
||
| 22 | @Inject('IQueryBus') |
||
| 23 | private readonly queryBus: IQueryBus |
||
| 24 | ) {} |
||
| 25 | |||
| 26 | @Get() |
||
| 27 | @Roles(UserRole.COOPERATOR, UserRole.EMPLOYEE) |
||
| 28 | @ApiOperation({ summary: 'Get users savings records balance' }) |
||
| 29 | public async index() { |
||
| 30 | try { |
||
| 31 | return await this.queryBus.execute( |
||
| 32 | new GetUsersSavingsRecordsBalanceQuery() |
||
| 33 | ); |
||
| 34 | } catch (e) { |
||
| 35 | throw new BadRequestException(e.message); |
||
| 36 | } |
||
| 39 |