Conditions | 2 |
Total Lines | 14 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { |
||
27 | |||
28 | @Post() |
||
29 | @Roles(UserRole.COOPERATOR, UserRole.EMPLOYEE) |
||
30 | @ApiOperation({summary: 'Create new daily rate'}) |
||
31 | public async index(@Body() dto: DailyRateDTO) { |
||
32 | try { |
||
33 | const {userId, customerId, taskId, amount} = dto; |
||
34 | const id = await this.commandBus.execute( |
||
35 | new CreateDailyRateCommand(amount, userId, customerId, taskId) |
||
36 | ); |
||
37 | |||
38 | return {id}; |
||
39 | } catch (e) { |
||
40 | throw new BadRequestException(e.message); |
||
41 | } |
||
44 |