File

src/chatbot/dto/userMessage.dto.ts

Index

Properties

Properties

Optional chatId
Type : number
Decorators :
@IsOptional()
@ApiPropertyOptional()
@IsNumber()
content
Type : MessageContent
Decorators :
@IsNotEmpty()
@ApiProperty()
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import {
  IsNotEmpty,
  IsNumber,
  IsOptional,
} from "class-validator";
import { MessageContent } from "../entities/message.entity";

export class UserMessage {
  @IsNotEmpty()
  @ApiProperty()
  content: MessageContent;

  @IsOptional()
  @ApiPropertyOptional()
  @IsNumber()
  chatId?: number;
}

export class MessageDto {
  content: MessageContent;
  userId: string;
  type: string;
  chatId: number;
  status: string;

  constructor(partial: Partial<MessageDto>) {
    Object.assign(this, partial);
  }
}

results matching ""

    No results matching ""