Passed
Pull Request — master (#157)
by Mathieu
01:42
created

Cooperative.getDayDuration   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
1
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
2
import { Address } from '../Customer/Address.entity';
3
4
@Entity()
5
export class Cooperative {
6
  @PrimaryGeneratedColumn('uuid')
7
  private id: string;
8
9
  @Column({type: 'varchar', nullable: false})
10
  private name: string;
11
12
  @Column({type: 'integer', nullable: false, default: 420, comment: 'Stored in minutes'})
13
  private dayDuration: number;
14
15
  @ManyToOne(type => Address, {nullable: false})
16
  private address: Address;
17
18
  constructor(name: string, dayDuration: number, address: Address) {
19
    this.name = name;
20
    this.dayDuration = dayDuration;
21
    this.address = address;
22
  }
23
24
  public getId(): string {
25
    return this.id;
26
  }
27
28
  public getName(): string {
29
    return this.name;
30
  }
31
32
  public getDayDuration(): number {
33
    return this.dayDuration;
34
  }
35
36
  public getAddress(): Address {
37
    return this.address;
38
  }
39
}
40