import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import {
  IsString,
  IsOptional,
  IsInt,
  Min,
  Max,
  IsDateString,
  MaxLength,
} from 'class-validator';

/**
 * DTO for creating a skill matrix entry (assessment)
 */
export class CreateSkillEntryDto {
  @ApiProperty({
    description: 'Employee ID being assessed',
    example: 'clx123abc',
  })
  @IsString()
  employeeId: string;

  @ApiProperty({
    description: 'Skill ID being assessed',
    example: 'clx456def',
  })
  @IsString()
  skillId: string;

  @ApiProperty({
    description: 'Skill level (0-4): 0=None, 1=Basic, 2=Independent, 3=Expert, 4=Trainer',
    example: 2,
    minimum: 0,
    maximum: 4,
  })
  @IsInt()
  @Min(0)
  @Max(4)
  level: number;

  @ApiPropertyOptional({
    description: 'Assessment notes',
    example: 'Good progress, needs more practice with aluminum',
    maxLength: 1000,
  })
  @IsOptional()
  @IsString()
  @MaxLength(1000)
  notes?: string;

  @ApiPropertyOptional({
    description: 'Date for next review',
    example: '2024-06-15',
  })
  @IsOptional()
  @IsDateString()
  nextReview?: string;
}
