diff --git a/src/core/DigitalData.TaskFlow.Domain/Closing/CloseWorkflowOutcome.cs b/src/core/DigitalData.TaskFlow.Domain/Closing/CloseWorkflowOutcome.cs new file mode 100644 index 0000000..ce0eb70 --- /dev/null +++ b/src/core/DigitalData.TaskFlow.Domain/Closing/CloseWorkflowOutcome.cs @@ -0,0 +1,32 @@ +namespace DigitalData.TaskFlow.Domain.Closing; + +/// +/// Defines business outcomes of a close workflow attempt. +/// +public enum CloseWorkflowOutcome +{ + /// + /// Workflow can be closed successfully. + /// + Closed = 0, + + /// + /// Caller has no access to the requested workflow. + /// + NoAccess = 1, + + /// + /// Workflow process was not found. + /// + NotFound = 2, + + /// + /// Workflow is already closed and cannot be closed again. + /// + AlreadyClosed = 3, + + /// + /// Closing cannot be completed yet because write integration is not finalized. + /// + NotImplemented = 4 +} diff --git a/src/core/DigitalData.TaskFlow.Domain/Closing/CloseWorkflowResult.cs b/src/core/DigitalData.TaskFlow.Domain/Closing/CloseWorkflowResult.cs index 7ee69b3..47cd5f5 100644 --- a/src/core/DigitalData.TaskFlow.Domain/Closing/CloseWorkflowResult.cs +++ b/src/core/DigitalData.TaskFlow.Domain/Closing/CloseWorkflowResult.cs @@ -14,4 +14,9 @@ public sealed record CloseWorkflowResult /// Gets a value indicating whether the process was closed successfully. /// public required bool IsClosed { get; init; } + + /// + /// Gets the business outcome of the close request. + /// + public CloseWorkflowOutcome Outcome { get; init; } = CloseWorkflowOutcome.Closed; }