import { IsDefined, IsString, IsNotEmpty, IsOptional, IsEnum } from "class-validator";
import { ApiProperty } from "@nestjs/swagger";

enum type {
  'phone' = 'phone',
  'email' = 'email'
}

export class VerifyUserAccountDto {
  @ApiProperty({
    example: "phone",
    description: "Group By (phone / email)",
    required: true
  })
  @IsDefined()
  @IsNotEmpty()
  @IsEnum(type)
  type?: type;

  @ApiProperty({ example: "" })
  @IsDefined()
  @IsOptional()
  @IsString()
  email: string;

  @ApiProperty({ example: "083333333333" })
  @IsDefined()
  @IsOptional()
  @IsString()
  phone: string;

  @ApiProperty({ example: "" })
  @IsDefined()
  @IsNotEmpty()
  @IsString()
  code: string;
}
