Skip to content

SudoSOS Back-end API / users / User

Class: User ​

Inactive (active: false): the user can only log in and top up their balance. Intended for e.g. alumni who have graduated but still have an outstanding debt.

Soft-deleted (deleted: true): the account is archived but the database record is preserved for transaction history. A user can only be soft-deleted once their balance is exactly €0.00; otherwise the account should first be set to inactive.

Extends ​

Constructors ​

Constructor ​

ts
new User(): User;

Returns ​

User

Inherited from ​

BaseEntity.constructor

Properties ​

PropertyModifierTypeDescriptionInherited from
acceptedToSpublicTermsOfServiceStatus--
activepublicbooleanWhether the user is active. Defaults to false.-
canGoIntoDebtpublicbooleanWhether the user can have a negative balance. Defaults to false-
createdAtreadonlyDateThe creation date of the object.BaseEntity.createdAt
currentFines?publicUserFineGroup--
deletedpublicbooleanWhether the user was soft-deleted. Defaults to false.-
directAssignedRolespublicAssignedRole[]--
emailpublicstringThe email of the user.-
extensiveDataProcessingpublicboolean--
firstNamepublicstring--
idreadonlynumber-BaseEntity.id
inactiveNotificationSendpublicboolean--
lastNamepublicstringLast name of the user.-
lastSeenpublicDate--
memberUser?publicMemberUser--
nicknamepublicstringNickname of the user.-
ofAgepublicbooleanWhether the user is 18+ or not.-
pointOfSale?publicPointOfSale--
typepublicUserType--
updatedAtreadonlyDateThe last update date of the object.BaseEntity.updatedAt
versionreadonlynumberThe current version of the object.BaseEntity.version

Methods ​

fullName() ​

ts
fullName(): string;

Returns ​

string


toString() ​

ts
toString(): string;

Returns a string representation of an object.

Returns ​

string


fullName() ​

ts
static fullName(user): string;

Get the full name of the given user. Separate static method, as user objects taken from tokens do not have any class methods.

Parameters ​

ParameterTypeDescription
userUser-

Returns ​

string