import { ApiPropertyOptional } from '@nestjs/swagger';
import { VisitorRiskLevel } from '@prisma/client';
import { IsBoolean, IsEnum, IsInt, IsOptional, IsString, Max, Min } from 'class-validator';

export class UpdateVisitorRiskDto {
  @ApiPropertyOptional({ example: 78, description: 'Risk score from 0 to 100.' })
  @IsOptional()
  @IsInt()
  @Min(0)
  @Max(100)
  riskScore?: number;

  @ApiPropertyOptional({ enum: VisitorRiskLevel, example: VisitorRiskLevel.MEDIUM })
  @IsOptional()
  @IsEnum(VisitorRiskLevel)
  riskLevel?: VisitorRiskLevel;

  @ApiPropertyOptional({ example: true, description: 'Flag visitor for internal review.' })
  @IsOptional()
  @IsBoolean()
  flagged?: boolean;

  @ApiPropertyOptional({ example: false, description: 'Blacklist visitor from future access.' })
  @IsOptional()
  @IsBoolean()
  blacklisted?: boolean;

  @ApiPropertyOptional({ example: 'Multiple missed check-outs.', description: 'Internal risk note.' })
  @IsOptional()
  @IsString()
  riskNotes?: string;
}
