src/auth/dto/register.dto.ts
Properties |
Type : string
|
Decorators :
@ApiProperty({example: 'john@fleetcommand.com'})
|
|
Defined in src/auth/dto/register.dto.ts:16
|
| firstName |
Type : string
|
Decorators :
@ApiProperty({example: 'John'})
|
|
Defined in src/auth/dto/register.dto.ts:27
|
| inviteCode |
Type : string
|
Decorators :
@ApiProperty({example: 'FC-ADMIN-A1B2C3', description: 'Invite code provided by your administrator'})
|
|
Defined in src/auth/dto/register.dto.ts:37
|
| lastName |
Type : string
|
Decorators :
@ApiProperty({example: 'Doe'})
|
|
Defined in src/auth/dto/register.dto.ts:32
|
| password |
Type : string
|
Decorators :
@ApiProperty({example: 'securePassword123'})
|
|
Defined in src/auth/dto/register.dto.ts:22
|
| Optional phone |
Type : string
|
Decorators :
@ApiPropertyOptional()
|
|
Defined in src/auth/dto/register.dto.ts:42
|
import {
IsEmail,
IsNotEmpty,
IsString,
MinLength,
IsOptional,
IsEnum,
} from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { UserRole } from '@prisma/client';
export class RegisterDto {
@ApiProperty({ example: 'john@fleetcommand.com' })
@IsEmail()
@IsNotEmpty()
email: string;
@ApiProperty({ example: 'securePassword123' })
@IsString()
@IsNotEmpty()
@MinLength(6)
password: string;
@ApiProperty({ example: 'John' })
@IsString()
@IsNotEmpty()
firstName: string;
@ApiProperty({ example: 'Doe' })
@IsString()
@IsNotEmpty()
lastName: string;
@ApiProperty({ example: 'FC-ADMIN-A1B2C3', description: 'Invite code provided by your administrator' })
@IsString()
@IsNotEmpty({ message: 'Invite code is required to create an account' })
inviteCode: string;
@ApiPropertyOptional()
@IsOptional()
@IsString()
phone?: string;
}