21 lines
370 B
TypeScript
21 lines
370 B
TypeScript
import { IsEmail, IsEnum, IsOptional, IsString, MinLength } from 'class-validator';
|
|
import { UserRole } from '../entities/user.entity';
|
|
|
|
export class CreateUserDto {
|
|
@IsEmail()
|
|
email: string;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
name?: string;
|
|
|
|
@IsEnum(UserRole)
|
|
@IsOptional()
|
|
role?: UserRole;
|
|
|
|
@IsString()
|
|
@MinLength(8)
|
|
@IsOptional()
|
|
password?: string;
|
|
}
|