42 lines
1.1 KiB
TypeScript
Executable File
42 lines
1.1 KiB
TypeScript
Executable File
import { IsEmail, IsString, MinLength, IsOptional, IsNumber } from 'class-validator';
|
|
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
|
|
|
|
export class RegisterDto {
|
|
@ApiProperty({ description: 'Email address', example: 'john.doe@example.com' })
|
|
@IsEmail()
|
|
email: string;
|
|
|
|
@ApiProperty({ description: 'Password (minimum 8 characters)', example: 'SecurePass123!' })
|
|
@IsString()
|
|
@MinLength(8)
|
|
password: string;
|
|
|
|
@ApiProperty({ description: 'First name', example: 'John' })
|
|
@IsString()
|
|
firstName: string;
|
|
|
|
@ApiProperty({ description: 'Last name', example: 'Doe' })
|
|
@IsString()
|
|
lastName: string;
|
|
|
|
@ApiPropertyOptional({ description: 'Phone number', example: '+1234567890' })
|
|
@IsOptional()
|
|
@IsString()
|
|
phone?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'Country ID', example: 1 })
|
|
@IsOptional()
|
|
@IsNumber()
|
|
countryId?: number;
|
|
|
|
@ApiPropertyOptional({ description: 'Preferred language', example: 'en' })
|
|
@IsOptional()
|
|
@IsString()
|
|
preferredLanguage?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'Preferred currency', example: 'USD' })
|
|
@IsOptional()
|
|
@IsString()
|
|
preferredCurrency?: string;
|
|
}
|