File
|
company_id
|
Type : number
|
Decorators :
@Expose() @IsInt() @IsNotEmpty()
|
|
|
|
email
|
Type : string
|
Decorators :
@Expose() @Transform( => ) @IsEmail() @IsNotEmpty()
|
|
|
|
Optional
email_verified
|
Type : boolean
|
Decorators :
@Expose() @IsBoolean() @IsOptional()
|
|
|
|
first_name
|
Type : string
|
Decorators :
@Expose() @IsString() @IsNotEmpty()
|
|
|
|
last_name
|
Type : string
|
Decorators :
@Expose() @IsString() @IsNotEmpty()
|
|
|
|
password
|
Type : string
|
Decorators :
@Expose() @IsString() @MinLength(8) @IsNotEmpty()
|
|
|
|
Optional
phone
|
Type : string
|
Decorators :
@Expose() @IsString() @IsOptional() @Matches(/^\+?[\d\s]+$/, {message: 'Phone number can only contain digits, spaces, and an optional plus (+) symbol for country code'})
|
|
|
import { IsBoolean, IsEmail, IsInt, IsNotEmpty, IsOptional, IsString, Matches, MinLength } from "class-validator";
import { Exclude, Expose, Transform } from "class-transformer";
@Exclude()
export class ParticipantSignUpDto {
@Expose()
@IsInt()
@IsNotEmpty()
company_id!: number;
@Expose()
@IsString()
@IsNotEmpty()
first_name!: string;
@Expose()
@IsString()
@IsNotEmpty()
last_name!: string;
@Expose()
@Transform(({ value }) => (typeof value === "string" ? value.trim().toLowerCase() : value))
@IsEmail()
@IsNotEmpty()
email!: string;
@Expose()
@IsString()
@IsOptional()
@Matches(/^\+?[\d\s]+$/, {
message: "Phone number can only contain digits, spaces, and an optional plus (+) symbol for country code",
})
phone?: string;
@Expose()
@IsString()
@MinLength(8)
@IsNotEmpty()
password!: string;
@Expose()
@IsBoolean()
@IsOptional()
email_verified?: boolean;
}