From 6a2e0eb0452d66ab8ea6397543c049d1bf3d7f16 Mon Sep 17 00:00:00 2001 From: WT-March Date: Sun, 31 May 2026 11:00:42 +0100 Subject: [PATCH] fix(message): allow bulk message media content properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BulkMessageContentDto declared image/video/audio/document without any class-validator decorator. With the global ValidationPipe set to forbidNonWhitelisted, these undecorated properties were treated as non-whitelisted, so every send-bulk request was rejected with "property image should not exist" — even plain text batches that never included a media key. Add @IsOptional() to image/video/audio/document so they are whitelisted optional properties. Text and media bulk sends now validate correctly. Co-Authored-By: Claude Opus 4.8 --- src/modules/message/dto/bulk-message.dto.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/message/dto/bulk-message.dto.ts b/src/modules/message/dto/bulk-message.dto.ts index 5659de3d..1fe8f68c 100644 --- a/src/modules/message/dto/bulk-message.dto.ts +++ b/src/modules/message/dto/bulk-message.dto.ts @@ -19,15 +19,19 @@ class BulkMessageContentDto { text?: string; @ApiPropertyOptional({ description: 'Image URL or base64' }) + @IsOptional() image?: { url?: string; base64?: string; mimetype?: string }; @ApiPropertyOptional({ description: 'Video URL or base64' }) + @IsOptional() video?: { url?: string; base64?: string; mimetype?: string }; @ApiPropertyOptional({ description: 'Audio URL or base64' }) + @IsOptional() audio?: { url?: string; base64?: string; mimetype?: string }; @ApiPropertyOptional({ description: 'Document URL or base64' }) + @IsOptional() document?: { url?: string; base64?: string; mimetype?: string; filename?: string }; @ApiPropertyOptional({ description: 'Caption for media messages' })