import { Type } from "class-transformer"; import { IsNotEmpty, IsNotEmptyObject, IsString, ValidateNested } from "class-validator"; import { MessageContentVO } from "../../common/command/MessageContentVO"; export class IncomingMessageVO { @IsString() @IsNotEmpty() readonly messageId:string; @IsString() @IsNotEmpty() readonly channelUserId: string; @IsString() @IsNotEmpty() readonly channelId: string; @IsString() @IsNotEmpty() readonly platform: string; @IsNotEmptyObject() @ValidateNested() @Type(()=>MessageContentVO) readonly messageContent: MessageContentVO; constructor({ messageId, channelUserId, channelId, platform, messageContent }:{ messageId:string; channelUserId:string; channelId:string; platform:string; messageContent:MessageContentVO }){ this.messageId=messageId; this.channelUserId=channelUserId; this.platform=platform; this.channelId = channelId; this.messageContent = messageContent; } }