From ad51e4b1eb9c4c5a9ce333bbf96c6e9a21bcf4b4 Mon Sep 17 00:00:00 2001 From: TekH Date: Wed, 14 Jan 2026 15:10:20 +0100 Subject: [PATCH] Update OutResController to use ReadResultViewQuery Switched GET endpoints to ReadResultViewQuery for modernized query handling. Removed [Obsolete] from the controller class, but added it to DELETE endpoints to mark them as deprecated. Updated "fake" profile GET endpoints to use the new query model and removed obsolete warnings from these methods. --- src/ReC.API/Controllers/OutResController.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/ReC.API/Controllers/OutResController.cs b/src/ReC.API/Controllers/OutResController.cs index 40e7955..a526c00 100644 --- a/src/ReC.API/Controllers/OutResController.cs +++ b/src/ReC.API/Controllers/OutResController.cs @@ -7,7 +7,6 @@ using ReC.Application.OutResults.Queries; namespace ReC.API.Controllers; -[Obsolete("This controller is deprecated and will be removed in future versions. Use the new ResultViewController instead.")] [Route("api/[controller]")] [ApiController] public class OutResController(IMediator mediator, IConfiguration config) : ControllerBase @@ -20,7 +19,7 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr /// A list of output results matching the query. [HttpGet] [ProducesResponseType(StatusCodes.Status200OK)] - public async Task Get([FromQuery] ReadOutResQuery query, CancellationToken cancel) => Ok(await mediator.Send(query, cancel)); + public async Task Get([FromQuery] ReadResultViewQuery query, CancellationToken cancel) => Ok(await mediator.Send(query, cancel)); /// /// Gets output results for a fake/test profile. @@ -29,8 +28,7 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr /// A list of output results for the fake profile. [HttpGet("fake")] [ProducesResponseType(StatusCodes.Status200OK)] - [Obsolete("Use the related procedure or view.")] - public async Task Get(CancellationToken cancel) => Ok(await mediator.Send(new ReadOutResQuery() + public async Task Get(CancellationToken cancel) => Ok(await mediator.Send(new ReadResultViewQuery() { ProfileId = config.GetFakeProfileId() }, cancel)); @@ -44,10 +42,9 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr /// The requested output result or a part of it (header/body). [HttpGet("fake/{actionId}")] [ProducesResponseType(StatusCodes.Status200OK)] - [Obsolete("Use the related procedure or view.")] public async Task Get([FromRoute] long actionId, CancellationToken cancel, ResultType resultType = ResultType.Full) { - var res = (await mediator.Send(new ReadOutResQuery() + var res = (await mediator.Send(new ReadResultViewQuery() { ProfileId = config.GetFakeProfileId(), ActionId = actionId @@ -69,6 +66,7 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr /// An empty response indicating success. [HttpDelete] [ProducesResponseType(StatusCodes.Status204NoContent)] + [Obsolete("Use the related procedure or view.")] public async Task Delete([FromQuery] DeleteOutResCommand command, CancellationToken cancel) { await mediator.Send(command, cancel); @@ -83,6 +81,7 @@ public class OutResController(IMediator mediator, IConfiguration config) : Contr [HttpDelete("fake")] [ProducesResponseType(StatusCodes.Status204NoContent)] [ProducesResponseType(StatusCodes.Status400BadRequest)] + [Obsolete("Use the related procedure or view.")] public async Task Delete(CancellationToken cancel) { await mediator.Send(new DeleteOutResCommand() { ProfileId = config.GetFakeProfileId() }, cancel);