src/chatbot/dto/chat.dto.ts
PartialType(ChatDto)
Properties |
| Optional status |
Type : string
|
Decorators :
@IsOptional()
|
|
Defined in src/chatbot/dto/chat.dto.ts:24
|
| Optional summary |
Type : string
|
Decorators :
@IsOptional()
|
|
Defined in src/chatbot/dto/chat.dto.ts:29
|
| Optional title |
Type : string
|
Decorators :
@IsOptional()
|
|
Defined in src/chatbot/dto/chat.dto.ts:20
|
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;
}