Enhance workflow handling and enforce stricter exceptions
Enhanced `GetWorkflowsQueryHandler` to validate listing data in workflow sources and return appropriate responses. Updated `DocumentRepository.GetAsync` and `WorkflowRepository.CloseAsync` to throw `NotSupportedException` for unimplemented functionality, ensuring these methods cannot be used until finalized. Added `DigitalData.TaskFlow.Domain.Enums` dependency to support new logic in `GetWorkflowsQueryHandler`.
This commit is contained in:
@@ -16,12 +16,7 @@ public sealed class DocumentRepository : IDocumentRepository
|
||||
/// <returns>Binary document payload.</returns>
|
||||
public Task<DocumentBinaryResult> GetAsync(string id, CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult(new DocumentBinaryResult
|
||||
{
|
||||
Content = [],
|
||||
ContentType = "application/octet-stream",
|
||||
FileName = $"{id}.bin",
|
||||
Length = 0
|
||||
});
|
||||
throw new NotSupportedException(
|
||||
"Document retrieval source (DB/DMS) is not finalized yet. Configure final integration before enabling GetAsync.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,10 +94,7 @@ public sealed class WorkflowRepository(TaskFlowDbContext dbContext) : IWorkflowR
|
||||
CloseWorkflowDecision decision,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
return Task.FromResult(new CloseWorkflowResult
|
||||
{
|
||||
ProcessId = processId,
|
||||
IsClosed = true
|
||||
});
|
||||
throw new NotSupportedException(
|
||||
"Closing write procedure is not finalized yet. Configure final DB procedure mapping before enabling CloseAsync.");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user