import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsArray, IsIn, IsOptional, IsString, ArrayMaxSize, ArrayMinSize, MinLength } from 'class-validator';

export class BulkModerateDto {
  @ApiProperty({ description: 'Array of listing IDs to moderate (1-50)', example: ['lst_abc123', 'lst_def456'], minItems: 1, maxItems: 50 })
  @IsArray()
  @IsString({ each: true })
  @ArrayMinSize(1)
  @ArrayMaxSize(50)
  listingIds!: string[];

  @ApiProperty({ description: 'Moderation action to apply', enum: ['approve', 'reject'], example: 'approve' })
  @IsIn(['approve', 'reject'])
  action!: 'approve' | 'reject';

  @ApiPropertyOptional({ description: 'Reason for the moderation action (min 5 chars, required for reject)', example: 'Batch approved after manual review', minLength: 5 })
  @IsOptional()
  @IsString()
  @MinLength(5)
  reason?: string;
}
