Passed
Push — master ( 1ff847...a1e431 )
by
unknown
02:16
created

server/src/Domain/Contact/Contact.entity.ts   A

Complexity

Total Complexity 8
Complexity/F 1

Size

Lines of Code 77
Function Count 8

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

8 Functions

Rating   Name   Duplication   Size   Complexity  
A Contact.getCreatedAt 0 3 1
A Contact.getPhoneNumber 0 3 1
A Contact.getCompany 0 3 1
A Contact.getNotes 0 3 1
A Contact.getId 0 3 1
A Contact.getFirstName 0 3 1
A Contact.getEmail 0 3 1
A Contact.getLastName 0 3 1
1
import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
2
3
@Entity()
4
export class Contact {
5
  @PrimaryGeneratedColumn('uuid')
6
  private id: string;
7
8
  @Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
9
  private createdAt: Date;
10
11
  @Column({ type: 'varchar', nullable: true })
12
  private firstName: string;
13
14
  @Column({ type: 'varchar', nullable: true })
15
  private lastName: string;
16
17
  @Column({ type: 'varchar', nullable: true })
18
  private company: string;
19
20
  @Column({ type: 'varchar', nullable: true })
21
  private email: string;
22
23
  @Column({ type: 'varchar', nullable: true })
24
  private phoneNumber: string;
25
26
  @Column({ type: 'varchar', nullable: true })
27
  private notes: string;
28
29
  constructor(
30
    firstName: string,
31
    lastName: string,
32
    company: string,
33
    email: string,
34
    phoneNumber: string,
35
    notes: string
36
  ) {
37
    this.firstName = firstName;
38
    this.lastName = lastName;
39
    this.company = company;
40
    this.email = email;
41
    this.phoneNumber = phoneNumber;
42
    this.notes = notes;
43
  }
44
45
  public getId(): string | null {
46
    return this.id;
47
  }
48
49
  public getCreatedAt(): Date {
50
    return this.createdAt;
51
  }
52
53
  public getFirstName(): string | null {
54
    return this.firstName;
55
  }
56
57
  public getLastName(): string | null {
58
    return this.lastName;
59
  }
60
61
  public getCompany(): string | null {
62
    return this.company;
63
  }
64
65
  public getEmail(): string | null {
66
    return this.email;
67
  }
68
69
  public getPhoneNumber(): string {
70
    return this.phoneNumber;
71
  }
72
73
  public getNotes(): string {
74
    return this.notes;
75
  }
76
}
77