import { IsString, IsOptional, MinLength, MaxLength, Matches } from "class-validator";

/**
 * DTO for updating a knowledge tag
 */
export class UpdateTagDto {
  @IsOptional()
  @IsString({ message: "name must be a string" })
  @MinLength(1, { message: "name must not be empty" })
  @MaxLength(100, { message: "name must not exceed 100 characters" })
  name?: string;

  @IsOptional()
  @IsString({ message: "color must be a string" })
  @Matches(/^#[0-9A-Fa-f]{6}$/, {
    message: "color must be a valid hex color (e.g., #FF5733)",
  })
  color?: string;

  @IsOptional()
  @IsString({ message: "description must be a string" })
  @MaxLength(500, { message: "description must not exceed 500 characters" })
  description?: string;
}
