import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsInt, IsNotEmpty, IsOptional, Max, Min } from 'class-validator';
import { Type } from 'class-transformer';

export class GenerateBulkQrDto {
  @ApiProperty({ description: 'Program ID — generates QRs for all eligible registrations in this program' })
  @IsInt()
  @IsNotEmpty()
  @Type(() => Number)
  programId: number;

  @ApiPropertyOptional({ description: 'Session ID to link all generated attendance records to a specific session' })
  @IsOptional()
  @IsInt()
  @Type(() => Number)
  sessionId?: number;

  @ApiPropertyOptional({ description: 'Registrations to process per batch (default: 10, max: 50)', default: 10 })
  @IsOptional()
  @IsInt()
  @Min(1)
  @Max(50)
  @Type(() => Number)
  batchSize?: number;
}
