6658 workflows add a first twenty piece email sender (#6965)

This commit is contained in:
martmull
2024-09-12 11:00:25 +02:00
committed by GitHub
parent f8e5b333d9
commit 3190f4a87b
397 changed files with 1143 additions and 1037 deletions

View File

@ -0,0 +1,16 @@
import {
WorkflowQueryValidationException,
WorkflowQueryValidationExceptionCode,
} from 'src/modules/workflow/common/exceptions/workflow-query-validation.exception';
import { WorkflowStatus } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
export const assertWorkflowStatusesNotSetOrEmpty = (
statuses?: WorkflowStatus[] | null,
) => {
if (statuses && statuses.length > 0) {
throw new WorkflowQueryValidationException(
'Statuses cannot be set manually.',
WorkflowQueryValidationExceptionCode.FORBIDDEN,
);
}
};

View File

@ -0,0 +1,16 @@
import {
WorkflowQueryValidationException,
WorkflowQueryValidationExceptionCode,
} from 'src/modules/workflow/common/exceptions/workflow-query-validation.exception';
import { WorkflowStatus } from 'src/modules/workflow/common/standard-objects/workflow.workspace-entity';
export const assertWorkflowStatusesNotSet = (
statuses?: WorkflowStatus[] | null,
) => {
if (statuses) {
throw new WorkflowQueryValidationException(
'Statuses cannot be set manually.',
WorkflowQueryValidationExceptionCode.FORBIDDEN,
);
}
};

View File

@ -0,0 +1,22 @@
import {
WorkflowQueryValidationException,
WorkflowQueryValidationExceptionCode,
} from 'src/modules/workflow/common/exceptions/workflow-query-validation.exception';
import {
WorkflowVersionStatus,
WorkflowVersionWorkspaceEntity,
} from 'src/modules/workflow/common/standard-objects/workflow-version.workspace-entity';
import { WorkflowTrigger } from 'src/modules/workflow/workflow-trigger/types/workflow-trigger.type';
export const assertWorkflowVersionIsDraft = (
workflowVersion: Omit<WorkflowVersionWorkspaceEntity, 'trigger'> & {
trigger: WorkflowTrigger;
},
) => {
if (workflowVersion.status !== WorkflowVersionStatus.DRAFT) {
throw new WorkflowQueryValidationException(
'Workflow version is not in draft status',
WorkflowQueryValidationExceptionCode.FORBIDDEN,
);
}
};