From e0d83c0a14bc75f6c14a29f3d8505ea1d11dbdb9 Mon Sep 17 00:00:00 2001 From: TekH Date: Mon, 12 Jan 2026 10:50:39 +0100 Subject: [PATCH] Mark RecAction commands and endpoints as obsolete Added [Obsolete("Use the related procedure.")] to RecAction creation and deletion commands, handlers, mapping profile, and related controller endpoints to indicate deprecation. No functional changes were made. --- src/ReC.API/Controllers/RecActionController.cs | 4 ++++ src/ReC.Application/RecActionViews/MappingProfile.cs | 1 + .../RecActions/Commands/CreateRecActionCommand.cs | 2 ++ .../RecActions/Commands/DeleteRecActionsCommand.cs | 2 ++ 4 files changed, 9 insertions(+) diff --git a/src/ReC.API/Controllers/RecActionController.cs b/src/ReC.API/Controllers/RecActionController.cs index d1454b9..992b2ee 100644 --- a/src/ReC.API/Controllers/RecActionController.cs +++ b/src/ReC.API/Controllers/RecActionController.cs @@ -73,6 +73,7 @@ public class RecActionController(IMediator mediator, IConfiguration config) : Co /// An HTTP 201 Created response. [HttpPost] [ProducesResponseType(StatusCodes.Status201Created)] + [Obsolete("Use the related procedure.")] public async Task CreateAction([FromBody] CreateRecActionCommand command, CancellationToken cancel) { await mediator.Send(command, cancel); @@ -91,6 +92,7 @@ public class RecActionController(IMediator mediator, IConfiguration config) : Co /// An HTTP 201 Created response. [HttpPost("fake")] [ProducesResponseType(StatusCodes.Status201Created)] + [Obsolete("Use the related procedure.")] public async Task CreateFakeAction( CancellationToken cancel, [FromBody] FakeRequest? request = null, @@ -126,6 +128,7 @@ public class RecActionController(IMediator mediator, IConfiguration config) : Co /// An HTTP 204 No Content response upon successful deletion. [HttpDelete] [ProducesResponseType(StatusCodes.Status204NoContent)] + [Obsolete("Use the related procedure.")] public async Task Delete([FromQuery] DeleteRecActionsCommand cmd, CancellationToken cancel) { await mediator.Send(cmd, cancel); @@ -139,6 +142,7 @@ public class RecActionController(IMediator mediator, IConfiguration config) : Co /// An HTTP 204 No Content response upon successful deletion. [HttpDelete("fake")] [ProducesResponseType(StatusCodes.Status204NoContent)] + [Obsolete("Use the related procedure.")] public async Task Delete(CancellationToken cancel) { await mediator.Send(new DeleteRecActionsCommand() diff --git a/src/ReC.Application/RecActionViews/MappingProfile.cs b/src/ReC.Application/RecActionViews/MappingProfile.cs index 123d0c5..fc095d6 100644 --- a/src/ReC.Application/RecActionViews/MappingProfile.cs +++ b/src/ReC.Application/RecActionViews/MappingProfile.cs @@ -6,6 +6,7 @@ namespace ReC.Application.RecActionViews; // TODO: update to inject AddedWho from the current host/user contex public class MappingProfile : AutoMapper.Profile { + [Obsolete("Use the related procedure.")] public MappingProfile() { CreateMap() diff --git a/src/ReC.Application/RecActions/Commands/CreateRecActionCommand.cs b/src/ReC.Application/RecActions/Commands/CreateRecActionCommand.cs index 3d6e0e0..151ecf3 100644 --- a/src/ReC.Application/RecActions/Commands/CreateRecActionCommand.cs +++ b/src/ReC.Application/RecActions/Commands/CreateRecActionCommand.cs @@ -6,6 +6,7 @@ using ReC.Application.Endpoints.Commands; namespace ReC.Application.RecActions.Commands; +[Obsolete("Use the related procedure.")] public record CreateRecActionCommand : IRequest { public long ProfileId { get; init; } @@ -27,6 +28,7 @@ public record CreateRecActionCommand : IRequest public long? EndpointAuthId { get; set; } } +[Obsolete("Use the related procedure.")] public class CreateRecActionCommandHandler(ISender sender, IRepository repo) : IRequestHandler { public async Task Handle(CreateRecActionCommand request, CancellationToken cancel) diff --git a/src/ReC.Application/RecActions/Commands/DeleteRecActionsCommand.cs b/src/ReC.Application/RecActions/Commands/DeleteRecActionsCommand.cs index 84e52d9..11f86cd 100644 --- a/src/ReC.Application/RecActions/Commands/DeleteRecActionsCommand.cs +++ b/src/ReC.Application/RecActions/Commands/DeleteRecActionsCommand.cs @@ -6,11 +6,13 @@ using ReC.Domain.Entities; namespace ReC.Application.RecActions.Commands; +[Obsolete("Use the related procedure.")] public class DeleteRecActionsCommand : IRequest { public required long ProfileId { get; init; } } +[Obsolete("Use the related procedure.")] public class DeleteRecActionsCommandHandler(IRepository repo) : IRequestHandler { public async Task Handle(DeleteRecActionsCommand request, CancellationToken cancel)