user.ts 2.58 KB
Newer Older
Rosanny Sihombing's avatar
Rosanny Sihombing committed
1
class User {
Rosanny Sihombing's avatar
Rosanny Sihombing committed
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
  id: number
  email: string
  salutation: string // should be enum
  title: string // should be enum
  firstName: string
  lastName: string
  industry: string
  organisation: string
  speciality: string
  is_m4lab_idp: number // 1 or 0
  verificationStatus: number // 1 or 0 - // should be boolean
  gitlabUserId?: number

  constructor (id: number, email: string, salutation: string, title: string, firstName: string, lastName: string, industry: string, organisation: string,
    speciality: string, is_m4lab_idp: number, verificationStatus: number, gitlabUserId?: number) {
    this.id = id
    this.email = email
    this.salutation = salutation
    this.title = title
    this.firstName = firstName
    this.lastName = lastName
    this.industry = industry
    this.organisation = organisation
    this.speciality = speciality
    this.is_m4lab_idp = is_m4lab_idp
    this.verificationStatus = verificationStatus
    this.gitlabUserId = gitlabUserId
  }

  // getter
  getId () {
    return this.id
  }

  getEmail () {
    return this.email
  }

  getFullName () {
    return this.firstName + ' ' + this.lastName
  }

  getIdpStatus () {
    return this.is_m4lab_idp
  }

  getVerificationStatus () {
    return this.verificationStatus
  }

  getGitlabUserId () {
    return this.gitlabUserId
  }

  // setter
  setEmail (email: string) {
    this.email = email
  }

  setSalutation (salutation: string) {
    this.salutation = salutation
  }

  setTitle (title: string) {
    this.title = title
  }

  setFirstName (firstName: string) {
    this.firstName = firstName
  }

  setLastName (lastName: string) {
    this.lastName = lastName
  }

  setIndustry (industry: string) {
    this.industry = industry
  }

  setOrganisation (organisation: string) {
    this.organisation = organisation
  }

  setSpeciality (speciality: string) {
    this.speciality = speciality
  }

  setM4lab_idp (m4lab_idp: number) {
    this.is_m4lab_idp = m4lab_idp
  }

  setVerificationStatus (verificationStatus: number) {
    this.verificationStatus = verificationStatus
  }

  setGitlabUserId (newGitlabUserId: number) {
    this.gitlabUserId = newGitlabUserId
  }

  updateProfile (newSalutation: string, newTitle: string, newFirstname: string, newLastname: string, newEmail: string, newOrganisation: string, newIndustry: string, newSpeciality: string) {
    this.salutation = newSalutation
    this.title = newTitle
    this.firstName = newFirstname
    this.lastName = newLastname
    this.email = newEmail
    this.organisation = newOrganisation
    this.industry = newIndustry
    this.speciality = newSpeciality
  }
Rosanny Sihombing's avatar
Rosanny Sihombing committed
111
112
}

Rosanny Sihombing's avatar
Rosanny Sihombing committed
113
export = User