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

export class LoginDto {
  @ApiProperty({
    description: 'DigiLocker ID of the applicant',
    example: 'DL123456789',
  })
  @IsString()
  @IsNotEmpty({ message: 'DigiLocker ID is required' })
  @Length(10, 20, { message: 'DigiLocker ID must be between 10 and 20 characters' })
  digilockerId: string;

  @ApiProperty({
    description: '6-digit OTP sent to registered mobile',
    example: '123456',
  })
  @IsString()
  @IsNotEmpty({ message: 'OTP is required' })
  @Matches(/^\d{6}$/, { message: 'OTP must be a 6-digit number' })
  otp: string;
}
