Conditions | 2 |
Total Lines | 15 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { |
||
27 | |||
28 | @Post() |
||
29 | @Roles(UserRole.COOPERATOR, UserRole.EMPLOYEE) |
||
30 | @ApiOperation({ summary: 'Add new user savings record' }) |
||
31 | public async index( |
||
32 | @Body() { type, userId, amount }: UserSavingsRecordDTO, |
||
33 | ) { |
||
34 | try { |
||
35 | const id = await this.commandBus.execute( |
||
36 | new AddUserSavingsRecordCommand(type, amount, userId) |
||
37 | ); |
||
38 | |||
39 | return { id }; |
||
40 | } catch (e) { |
||
41 | throw new BadRequestException(e.message); |
||
42 | } |
||
45 |