user.js 1.75 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
18
19
20
    getEmail() {
        return this.email
    }
Rosanny Sihombing's avatar
Rosanny Sihombing committed
21
    getFullName() {
Rosanny Sihombing's avatar
Rosanny Sihombing committed
22
23
        return this.firstName+' '+this.lastName
    }
Rosanny Sihombing's avatar
Rosanny Sihombing committed
24
25
26
27
28
29
    getIdpStatus() {
        return this.is_m4lab_idp
    }
    getGitlabUserId() {
        return this.gitlabUserId
    }
30
31
32
    getVerificationStatus() {
        return this.verificationStatus
    }
Rosanny Sihombing's avatar
Rosanny Sihombing committed
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
    // 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
67
68
69
}

module.exports = User