From 404a1c4793d1e28990d1103e3bc3f82ea57408bc Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 8 Dec 2025 11:50:30 +0100 Subject: [PATCH] Add Delete method for fake profile in OutResController Added a new `Delete` method to the `OutResController` class to delete all output results for a fake/test profile. The method is accessible via the `DELETE /fake` route and supports cancellation via a `CancellationToken`. Included XML documentation for the method, describing its purpose, parameters, and return type. Added `[ProducesResponseType]` attributes to specify possible HTTP response codes: `204 No Content` for success and `400 Bad Request` for invalid requests. The method uses `IMediator` to send a `DeleteOutResCommand` with a `ProfileId` obtained from the `IConfiguration` instance. --- src/ReC.API/Controllers/OutResController.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ReC.API/Controllers/OutResController.cs b/src/ReC.API/Controllers/OutResController.cs index eff3b6e..d4a36d1 100644 --- a/src/ReC.API/Controllers/OutResController.cs +++ b/src/ReC.API/Controllers/OutResController.cs @@ -71,6 +71,20 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr await mediator.Send(command, cancel); return NoContent(); } + + /// + /// Deletes all output results for a fake/test profile. + /// + /// A token to cancel the operation. + /// An empty response indicating success. + [HttpDelete("fake")] + [ProducesResponseType(StatusCodes.Status204NoContent)] + [ProducesResponseType(StatusCodes.Status400BadRequest)] + public async Task Delete(CancellationToken cancel) + { + await mediator.Send(new DeleteOutResCommand() { ProfileId = config.GetFakeProfileId() }, cancel); + return NoContent(); + } } ///