Passed
Pull Request — master (#70)
by Mathieu
01:52
created

server/src/Domain/Billing/Quote.entity.ts   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 49
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A Quote.getId 0 3 1
1
import {Entity, Column, PrimaryGeneratedColumn, ManyToOne} from 'typeorm';
2
import {Customer} from '../Customer/Customer.entity';
3
import {Project} from '../Project/Project.entity';
4
import {User} from '../User/User.entity';
5
6
@Entity()
7
export class Quote {
8
  @PrimaryGeneratedColumn('uuid')
9
  private id: string;
10
11
  @Column({type: 'varchar', nullable: false})
12
  private quoteNumber: string;
13
14
  @Column({type: 'timestamp', default: () => 'CURRENT_TIMESTAMP'})
15
  private date: Date;
16
17
  @Column({type: 'timestamp'})
18
  private expiryDate: Date;
19
20
  @ManyToOne(type => User, {nullable: false})
21
  private owner: User;
22
23
  @ManyToOne(type => Customer, {nullable: false})
24
  private customer: Customer;
25
26
  @ManyToOne(type => Project, {nullable: true})
27
  private project: Project;
28
29
  constructor(
30
    date: Date,
31
    expiryDate: Date,
32
    quoteNumber: string,
33
    owner: User,
34
    customer: Customer,
35
    project?: Project | null
36
  ) {
37
    this.date = date;
38
    this.expiryDate = expiryDate;
39
    this.quoteNumber = quoteNumber;
40
    this.owner = owner;
41
    this.customer = customer;
42
    this.project = project;
43
  }
44
45
  public getId(): string {
46
    return this.id;
47
  }
48
}
49