Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 24 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {Controller, Inject, UseGuards, Get} from '@nestjs/common'; |
||
2 | import {AuthGuard} from '@nestjs/passport'; |
||
3 | import {ApiUseTags, ApiBearerAuth, ApiOperation} from '@nestjs/swagger'; |
||
4 | import {IQueryBus} from 'src/Application/IQueryBus'; |
||
5 | import {PaySlipView} from 'src/Application/HumanResource/PaySlip/View/PaySlipView'; |
||
6 | import {GetPaySlipsQuery} from 'src/Application/HumanResource/PaySlip/Query/GetPaySlipsQuery'; |
||
7 | |||
8 | @Controller('pay_slips') |
||
9 | @ApiUseTags('Human Resource') |
||
10 | @ApiBearerAuth() |
||
11 | @UseGuards(AuthGuard('bearer')) |
||
12 | export class GetPaySlipsAction { |
||
13 | constructor( |
||
14 | @Inject('IQueryBus') |
||
15 | private readonly queryBus: IQueryBus |
||
16 | ) {} |
||
17 | |||
18 | @Get() |
||
19 | @ApiOperation({title: 'Get all pay slips'}) |
||
20 | public async index(): Promise<PaySlipView[]> { |
||
21 | return await this.queryBus.execute(new GetPaySlipsQuery()); |
||
22 | } |
||
23 | } |
||
24 |