Passed
Pull Request — master (#248)
by
unknown
01:59
created

GetUsersElementsAction   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 15
dl 0
loc 15
c 0
b 0
f 0
rs 10

1 Function

Rating   Name   Duplication   Size   Complexity  
A index 0 5 1
1
import { Controller, Inject, Get, UseGuards, Query } from '@nestjs/common';
2
import { AuthGuard } from '@nestjs/passport';
3
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
4
import { UserView } from 'src/Application/HumanResource/User/View/UserView';
5
import { IQueryBus } from 'src/Application/IQueryBus';
6
import { GetUsersElementsQuery } from 'src/Application/HumanResource/Payslip/Query/GetUsersElementsQuery';
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<UserView[]> {
21
    return await this.queryBus.execute(new GetUsersElementsQuery());
22
  }
23
}
24