1c4b986924
Co-authored-by: Cursor <cursoragent@cursor.com>
149 lines
2.7 KiB
TypeScript
149 lines
2.7 KiB
TypeScript
import { ArrayMinSize, IsArray, IsBoolean, IsIn, IsNotEmpty, IsOptional, IsString, MaxLength, ValidateIf, ValidateNested } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
import { IsInt, Min } from 'class-validator';
|
|
|
|
export class SupportTicketListQueryDto {
|
|
@IsOptional()
|
|
@IsIn(['BUG', 'SUGGESTION', 'OTHER'])
|
|
ticketType?: string;
|
|
|
|
@IsOptional()
|
|
@IsIn(['PENDING_REVIEW', 'REJECTED', 'DEVELOPING', 'TESTING', 'PASSED'])
|
|
status?: string;
|
|
|
|
@IsOptional()
|
|
@IsIn(['LOW', 'NORMAL', 'HIGH', 'URGENT'])
|
|
priority?: string;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
page?: number = 1;
|
|
|
|
@IsOptional()
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
pageSize?: number = 20;
|
|
}
|
|
|
|
export class CreateSupportTicketDto {
|
|
@IsIn(['BUG', 'SUGGESTION', 'OTHER'])
|
|
ticketType: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(128)
|
|
title: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
content?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(512)
|
|
remark?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
attachmentUrls?: string[];
|
|
|
|
@IsOptional()
|
|
@IsIn(['LOW', 'NORMAL', 'HIGH', 'URGENT'])
|
|
priority?: string;
|
|
}
|
|
|
|
export class UpdateSupportTicketDto {
|
|
@IsOptional()
|
|
@IsIn(['BUG', 'SUGGESTION', 'OTHER'])
|
|
ticketType?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(128)
|
|
title?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
content?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(512)
|
|
remark?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
attachmentUrls?: string[];
|
|
|
|
@IsOptional()
|
|
@IsIn(['LOW', 'NORMAL', 'HIGH', 'URGENT'])
|
|
priority?: string;
|
|
}
|
|
|
|
export class BatchUpdateSupportTicketStatusDto {
|
|
@IsArray()
|
|
@ArrayMinSize(1)
|
|
@IsString({ each: true })
|
|
ticketIds!: string[];
|
|
|
|
@IsIn(['PENDING_REVIEW', 'REJECTED', 'DEVELOPING', 'TESTING', 'PASSED'])
|
|
status!: string;
|
|
|
|
@ValidateIf((o: BatchUpdateSupportTicketStatusDto) => o.status === 'REJECTED')
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(512)
|
|
rejectReason?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(512)
|
|
note?: string;
|
|
}
|
|
|
|
export class BatchCreateSupportTicketTasksDto {
|
|
@IsArray()
|
|
@ArrayMinSize(1)
|
|
@IsString({ each: true })
|
|
ticketIds!: string[];
|
|
}
|
|
|
|
export class BatchPublishSupportTicketsDto {
|
|
@IsArray()
|
|
@ArrayMinSize(1)
|
|
@IsString({ each: true })
|
|
ticketIds!: string[];
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
versionId!: string;
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
dispatchToWecom?: boolean;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
dispatchSupplement?: string;
|
|
}
|
|
|
|
export class RejectSupportTicketDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
@MaxLength(512)
|
|
rejectReason: string;
|
|
}
|
|
|
|
export class SupportTicketRemarkDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@MaxLength(512)
|
|
remark?: string;
|
|
}
|