feat: add payment module and factory
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { ApiProperty } from "@nestjs/swagger";
|
||||
import { IsEnum, IsNotEmpty, IsOptional, IsString, IsUUID, Length } from "class-validator";
|
||||
import { ArrayMinSize, IsEnum, IsNotEmpty, IsOptional, IsString, IsUUID, IsUrl, 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.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 })
|
||||
@@ -22,11 +22,11 @@ export class CreateTicketDto {
|
||||
@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;
|
||||
// @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 })
|
||||
@@ -38,4 +38,11 @@ export class CreateTicketDto {
|
||||
@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;
|
||||
|
||||
@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[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user