Passed
Push — master ( 97549a...829953 )
by Mathieu
02:44 queued 01:17
created

api/src/Domain/Order/ShippingCost.entity.ts   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 31
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

3 Functions

Rating   Name   Duplication   Size   Complexity  
A ShippingCost.getPrice 0 3 1
A ShippingCost.getGrams 0 3 1
A ShippingCost.getId 0 3 1
1
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
2
3
@Entity()
4
export class ShippingCost {
5
  @PrimaryGeneratedColumn('uuid')
6
  private id: string;
7
8
  @Column({ type: 'integer', nullable: false, default: 0 })
9
  private grams: number;
10
11
  @Column({ type: 'integer', nullable: false, default: 0 })
12
  private price: number;
13
14
  constructor(grams: number, price: number) {
15
    this.grams = grams;
16
    this.price = price;
17
  }
18
19
  public getId(): string {
20
    return this.id;
21
  }
22
23
  public getGrams(): number {
24
    return this.grams;
25
  }
26
27
  public getPrice(): number {
28
    return this.price;
29
  }
30
}
31