import { ApiProperty } from '@nestjs/swagger';
import {
  IsNotEmpty,
  IsOptional,
  IsString,
  IsStrongPassword,
} from 'class-validator';

export class CreateUserDto {
  @IsNotEmpty()
  @IsString()
  @ApiProperty({ required: true, type: String, description: 'First name' })
  first_name: string;

  @IsOptional()
  @IsString()
  @ApiProperty({ required: false, type: String, description: 'Last name' })
  last_name: string;

  @IsNotEmpty()
  @IsString()
  @ApiProperty({ required: true, type: String, description: 'Phone number' })
  phone_number: string;

  @IsNotEmpty()
  @IsString()
  @ApiProperty({ required: true, type: String, description: 'Username' })
  username: string;

  @IsNotEmpty()
  @IsString()
  @IsStrongPassword()
  @ApiProperty({ required: true, type: String, description: 'Password' })
  password: string;

  @IsNotEmpty()
  @IsString()
  @ApiProperty({
    required: true,
    type: String,
    description: 'Re-enter password',
  })
  confirm_password: string;

  @IsNotEmpty()
  @IsString()
  @ApiProperty({ required: true, type: String, description: 'Country code' })
  country_phone_code: string;
}
