import { ApiPropertyOptional } from '@nestjs/swagger'; import { IsEnum, IsNotEmpty, IsOptional, IsString } from 'class-validator'; import { DocumentEntityType } from '../../../generated/prisma'; /** * A document filed against the wrong record can be re-linked instead of * deleted and uploaded again, and its display name corrected. The stored file * itself is not touched: replacing the content means uploading a new document. */ export class UpdateDocumentDto { @ApiPropertyOptional({ enum: DocumentEntityType }) @IsOptional() @IsEnum(DocumentEntityType) entityType?: DocumentEntityType; @ApiPropertyOptional() @IsOptional() @IsString() @IsNotEmpty() entityId?: string; @ApiPropertyOptional() @IsOptional() @IsString() @IsNotEmpty() fileName?: string; }