From f8e877ac06ff42e9d4def04cc09fcdd132513469 Mon Sep 17 00:00:00 2001 From: TekH Date: Sat, 10 Oct 2026 16:11:27 +0200 Subject: [PATCH] feat(domain): add close workflow outcome semantics --- .../Closing/CloseWorkflowOutcome.cs | 32 +++++++++++++++++++ .../Closing/CloseWorkflowResult.cs | 5 +++ 2 files changed, 37 insertions(+) create mode 100644 src/core/DigitalData.TaskFlow.Domain/Closing/CloseWorkflowOutcome.cs 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; }