import { IsString, IsOptional, IsEnum, IsInt } from 'class-validator'; import { CredentialType } from '@prisma/client'; export class CreateCredentialDto { @IsString() name: string; @IsString() @IsOptional() username?: string; @IsString() @IsOptional() domain?: string; @IsEnum(CredentialType) type: CredentialType; @IsString() @IsOptional() password?: string; // plaintext — encrypted before storage @IsInt() @IsOptional() sshKeyId?: number; }