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 ​
Properties ​
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
acceptedToS | public | TermsOfServiceStatus | - | - |
active | public | boolean | Whether the user is active. Defaults to false. | - |
canGoIntoDebt | public | boolean | Whether the user can have a negative balance. Defaults to false | - |
createdAt | readonly | Date | The creation date of the object. | BaseEntity.createdAt |
currentFines? | public | UserFineGroup | - | - |
deleted | public | boolean | Whether the user was soft-deleted. Defaults to false. | - |
directAssignedRoles | public | AssignedRole[] | - | - |
email | public | string | The email of the user. | - |
extensiveDataProcessing | public | boolean | - | - |
firstName | public | string | - | - |
id | readonly | number | - | BaseEntity.id |
inactiveNotificationSend | public | boolean | - | - |
lastName | public | string | Last name of the user. | - |
lastSeen | public | Date | - | - |
memberUser? | public | MemberUser | - | - |
nickname | public | string | Nickname of the user. | - |
ofAge | public | boolean | Whether the user is 18+ or not. | - |
pointOfSale? | public | PointOfSale | - | - |
type | public | UserType | - | - |
updatedAt | readonly | Date | The last update date of the object. | BaseEntity.updatedAt |
version | readonly | number | The 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 ​
| Parameter | Type | Description |
|---|---|---|
user | User | - |
Returns ​
string