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

export class UpdateCertificationDto {
  @ApiProperty({ example: 'AWS Solutions Architect Professional', required: false })
  @IsOptional()
  @IsString()
  @MaxLength(300)
  title?: string;

  @ApiProperty({ example: 'Amazon Web Services', required: false })
  @IsOptional()
  @IsString()
  @MaxLength(300)
  issuingBody?: string;

  @ApiProperty({ example: 'https://aws.amazon.com/certification/', required: false })
  @IsOptional()
  @IsString()
  @MaxLength(500)
  @IsUrl({}, { message: 'Bitte eine gültige URL angeben' })
  website?: string;

  @ApiProperty({ example: 2024, required: false })
  @IsOptional()
  @IsInt()
  @Min(1970)
  @Max(2100)
  issueYear?: number;
}
