Passed
Pull Request — master (#257)
by Mathieu
02:28
created

server/src/Domain/HumanResource/Savings/InterestRate.entity.ts   A

Complexity

Total Complexity 2
Complexity/F 1

Size

Lines of Code 30
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

2 Functions

Rating   Name   Duplication   Size   Complexity  
A InterestRate.getId 0 3 1
A InterestRate.getRate 0 3 1
1
import {
2
  Entity,
3
  Column,
4
  PrimaryGeneratedColumn,
5
} from 'typeorm';
6
7
@Entity()
8
export class InterestRate {
9
  @PrimaryGeneratedColumn('uuid')
10
  private id: string;
11
12
  @Column({ type: 'integer', nullable: false, comment: 'Stored in base 100' })
13
  private rate: number;
14
15
  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
16
  private createdAt: Date;
17
18
  constructor(rate: number) {
19
    this.rate = rate;
20
  }
21
22
  public getId(): string {
23
    return this.id;
24
  }
25
26
  public getRate(): number {
27
    return this.rate;
28
  }
29
}
30