first commit
This commit is contained in:
68
apps/api-gateway/src/dto/chat.dto.ts
Normal file
68
apps/api-gateway/src/dto/chat.dto.ts
Normal file
@@ -0,0 +1,68 @@
|
||||
import { IsArray, IsBoolean, IsIn, IsOptional, IsString, MinLength } from 'class-validator';
|
||||
|
||||
export class CreateChatRoomDto {
|
||||
@IsString()
|
||||
@MinLength(1)
|
||||
name!: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
memberUserIds?: string[];
|
||||
}
|
||||
|
||||
export class UpdateChatRoomDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MinLength(1)
|
||||
name?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsBoolean()
|
||||
notificationsMuted?: boolean;
|
||||
}
|
||||
|
||||
export class SendChatMessageDto {
|
||||
@IsString()
|
||||
@IsIn(['TEXT', 'IMAGE', 'AUDIO', 'VOICE', 'FILE', 'EMOJI', 'POLL'])
|
||||
type!: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
content?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
replyToId?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
storageKey?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
mimeType?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
metadataJson?: string;
|
||||
|
||||
@IsOptional()
|
||||
poll?: {
|
||||
question: string;
|
||||
options: string[];
|
||||
allowsMultiple?: boolean;
|
||||
isAnonymous?: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
export class VotePollDto {
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
optionIds!: string[];
|
||||
}
|
||||
|
||||
export class SetRoomNotificationsMutedDto {
|
||||
@IsBoolean()
|
||||
muted!: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user