import { IsNotEmpty, IsArray, IsOptional, IsString, IsBoolean, ArrayMinSize } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';

/**
 * DTO for bulk removing program access for multiple users
 */
export class BulkRemoveProgramAccessDto {
  @ApiProperty({
    description: 'Array of user IDs to remove access for',
    type: [Number],
    example: [101, 205, 321],
  })
  @IsNotEmpty()
  @IsArray()
  @ArrayMinSize(1)
  @Type(() => Number)
  userIds: number[];

  @ApiPropertyOptional({
    description: 'Reason for removing access',
    example: 'Bulk access removal - program ended',
  })
  @IsOptional()
  @IsString()
  reason?: string;

  @ApiPropertyOptional({
    description: 'Whether to also soft delete existing registrations for these users',
    default: false,
    example: true,
  })
  @IsOptional()
  @IsBoolean()
  @Type(() => Boolean)
  cascadeDeleteRegistrations?: boolean = false;
}
