import { IsIn, IsNotEmpty, IsString, Length, MinLength, Matches } from 'class-validator';

export class ResetPasswordDto {
    @IsIn(['email', 'phone'])
    channel!: 'email' | 'phone';

    @IsString()
    @IsNotEmpty()
    value!: string;

    @IsString()
    @Length(6, 6)
    otp!: string;

    @IsString()
    @MinLength(8)
    @Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*(),.?":{}|<>]).{8,}$/, {
        message: 'Password must contain at least one uppercase letter, one lowercase letter, one number, and one special character',
    })
    newPassword!: string;
}
