From 62593c75b1cec092e612e087f63b8d0234b93746 Mon Sep 17 00:00:00 2001 From: Artem Niehrieiev Date: Fri, 30 Jan 2026 13:07:48 +0000 Subject: [PATCH 1/2] feat: enhance API properties for user AI chat and messages response objects --- .../response-objects/user-ai-chat.ro.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/src/entities/ai/ai-conversation-history/application/response-objects/user-ai-chat.ro.ts b/backend/src/entities/ai/ai-conversation-history/application/response-objects/user-ai-chat.ro.ts index d527c14f9..17a5d80d9 100644 --- a/backend/src/entities/ai/ai-conversation-history/application/response-objects/user-ai-chat.ro.ts +++ b/backend/src/entities/ai/ai-conversation-history/application/response-objects/user-ai-chat.ro.ts @@ -1,19 +1,35 @@ +import { ApiProperty } from '@nestjs/swagger'; import { MessageRole } from '../../ai-chat-messages/message-role.enum.js'; export class AiChatMessageRO { + @ApiProperty({ description: 'Unique message identifier' }) id: string; + + @ApiProperty({ description: 'Message content' }) message: string; + + @ApiProperty({ enum: MessageRole, description: 'Role of the message sender (user or ai)' }) role: MessageRole; + + @ApiProperty({ description: 'Message creation timestamp' }) created_at: Date; } export class UserAiChatRO { + @ApiProperty({ description: 'Unique chat identifier' }) id: string; + + @ApiProperty({ description: 'Chat name' }) name: string; + + @ApiProperty({ description: 'Chat creation timestamp' }) created_at: Date; + + @ApiProperty({ description: 'Chat last update timestamp' }) updated_at: Date; } export class UserAiChatWithMessagesRO extends UserAiChatRO { + @ApiProperty({ type: [AiChatMessageRO], description: 'List of messages in the chat' }) messages: AiChatMessageRO[]; } From 065e0ac44df91222c9cb9c5d17e76ddb6af9daa2 Mon Sep 17 00:00:00 2001 From: Artem Niehrieiev Date: Fri, 30 Jan 2026 13:28:44 +0000 Subject: [PATCH 2/2] fix: correct ApiProperty type definition for messages in UserAiChatWithMessagesRO --- .../application/response-objects/user-ai-chat.ro.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/entities/ai/ai-conversation-history/application/response-objects/user-ai-chat.ro.ts b/backend/src/entities/ai/ai-conversation-history/application/response-objects/user-ai-chat.ro.ts index 17a5d80d9..c1d84da9e 100644 --- a/backend/src/entities/ai/ai-conversation-history/application/response-objects/user-ai-chat.ro.ts +++ b/backend/src/entities/ai/ai-conversation-history/application/response-objects/user-ai-chat.ro.ts @@ -30,6 +30,6 @@ export class UserAiChatRO { } export class UserAiChatWithMessagesRO extends UserAiChatRO { - @ApiProperty({ type: [AiChatMessageRO], description: 'List of messages in the chat' }) + @ApiProperty({ type: AiChatMessageRO, isArray: true, description: 'List of messages in the chat' }) messages: AiChatMessageRO[]; }