Code + comment cleanup for the response models

ref #39
This commit is contained in:
2020-12-20 19:38:22 +01:00
parent a85d52437b
commit 75332983c2
13 changed files with 83 additions and 91 deletions

View File

@@ -11,7 +11,7 @@ import { UserGroup } from '../entities/UserGroup';
import { ResponsePrincipal } from './ResponsePrincipal';
/**
* Defines a user response.
* Defines the user response.
*/
export class ResponseUser extends ResponsePrincipal {
/**
@@ -22,7 +22,6 @@ export class ResponseUser extends ResponsePrincipal {
/**
* The user's middle name.
* Optional.
*/
@IsString()
middlename?: string;
@@ -35,52 +34,53 @@ export class ResponseUser extends ResponsePrincipal {
/**
* The user's phone number.
* Optional.
*/
@IsString()
phone?: string;
/**
* The user's e-mail address.
* Optional.
*/
@IsString()
email?: string;
/**
* The user's username.
* Optional.
*/
@IsString()
username?: string;
/**
* is user enabled?
* Is user enabled?
*/
@IsBoolean()
enabled: boolean = true;
/**
* profilepic
* The user's profile pic.
*/
@IsString()
@IsOptional()
profilePic?: string;
/**
* Groups
* The groups that the user is a part of.
*/
@IsArray()
@IsOptional()
groups: UserGroup[];
/**
* permissions
* The user's permissions.
*/
@IsArray()
@IsOptional()
permissions: Permission[];
/**
* Creates a ResponseUser object from a user.
* @param user The user the response shall be build for.
*/
public constructor(user: User) {
super(user);
this.firstname = user.firstname;