4372018c09
Refund rollback, winery T+3, multi withdraw, mini-user store detail, dev plan batch edit and WeCom dispatch, support ticket edit/attachments/batch status, package imageUrl. Co-authored-by: Cursor <cursoragent@cursor.com>
196 lines
3.5 KiB
TypeScript
196 lines
3.5 KiB
TypeScript
import { ArrayMinSize, IsArray, IsBoolean, IsIn, IsNotEmpty, IsOptional, IsString, ValidateIf, ValidateNested } from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
import {
|
|
DEV_PLAN_TASK_STATUSES,
|
|
DEV_PLAN_TASK_TYPES,
|
|
DEV_PLAN_VERSION_STATUSES,
|
|
} from '@dukang/shared-types';
|
|
|
|
export class DevPlanTaskListQueryDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
status?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
type?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
keyword?: string;
|
|
|
|
@IsOptional()
|
|
page?: number;
|
|
|
|
@IsOptional()
|
|
pageSize?: number;
|
|
}
|
|
|
|
export class CreateDevPlanTaskDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
content!: string;
|
|
|
|
@IsIn(DEV_PLAN_TASK_TYPES)
|
|
type!: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
supportTicketId?: string;
|
|
}
|
|
|
|
export class UpdateDevPlanTaskDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
content?: string;
|
|
|
|
@IsOptional()
|
|
@IsIn(DEV_PLAN_TASK_TYPES)
|
|
type?: string;
|
|
|
|
@IsOptional()
|
|
@IsIn(DEV_PLAN_TASK_STATUSES)
|
|
status?: string;
|
|
}
|
|
|
|
export class CreateDevPlanVersionDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
versionNo!: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
content?: string;
|
|
|
|
@IsOptional()
|
|
@IsIn(DEV_PLAN_VERSION_STATUSES)
|
|
status?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
taskIds?: string[];
|
|
}
|
|
|
|
export class UpdateDevPlanVersionDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
versionNo?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
content?: string;
|
|
|
|
@IsOptional()
|
|
@IsIn(DEV_PLAN_VERSION_STATUSES)
|
|
status?: string;
|
|
|
|
@IsOptional()
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
taskIds?: string[];
|
|
}
|
|
|
|
export class ReplaceVersionTasksDto {
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
taskIds!: string[];
|
|
}
|
|
|
|
export class UpdateDevPlanSettingsDto {
|
|
@IsOptional()
|
|
@IsString()
|
|
reviewAssistantLlmConfigId?: string | null;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
reviewAssistantKnowledgeBaseId?: string | null;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
reviewAssistantPrompt?: string | null;
|
|
}
|
|
|
|
export class DevPlanTaskDispatchDto {
|
|
@IsArray()
|
|
@ArrayMinSize(1)
|
|
@IsString({ each: true })
|
|
taskIds!: string[];
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
supplement?: string;
|
|
}
|
|
|
|
export class DevPlanTaskFromTicketDto {
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
content!: string;
|
|
|
|
@IsIn(DEV_PLAN_TASK_TYPES)
|
|
type!: 'BUG' | 'REQUIREMENT' | 'OPTIMIZATION';
|
|
}
|
|
|
|
export class ReviewSupportTicketDto {
|
|
@IsIn(['APPROVE', 'REJECT'])
|
|
decision!: 'APPROVE' | 'REJECT';
|
|
|
|
@ValidateIf((o: ReviewSupportTicketDto) => o.decision === 'REJECT')
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
rejectReason?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
note?: string;
|
|
|
|
@ValidateIf((o: ReviewSupportTicketDto) => o.decision === 'APPROVE')
|
|
@IsArray()
|
|
@ArrayMinSize(1)
|
|
@ValidateNested({ each: true })
|
|
@Type(() => DevPlanTaskFromTicketDto)
|
|
tasks?: DevPlanTaskFromTicketDto[];
|
|
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
dispatchToWecom?: boolean;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
dispatchSupplement?: string;
|
|
}
|
|
|
|
export class DevPlanTaskBatchUpdateDto {
|
|
@IsArray()
|
|
@ArrayMinSize(1)
|
|
@IsString({ each: true })
|
|
taskIds!: string[];
|
|
|
|
@IsOptional()
|
|
@IsIn(DEV_PLAN_TASK_STATUSES)
|
|
status?: string;
|
|
|
|
@IsOptional()
|
|
@IsString()
|
|
versionId?: string | null;
|
|
}
|
|
|
|
export class BatchReviewPreviewDto {
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
ticketIds!: string[];
|
|
}
|
|
|
|
export class BatchReviewConfirmDto {
|
|
@IsArray()
|
|
items!: Array<{
|
|
ticketId: string;
|
|
decision: 'APPROVE' | 'REJECT';
|
|
rejectReason?: string;
|
|
note?: string;
|
|
tasks?: Array<{ content: string; type: 'BUG' | 'REQUIREMENT' | 'OPTIMIZATION' }>;
|
|
}>;
|
|
}
|