Passed
Pull Request — master (#375)
by
unknown
02:13
created

GetYearlyLeavesSummaryQueryHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A execute 0 6 1
1
import { Inject } from '@nestjs/common';
2
import { QueryHandler } from '@nestjs/cqrs';
3
import { GetYearlyLeavesSummaryQuery } from './GetYearlyLeavesSummaryQuery';
4
import { ILeaveRepository } from 'src/Domain/HumanResource/Leave/Repository/ILeaveRepository';
5
import { LeavesSummaryView } from '../View/LeavesSummaryView';
6
7
@QueryHandler(GetYearlyLeavesSummaryQuery)
8
export class GetYearlyLeavesSummaryQueryHandler {
9
  constructor(
10
    @Inject('ILeaveRepository')
11
    private readonly leaveRepository: ILeaveRepository
12
  ) {}
13
14
  public async execute(
15
    query: GetYearlyLeavesSummaryQuery
16
  ): Promise<LeavesSummaryView[]> {
17
    const leavesSummaries: LeavesSummaryView[] = [new LeavesSummaryView(420)];
18
    return leavesSummaries;
19
  }
20
}
21