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

export class VerifyMFACodeDto {
  @IsString()
  @IsNotEmpty()
  @Length(6, 8)
  @Matches(/^[0-9A-F]+$/i, {
    message: 'Code must contain only numbers or hexadecimal characters',
  })
  code: string;
}

export class SetupMFAMethodDto {
  @IsString()
  @IsNotEmpty()
  @IsIn(['totp', 'email'])
  method: 'totp' | 'email';
}

export class EnableTOTPDto {
  @IsString()
  @IsNotEmpty()
  @Length(6, 6)
  @Matches(/^[0-9]+$/, { message: 'Code must be 6 digits' })
  code: string;
}
