import { FormalityLevel } from "@prisma/client"; import { IsString, IsEnum, IsOptional, IsBoolean, MinLength, MaxLength } from "class-validator"; /** * DTO for updating an existing personality * All fields are optional; only provided fields are updated. */ export class UpdatePersonalityDto { @IsOptional() @IsString({ message: "name must be a string" }) @MinLength(1, { message: "name must not be empty" }) @MaxLength(255, { message: "name must not exceed 255 characters" }) name?: string; @IsOptional() @IsString({ message: "description must be a string" }) @MaxLength(2000, { message: "description must not exceed 2000 characters" }) description?: string; @IsOptional() @IsString({ message: "tone must be a string" }) @MinLength(1, { message: "tone must not be empty" }) @MaxLength(100, { message: "tone must not exceed 100 characters" }) tone?: string; @IsOptional() @IsEnum(FormalityLevel, { message: "formalityLevel must be a valid FormalityLevel" }) formalityLevel?: FormalityLevel; @IsOptional() @IsString({ message: "systemPromptTemplate must be a string" }) @MinLength(1, { message: "systemPromptTemplate must not be empty" }) systemPromptTemplate?: string; @IsOptional() @IsBoolean({ message: "isDefault must be a boolean" }) isDefault?: boolean; @IsOptional() @IsBoolean({ message: "isActive must be a boolean" }) isActive?: boolean; }