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.
This commit is contained in:
tekh 2025-12-08 11:50:30 +01:00
parent 1cdd28738a
commit 404a1c4793

View File

@ -71,6 +71,20 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr
await mediator.Send(command, cancel);
return NoContent();
}
/// <summary>
/// Deletes all output results for a fake/test profile.
/// </summary>
/// <param name="cancel">A token to cancel the operation.</param>
/// <returns>An empty response indicating success.</returns>
[HttpDelete("fake")]
[ProducesResponseType(StatusCodes.Status204NoContent)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> Delete(CancellationToken cancel)
{
await mediator.Send(new DeleteOutResCommand() { ProfileId = config.GetFakeProfileId() }, cancel);
return NoContent();
}
}
/// <summary>