import { AbstractCommand } from "@twixtlabs/lambda-cqrs-poc"; import { Type } from "class-transformer"; import { IsNotEmpty, IsString, IsNumber, IsNotEmptyObject, ValidateNested } from "class-validator"; import { ConversationCommand } from "./ConversationCommand"; import { MessageContentVO } from "../../common/command/MessageContentVO"; export class ReplyToConversationCommand extends ConversationCommand { static readonly commandName = "ReplyToConversationCommand"; @IsString() @IsNotEmpty() readonly replierId: string; @IsNotEmptyObject() @ValidateNested() @Type(() => MessageContentVO) readonly messageContent: MessageContentVO; constructor({ tenantId, conversationId, replierId, messageContent, }: { tenantId: string; conversationId: string; replierId:string; messageContent:MessageContentVO }) { super({ commandName: ReplyToConversationCommand.commandName, tenantId, conversationId, }); this.replierId =replierId; this.messageContent = messageContent; } }