File

src/auth/dto/register.dto.ts

Index

Properties

Properties

email
Type : string
Decorators :
@ApiProperty({example: 'john@fleetcommand.com'})
@IsEmail()
@IsNotEmpty()
firstName
Type : string
Decorators :
@ApiProperty({example: 'John'})
@IsString()
@IsNotEmpty()
inviteCode
Type : string
Decorators :
@ApiProperty({example: 'FC-ADMIN-A1B2C3', description: 'Invite code provided by your administrator'})
@IsString()
@IsNotEmpty({message: 'Invite code is required to create an account'})
lastName
Type : string
Decorators :
@ApiProperty({example: 'Doe'})
@IsString()
@IsNotEmpty()
password
Type : string
Decorators :
@ApiProperty({example: 'securePassword123'})
@IsString()
@IsNotEmpty()
@MinLength(6)
Optional phone
Type : string
Decorators :
@ApiPropertyOptional()
@IsOptional()
@IsString()
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;
}

results matching ""

    No results matching ""