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

export class CreateCertificationDto {
  @ApiProperty({ example: 'AWS Solutions Architect Professional' })
  @IsString()
  @IsNotEmpty({ message: 'Titel ist erforderlich' })
  @MaxLength(300)
  title!: string;

  @ApiProperty({ example: 'Amazon Web Services' })
  @IsString()
  @IsNotEmpty({ message: 'Zertifizierungsstelle ist erforderlich' })
  @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, description: 'Ausstellungsjahr' })
  @IsInt()
  @Min(1970)
  @Max(2100)
  issueYear!: number;
}
