import { IsEmail, IsNotEmpty, MinLength, IsString, Matches, IsPhoneNumber } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class PhoneCheckDto {
  @ApiProperty({ description: 'Phone number to check for breaches' })
  @IsString({ message: 'Phone must be a string' })
  @IsNotEmpty({ message: 'Phone is required' })
  @Matches(/^\+?[0-9\s\-\(\)]{7,}$/, {
    message: 'Please provide a valid phone number',
  })
  phone: string;
}

// DTO for email check request
export class EmailCheckDto {
  @ApiProperty({ description: 'Email to check for breaches' })
  @IsEmail({}, { message: 'Please provide a valid email address' })
  @IsNotEmpty({ message: 'Email is required' })
  email: string;
}

// DTO for password check request
export class PasswordCheckDto {
  @ApiProperty({ description: 'Password to check for breaches' })
  @IsString({ message: 'Password must be a string' })
  @IsNotEmpty({ message: 'Password is required' })
  @MinLength(1, { message: 'Password cannot be empty' })
  password: string;
}
