Files
CRM_Montzar/apps/api/src/conversations/dto.ts
T

65 lines
1017 B
TypeScript
Raw Normal View History

import {
IsArray,
IsOptional,
IsString,
MaxLength,
MinLength,
ArrayMinSize,
ArrayMaxSize,
} from 'class-validator';
export class UpdateConversationSettingsDto {
@IsString()
@MinLength(3)
@MaxLength(200)
chatHost!: string;
@IsOptional()
@IsString()
@MinLength(8)
@MaxLength(500)
apiKey?: string;
@IsOptional()
@IsString()
@MaxLength(500)
uploadUrl?: string;
@IsOptional()
@IsString()
@MaxLength(500)
downloadUrl?: string;
}
export class CreateConversationDmDto {
@IsString()
@MinLength(1)
peerUserId!: string;
}
export class CreateConversationGroupDto {
@IsString()
@MinLength(2)
@MaxLength(120)
name!: string;
@IsArray()
@ArrayMinSize(1)
@ArrayMaxSize(50)
@IsString({ each: true })
memberUserIds!: string[];
}
export class HideConversationMessagesDto {
@IsString()
@MinLength(1)
@MaxLength(200)
externalRoomId!: string;
@IsArray()
@ArrayMinSize(1)
@ArrayMaxSize(100)
@IsString({ each: true })
messageIds!: string[];
}