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

InterestRate   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 20
dl 0
loc 22
c 0
b 0
f 0
rs 10

2 Functions

Rating   Name   Duplication   Size   Complexity  
A getId 0 3 1
A 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