31 lines
456 B
TypeScript
31 lines
456 B
TypeScript
import {
|
|
IsEmail,
|
|
IsNotEmpty,
|
|
IsString,
|
|
MinLength,
|
|
IsOptional,
|
|
} from 'class-validator';
|
|
|
|
export class RegisterDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
username!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MinLength(6, { message: 'Password must be at least 6 characters' })
|
|
password!: string;
|
|
|
|
@IsEmail()
|
|
@IsNotEmpty()
|
|
email!: string;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
firstName?: string;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
lastName?: string;
|
|
}
|