feat(domain): add close workflow outcome semantics
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Closing;
|
||||
|
||||
/// <summary>
|
||||
/// Defines business outcomes of a close workflow attempt.
|
||||
/// </summary>
|
||||
public enum CloseWorkflowOutcome
|
||||
{
|
||||
/// <summary>
|
||||
/// Workflow can be closed successfully.
|
||||
/// </summary>
|
||||
Closed = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Caller has no access to the requested workflow.
|
||||
/// </summary>
|
||||
NoAccess = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Workflow process was not found.
|
||||
/// </summary>
|
||||
NotFound = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Workflow is already closed and cannot be closed again.
|
||||
/// </summary>
|
||||
AlreadyClosed = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Closing cannot be completed yet because write integration is not finalized.
|
||||
/// </summary>
|
||||
NotImplemented = 4
|
||||
}
|
||||
@@ -14,4 +14,9 @@ public sealed record CloseWorkflowResult
|
||||
/// Gets a value indicating whether the process was closed successfully.
|
||||
/// </summary>
|
||||
public required bool IsClosed { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the business outcome of the close request.
|
||||
/// </summary>
|
||||
public CloseWorkflowOutcome Outcome { get; init; } = CloseWorkflowOutcome.Closed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user