File

src/chatbot/dto/chat.dto.ts

Extends

PartialType(ChatDto)

Index

Properties

Properties

Optional status
Type : string
Decorators :
@IsOptional()
@IsEnum(ChatStatus, {each: true})
Optional summary
Type : string
Decorators :
@IsOptional()
@IsString()
@ApiPropertyOptional()
Optional title
Type : string
Decorators :
@IsOptional()
@IsString()
@ApiPropertyOptional()
import { ApiPropertyOptional, PartialType } from "@nestjs/swagger";
import { IsEnum, IsOptional, IsString } from "class-validator";
import { ChatStatus } from "../entities/chat.entity";

export class ChatDto {
  title: string;
  userId: string;
  status: string;
  summary: string;

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

export class UpdateChatDto extends PartialType(ChatDto) {
  @IsOptional()
  @IsString()
  @ApiPropertyOptional()
  title?: string;

  @IsOptional()
  @IsEnum(ChatStatus, { each: true })
  status?: string;

  @IsOptional()
  @IsString()
  @ApiPropertyOptional()
  summary?: string;
}

results matching ""

    No results matching ""