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

export class CreateApplicantDto {
  @ApiProperty({
    description: 'Email address of the applicant',
    example: 'john@example.com',
  })
  @IsEmail()
  email: string;

  @ApiProperty({
    description: 'DigiLocker ID of the applicant',
    example: '1234567890',
  })
  @IsString()
  @MinLength(6)
  digilockerId: string;

  @ApiProperty({
    description: 'First name of the applicant',
    example: 'John',
    required: false,
  })
  @IsOptional()
  @IsString()
  firstName?: string;

  @ApiProperty({
    description: 'Last name of the applicant',
    example: 'Doe',
    required: false,
  })
  @IsOptional()
  @IsString()
  lastName?: string;

  @ApiProperty({
    description: 'Department code to associate with applicant',
    example: 'DEPT001',
    required: false,
  })
  @IsOptional()
  @IsString()
  departmentCode?: string;

  @ApiProperty({
    description: 'Raw DigiLocker data (JSON stringified)',
    example: '{"name": "John Doe", "pan": "XXXXX..."}',
    required: false,
  })
  @IsOptional()
  @IsString()
  digilockerData?: string;
}
