import { Role } from '../roles/role.enum';
import { IsEmail, IsNotEmpty, IsOptional, IsString } from 'class-validator';

export class CreateUserDto {
  @IsNotEmpty()
  @IsString()
  @IsEmail()
  readonly email;

  @IsString()
  @IsOptional()
  readonly firstName;

  @IsString()
  @IsOptional()
  readonly lastName;

  @IsString()
  @IsOptional()
  readonly street;

  @IsString()
  @IsOptional()
  readonly stNumber;

  @IsString()
  @IsOptional()
  readonly postcode;

  @IsString()
  @IsOptional()
  readonly location;

  @IsString()
  @IsOptional()
  readonly phone;

  readonly role: Role;

  @IsNotEmpty()
  @IsString()
  readonly password;
}
