user.js 2.21 KB
Newer Older
Rosanny Sihombing's avatar
Rosanny Sihombing committed
1
class User {
Rosanny Sihombing's avatar
Rosanny Sihombing committed
2
    constructor(id, email, salutation, title, firstName, lastName, industry, organisation, speciality, is_m4lab_idp, gitlabUserId, verificationStatus) {
Rosanny Sihombing's avatar
Rosanny Sihombing committed
3
4
5
6
7
8
9
10
11
        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
Rosanny Sihombing's avatar
Rosanny Sihombing committed
12
        this.is_m4lab_idp = is_m4lab_idp // 1 or 0
Rosanny Sihombing's avatar
Rosanny Sihombing committed
13
14
15
16
17
        this.gitlabUserId = gitlabUserId
        this.verificationStatus = verificationStatus
    }

    // getter
Rosanny Sihombing's avatar
Rosanny Sihombing committed
18
19
20
    getId() {
        return this.id
    }
21
22
23
    getEmail() {
        return this.email
    }
Rosanny Sihombing's avatar
Rosanny Sihombing committed
24
    getFullName() {
Rosanny Sihombing's avatar
Rosanny Sihombing committed
25
26
        return this.firstName+' '+this.lastName
    }
Rosanny Sihombing's avatar
Rosanny Sihombing committed
27
28
29
30
31
32
    getIdpStatus() {
        return this.is_m4lab_idp
    }
    getGitlabUserId() {
        return this.gitlabUserId
    }
33
34
35
    getVerificationStatus() {
        return this.verificationStatus
    }
Rosanny Sihombing's avatar
Rosanny Sihombing committed
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
    // setter
    setEmail(email) {
        this.email = email
    }
    setSalutation(salutation) {
        this.salutation = salutation
    }
    setTitle(title) {
        this.title = title
    }
    setFirstName(firstName) {
        this.firstName = firstName
    }
    setLastName(lastName) {
        this.lastName = lastName
    }
    setIndustry(industry) {
        this.industry = industry
    }
    setOrganisation(organisation) {
        this.organisation = organisation
    }
    setSpeciality(speciality) {
        this.speciality = speciality
    }
    setM4lab_idp(m4lab_idp) {
        this.m4lab_idp = m4lab_idp
    }
    setGitlabUserId(newGitlabUserId) {
        this.gitlabUserId = newGitlabUserId
    }
    setVerificationStatus(verificationStatus) {
        this.verificationStatus = verificationStatus
    }
Rosanny Sihombing's avatar
Rosanny Sihombing committed
70
71
72
73
74
75
76
77
78
79
80

    updateProfile(newSalutation, newTitle, newFirstname, newLastname, newEmail, newOrganisation, newIndustry, newSpeciality) {
        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
81
82
83
}

module.exports = User