An error occurred while loading the file. Please try again.
user.ts 2.57 KiB
class User {
  id: number
  email: string
  salutation: string // should be enum
  title: string // should be enum
  firstName: string
  lastName: string
  industry: string
  organisation: string
  speciality: string
  isM4labIdp: 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, isM4labIdp: 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.isM4labIdp = isM4labIdp
    this.verificationStatus = verificationStatus
    this.gitlabUserId = gitlabUserId
  // getter
  getId () {
    return this.id
  getEmail () {
    return this.email
  getFullName () {
    return this.firstName + ' ' + this.lastName
  getIdpStatus () {
    return this.isM4labIdp
  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 (m4labIdp: number) { this.isM4labIdp = m4labIdp } 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 } } export { User }