Passed
Pull Request — master (#89)
by Mathieu
01:44
created

File.getPassword   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} from 'typeorm';
2
3
@Entity()
4
export class File {
5
  @PrimaryGeneratedColumn('uuid')
6
  private id: string;
7
8
  @Column({type: 'varchar', nullable: false})
9
  private name: string;
10
11
  @Column({type: 'integer', nullable: false})
12
  private size: number;
13
14
  @Column({type: 'varchar', nullable: false})
15
  private mimeType: string;
16
17
  @Column({type: 'varchar', nullable: false})
18
  private password: string;
19
20
  @Column({type: 'timestamp', default: () => 'CURRENT_TIMESTAMP'})
21
  private uploadedAt: Date;
22
23
  constructor(name: string, size: number, mimeType: string, password: string) {
24
    this.name = name;
25
    this.size = size;
26
    this.mimeType = mimeType;
27
    this.password = password;
28
  }
29
30
  public getId(): string {
31
    return this.id;
32
  }
33
34
  public getName(): string {
35
    return this.name;
36
  }
37
38
  public getSize(): number {
39
    return this.size;
40
  }
41
42
  public getMimeType(): string {
43
    return this.mimeType;
44
  }
45
46
  public getPassword(): string {
47
    return this.password;
48
  }
49
}
50