Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 40 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
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 |