import { EventInterface } from '../event-origin.interface';
import { WorkflowRunStatusStatus, WorkflowJobStatusStatus, NodeTypes } from './enums';
import { ConditionMapper, MessageMapper, NodeMapper, ValidationMapper } from './parameter-mapper.interface';
import { WorkflowDefinition, WorkflowDefinitionStep } from './workflow-definition.interface';
import { WorkflowDrawing } from './workflow-drawing.interface';
export interface BaseWorkflowJobInterface {
    id: string;
    identifier: string;
    run: WorkflowRunInterface;
    status: WorkflowJobStatusStatus;
    operationIdentifier: string;
    operationVersion?: string;
    payload?: Record<string, unknown> | undefined;
    log?: string;
    result?: unknown;
    requires: Array<string>;
    step: WorkflowDefinitionStep;
    testRun?: boolean;
    createdAt: Date;
    updatedAt: Date;
    type: NodeTypes;
    with: NodeMapper;
}
export interface ActionJob extends BaseWorkflowJobInterface {
    type: NodeTypes.ACTION;
    with: MessageMapper;
    operationIdentifier: string;
    operationVersion: string;
}
export interface ConditionalJob extends BaseWorkflowJobInterface {
    type: NodeTypes.CONDITIONAL;
    with: ConditionMapper;
}
export interface ValidationJob extends BaseWorkflowJobInterface {
    type: NodeTypes.VALIDATION;
    with: ValidationMapper;
}
export interface PlaceholderJob extends BaseWorkflowJobInterface {
    type: NodeTypes.PLACEHOLDER;
    with: object;
}
export type WorkflowJobInterface = ActionJob | ConditionalJob | ValidationJob | PlaceholderJob;
export interface WorkflowRunInterface {
    id: string;
    tenantIdentifier: string;
    semanticIdentifier: string;
    status: WorkflowRunStatusStatus;
    ttl: number;
    workflow: WorkflowDefinition;
    drawing?: WorkflowDrawing;
    trigger: EventInterface;
    jobs: Array<WorkflowJobInterface>;
    createdAt: Date;
    updatedAt: Date;
    testRun?: boolean;
    restartOf?: string;
    workflowIdentifier?: string;
}
