chore: complete ticket service but not tested
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { IsEnum, IsNotEmpty, IsOptional, IsString, IsUUID, Length } from "class-validator";
|
||||
|
||||
import { TicketMessageEnum } from "../../../common/enums/message.enum";
|
||||
import { TicketPriority } from "../enums/ticket-priority.enum";
|
||||
|
||||
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;
|
||||
|
||||
@IsNotEmpty({ message: TicketMessageEnum.PRIORITY_REQUIRED })
|
||||
@IsEnum(TicketPriority, { message: TicketMessageEnum.PRIORITY_INVALID })
|
||||
@ApiProperty({ enum: TicketPriority, example: TicketPriority.LOW, description: "LOW, MEDIUM, HIGH" })
|
||||
priority: TicketPriority;
|
||||
|
||||
@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, 500, { message: TicketMessageEnum.MESSAGE_LENGTH })
|
||||
@ApiProperty({ description: "The message content of the ticket", example: "This is a detailed description of the issue." })
|
||||
message: string;
|
||||
}
|
||||
Reference in New Issue
Block a user