| Total Complexity | 1 |
| Total Lines | 15 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import { Controller, Inject, Get, UseGuards, Query } from '@nestjs/common'; |
||
| 7 | |||
| 8 | @Controller('payslips') |
||
| 9 | @ApiTags('Human Resource') |
||
| 10 | @ApiBearerAuth() |
||
| 11 | @UseGuards(AuthGuard('bearer')) |
||
| 12 | export class GetUsersElementsAction { |
||
| 13 | constructor( |
||
| 14 | @Inject('IQueryBus') |
||
| 15 | private readonly queryBus: IQueryBus |
||
| 16 | ) {} |
||
| 17 | |||
| 18 | @Get() |
||
| 19 | @ApiOperation({ summary: 'Get elements for payslips' }) |
||
| 20 | public async index(): Promise<UserElementsView[]> { |
||
| 21 | return await this.queryBus.execute(new GetUsersElementsQuery(new Date())); |
||
| 22 | } |
||
| 24 |