create ticket
This commit is contained in:
@@ -5,47 +5,16 @@ import { TicketMessageEnum, UserMessage } from "../../../common/enums/message.en
|
||||
|
||||
|
||||
export class CreateTicketDto {
|
||||
// @IsNotEmpty({ message: TicketMessageEnum.TITLE_REQUIRED })
|
||||
// @IsString({ message: TicketMessageEnum.TITLE_STRING })
|
||||
// @Length(3, 150, { message: TicketMessageEnum.TITLE_LENGTH })
|
||||
// @ApiProperty({ description: "The ticket title", example: "Test title" })
|
||||
// title: string;
|
||||
|
||||
@IsNotEmpty({ message: TicketMessageEnum.SUBJECT_REQUIRED })
|
||||
@IsString({ message: TicketMessageEnum.SUBJECT_STRING })
|
||||
@Length(3, 150, { message: TicketMessageEnum.SUBJECT_LENGTH })
|
||||
@ApiProperty({ description: "Subject of the ticket", example: "Subject" })
|
||||
subject: string;
|
||||
|
||||
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: TicketMessageEnum.DANAK_SERVICE_ID_REQUIRED })
|
||||
@IsUUID("4", { message: TicketMessageEnum.DANAK_SERVICE_ID_SHOULD_BE_UUID })
|
||||
@ApiProperty({ description: "Service ID related to the ticket", example: "550e8400-e29b-41d4-a716-446655440000" })
|
||||
danakServiceId?: string;
|
||||
|
||||
@IsNotEmpty({ message: TicketMessageEnum.CATEGORY_ID_REQUIRED })
|
||||
@IsUUID("4", { message: TicketMessageEnum.CATEGORY_ID_SHOULD_BE_UUID })
|
||||
@ApiProperty({ description: "Category ID of the ticket", example: "123e4567-e89b-12d3-a456-426614174000" })
|
||||
categoryId: string;
|
||||
|
||||
@IsNotEmpty({ message: TicketMessageEnum.MESSAGE_REQUIRED })
|
||||
@IsString({ message: TicketMessageEnum.MESSAGE_STRING })
|
||||
@Length(5, 5000, { message: TicketMessageEnum.MESSAGE_LENGTH })
|
||||
@ApiProperty({ description: "The message content of the ticket", example: "This is a detailed description of the issue." })
|
||||
message: string;
|
||||
@ApiProperty({ description: "The message content of the ticket" })
|
||||
content: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsNotEmpty({ message: TicketMessageEnum.ATTACHMENT_REQUIRED })
|
||||
@ArrayMinSize(1, { message: TicketMessageEnum.ATTACHMENT_REQUIRED })
|
||||
@IsUrl({ protocols: ["http", "https"], require_protocol: true }, { each: true, message: TicketMessageEnum.ATTACHMENT_SHOULD_BE_URL })
|
||||
@ApiProperty({ description: "attachment url", example: ["https://example.com/test.png"] })
|
||||
attachmentUrls?: string[];
|
||||
attachments?: string[];
|
||||
}
|
||||
|
||||
export class CreateTicketByAdminDto extends CreateTicketDto {
|
||||
@IsNotEmpty({ message: "UserMessage.USER_ID_REQUIRED" })
|
||||
@IsUUID("4", { message:" UserMessage.USER_ID_SHOULD_BE_A_UUID" })
|
||||
@ApiProperty({ description: "User ID of the ticket", example: "123e4567-e89b-12d3-a456-426614174000" })
|
||||
userId: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user