From 1a6baef8074f23c6dc5cf1a489cde8d648c9bae7 Mon Sep 17 00:00:00 2001 From: TekH Date: Sat, 31 Oct 2026 21:25:49 +0100 Subject: [PATCH] Add new endpoint and improve exception handling Removed the `asByte` parameter from XML documentation in `DocumentController.cs`, indicating the method no longer supports byte array returns. Added a new HTTP POST endpoint `CloseAsync` in `WorkflowsController.cs`, which is currently not implemented and throws a `NotImplementedException`. Enhanced `ExceptionHandlingMiddleware.cs` to handle `NotImplementedException` by logging a warning and returning a `501 Not Implemented` response in a problem details format. --- .../Controllers/DocumentController.cs | 1 - .../Controllers/WorkflowsController.cs | 16 ++++++++++++++++ .../Middleware/ExceptionHandlingMiddleware.cs | 16 ++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/presentation/DigitalData.TaskFlow.API/Controllers/DocumentController.cs b/src/presentation/DigitalData.TaskFlow.API/Controllers/DocumentController.cs index 9398cbd..916cf18 100644 --- a/src/presentation/DigitalData.TaskFlow.API/Controllers/DocumentController.cs +++ b/src/presentation/DigitalData.TaskFlow.API/Controllers/DocumentController.cs @@ -18,7 +18,6 @@ public sealed class DocumentController(ISender sender) : ControllerBase /// Document identifier. /// User identifier. /// Process identifier. - /// Return document as byte array. /// Cancellation token. /// Document response envelope grouped by source. [HttpGet("{id:int}")] diff --git a/src/presentation/DigitalData.TaskFlow.API/Controllers/WorkflowsController.cs b/src/presentation/DigitalData.TaskFlow.API/Controllers/WorkflowsController.cs index 9af3a54..c204aed 100644 --- a/src/presentation/DigitalData.TaskFlow.API/Controllers/WorkflowsController.cs +++ b/src/presentation/DigitalData.TaskFlow.API/Controllers/WorkflowsController.cs @@ -27,4 +27,20 @@ public sealed class WorkflowsController(ISender sender) : ControllerBase { return Ok(await sender.Send(new GetWorkflowsQuery(wisagId), cancellationToken)); } + + /// + /// + /// + /// + /// + /// + /// + /// + /// + [HttpPost("{wisagId:int}/{source}/{processId:long}/closing")] + [ProducesResponseType(StatusCodes.Status501NotImplemented)] + public Task> CloseAsync([FromRoute] int wisagId, [FromRoute] string source, [FromRoute] long processId, CancellationToken cancellationToken) + { + throw new NotImplementedException(); + } } diff --git a/src/presentation/DigitalData.TaskFlow.API/Middleware/ExceptionHandlingMiddleware.cs b/src/presentation/DigitalData.TaskFlow.API/Middleware/ExceptionHandlingMiddleware.cs index 41bea14..dff7c1e 100644 --- a/src/presentation/DigitalData.TaskFlow.API/Middleware/ExceptionHandlingMiddleware.cs +++ b/src/presentation/DigitalData.TaskFlow.API/Middleware/ExceptionHandlingMiddleware.cs @@ -63,6 +63,22 @@ public sealed class ExceptionHandlingMiddleware(RequestDelegate next, ILogger