Passed
Pull Request — master (#182)
by
unknown
01:35
created

MealTicketRemoval   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 31
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 4

4 Functions

Rating   Name   Duplication   Size   Complexity  
A getId 0 3 1
A getDate 0 3 1
A getUser 0 3 1
A getComment 0 3 1
1
import { Entity, Column, PrimaryGeneratedColumn, ManyToOne } from 'typeorm';
2
import { User } from '../User/User.entity';
3
4
@Entity()
5
export class MealTicketRemoval {
6
  @PrimaryGeneratedColumn('uuid')
7
  private id: string;
8
9
  @Column({ type: 'timestamp', nullable: false })
10
  private date: string;
11
12
  @Column({ type: 'varchar', nullable: false })
13
  private comment: string;
14
15
  @ManyToOne(type => User, { nullable: false, onDelete: 'CASCADE' })
16
  private user: User;
17
18
  constructor(date: string, comment: string, user: User) {
19
    this.date = date;
20
    this.comment = comment;
21
    this.user = user;
22
  }
23
24
  public getId(): string {
25
    return this.id;
26
  }
27
28
  public getDate(): string {
29
    return this.date;
30
  }
31
32
  public getComment(): string {
33
    return this.comment;
34
  }
35
36
  public getUser(): User {
37
    return this.user;
38
  }
39
}
40