2026-02-08 18:44:05 -04:00
|
|
|
import { IsString, IsOptional, IsArray, ValidateNested } from 'class-validator';
|
2026-02-07 10:23:29 -04:00
|
|
|
import { Type } from 'class-transformer';
|
|
|
|
|
import { WorkflowStageDto } from './workflow-stage.dto';
|
|
|
|
|
|
|
|
|
|
export class CreateWorkflowDto {
|
|
|
|
|
@IsString()
|
|
|
|
|
workflowType: string;
|
|
|
|
|
|
|
|
|
|
@IsString()
|
|
|
|
|
name: string;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
description?: string;
|
|
|
|
|
|
|
|
|
|
@IsArray()
|
|
|
|
|
@ValidateNested({ each: true })
|
|
|
|
|
@Type(() => WorkflowStageDto)
|
|
|
|
|
stages: WorkflowStageDto[];
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsArray()
|
|
|
|
|
@IsString({ each: true })
|
|
|
|
|
onSuccessActions?: string[];
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsArray()
|
|
|
|
|
@IsString({ each: true })
|
|
|
|
|
onFailureActions?: string[];
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
metadata?: Record<string, any>;
|
|
|
|
|
|
|
|
|
|
@IsOptional()
|
|
|
|
|
@IsString()
|
|
|
|
|
createdBy?: string;
|
|
|
|
|
}
|