Passed
Pull Request — master (#442)
by
unknown
02:29
created

src/Infrastructure/HumanResource/Leave/Table/LeaveRequestOverviewTableFactory.ts   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 23
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 17
mnd 0
bc 0
fnc 1
dl 0
loc 23
bpm 0
cpm 1
noi 0
c 0
b 0
f 0
rs 10

1 Function

Rating   Name   Duplication   Size   Complexity  
A LeaveRequestsOverviewTableFactory.create 0 12 1
1
import { Injectable } from '@nestjs/common';
2
import { ILeaveRequestsOverview } from 'src/Domain/HumanResource/Leave/ILeaveRequestsOverview';
3
import { Table } from 'src/Infrastructure/Tables';
4
import { RowFactory } from 'src/Infrastructure/Tables/RowFactory';
5
6
@Injectable()
7
export class LeaveRequestsOverviewTableFactory {
8
  constructor(private rowFactory: RowFactory) {}
9
10
  public create(overview: ILeaveRequestsOverview): Table {
11
    const columns = ['leaves-overview-daysRemaining'];
12
13
    const row = this.rowFactory
14
      .createBuilder()
15
      .template('pages/leave_requests/_overview_badge.njk', {
16
        overview
17
      })
18
      .build();
19
20
    return new Table(columns, [row]);
21
  }
22
}
23