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

/**
 * DTO for creating a new skill
 */
export class CreateSkillDto {
  @ApiProperty({
    description: 'Name of the skill',
    example: 'Schweißen (WIG)',
    minLength: 2,
    maxLength: 100,
  })
  @IsString()
  @MinLength(2)
  @MaxLength(100)
  name: string;

  @ApiPropertyOptional({
    description: 'Detailed description of the skill',
    example: 'WIG-Schweißverfahren für Edelstahl und Aluminium',
    maxLength: 500,
  })
  @IsOptional()
  @IsString()
  @MaxLength(500)
  description?: string;

  @ApiPropertyOptional({
    description: 'Category of the skill',
    example: 'technical',
    enum: ['technical', 'softSkills', 'processes', 'safety', 'quality'],
  })
  @IsOptional()
  @IsString()
  category?: string;

  @ApiPropertyOptional({
    description: 'Department ID (null for company-wide skills)',
    example: 'clx123abc',
  })
  @IsOptional()
  @IsString()
  departmentId?: string;

  @ApiPropertyOptional({
    description: 'Target skill level for the department (0-4)',
    example: 2,
    minimum: 0,
    maximum: 4,
  })
  @IsOptional()
  @IsInt()
  @Min(0)
  @Max(4)
  targetLevel?: number;

  @ApiPropertyOptional({
    description: 'Whether the skill is active',
    default: true,
  })
  @IsOptional()
  @IsBoolean()
  isActive?: boolean;
}
