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
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.-
expiryDatepublicDateDate at which this account is scheduled to expire. When the date is in the past, the daily expiry CRON deactivates the user. Only set for local user types (see LocalUserTypes); null for all other user types.-
expiryNotificationSentpublicbooleanWhether the near-expiration warning email has already been sent to this user. Set to true after the daily notification CRON sends the 30-day warning so that the user is not re-notified each day during the warning window. Reset to false when expiryDate is changed via PATCH.-
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--
productSelfServicepublicbooleanWhether organ members can manage this organ's products and containers without BAC/GEWIS PM. Only meaningful for organ users. Defaults to false.-
tosRequiredpublicboolean--
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