src/module/user/user.dto.ts
Properties |
Type : string
|
Decorators :
@IsEmail()
|
Defined in src/module/user/user.dto.ts:30
|
firstname |
Type : string
|
Decorators :
@IsString()
|
Defined in src/module/user/user.dto.ts:12
|
lastname |
Type : string
|
Decorators :
@IsString()
|
Defined in src/module/user/user.dto.ts:15
|
roles |
Type : Role[]
|
Decorators :
@IsArray()
|
Defined in src/module/user/user.dto.ts:27
|
tutorials |
Type : string[]
|
Decorators :
@IsArray()
|
Defined in src/module/user/user.dto.ts:19
|
tutorialsToCorrect |
Type : string[]
|
Decorators :
@IsArray()
|
Defined in src/module/user/user.dto.ts:23
|
username |
Type : string
|
Decorators :
@IsString()
|
Defined in src/module/user/user.dto.ts:33
|
import { ICreateUserDTO, INewPasswordDTO, IUserDTO } from 'shared/model/User';
import { IsArray, IsEmail, IsEnum, IsNotEmpty, IsString } from 'class-validator';
import { Role } from 'shared/model/Role';
export class PasswordDTO implements INewPasswordDTO {
@IsNotEmpty()
password!: string;
}
export class UserDTO implements IUserDTO {
@IsString()
firstname!: string;
@IsString()
lastname!: string;
@IsArray()
@IsString({ each: true })
tutorials!: string[];
@IsArray()
@IsString({ each: true })
tutorialsToCorrect!: string[];
@IsArray()
@IsEnum(Role, { each: true })
roles!: Role[];
@IsEmail()
email!: string;
@IsString()
username!: string;
}
export class CreateUserDTO extends UserDTO implements ICreateUserDTO {
@IsString()
password!: string;
}