- CommentAttachment link table (comment <-> file) + migration - fileIds in create/update comment; update replaces the whole set, synced in one transaction with the comment - CommentDto.attachments; empty for deleted comments - Soft delete drops attachments so GC can collect the files - Max 10 files per comment, ordered by upload time (uuid v7) - Registers comments as a file owner - Rename CommentAuthorExpanderService -> CommentExpanderService (expands authors and files) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19 lines
682 B
TypeScript
19 lines
682 B
TypeScript
import { ArrayMaxSize, IsArray, IsNotEmpty, IsOptional, IsString, MaxLength } from 'class-validator';
|
|
import { CommentContent } from '../../domain/value-objects/comment-content.vo.js';
|
|
import { Comment } from '../../domain/entities/comment.entity.js';
|
|
|
|
export class UpdateCommentRequestDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(CommentContent.MAX_LENGTH)
|
|
content: string;
|
|
|
|
/** id файлов, загруженных через POST /files — набор целиком; не передан — не менять */
|
|
@IsOptional()
|
|
@IsArray()
|
|
@ArrayMaxSize(Comment.MAX_ATTACHMENTS)
|
|
@IsString({ each: true })
|
|
@MaxLength(64, { each: true })
|
|
fileIds?: string[];
|
|
}
|