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

export class ModerateListingDto {
  @ApiProperty({ enum: ['approve', 'reject'], example: 'approve', description: 'Moderation action' })
  @IsEnum(['approve', 'reject'] as const)
  action!: 'approve' | 'reject';

  @ApiPropertyOptional({ example: 85, description: 'Moderation confidence score (0-100)' })
  @IsOptional()
  @IsNumber()
  @Type(() => Number)
  @Min(0)
  @Max(100)
  moderationScore?: number;

  @ApiPropertyOptional({ example: 'Tin đăng hợp lệ, thông tin chính xác', description: 'Moderator notes' })
  @IsOptional()
  @IsString()
  notes?: string;
}
