Passed
Pull Request — master (#152)
by Mathieu
01:55
created

GetUsersPresenceAction   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 } from '@nestjs/common';
2
import { AuthGuard } from '@nestjs/passport';
3
import { ApiTags, ApiOperation, ApiBearerAuth } from '@nestjs/swagger';
4
import { GetUsersPresenceQuery } from 'src/Application/HumanResource/User/Query/GetUsersPresenceQuery';
5
import { IQueryBus } from 'src/Application/IQueryBus';
6
7
@Controller('users')
8
@ApiTags('Human Resource')
9
@ApiBearerAuth()
10
@UseGuards(AuthGuard('bearer'))
11
export class GetUsersPresenceAction {
12
  constructor(
13
    @Inject('IQueryBus')
14
    private readonly queryBus: IQueryBus
15
  ) {}
16
17
  @Get('presence')
18
  @ApiOperation({summary: 'Who\'s there or not today?'})
19
  public async index(): Promise<void> {
20
    return await this.queryBus.execute(new GetUsersPresenceQuery());
21
  }
22
}
23