Rename InsertEndpointAuthProcedure to InsertEndpointAuthCommand

Refactored all usages of InsertEndpointAuthProcedure to InsertEndpointAuthCommand, including method signatures, handler interfaces, and test cases, to better align with CQRS naming conventions for write operations.
This commit is contained in:
2026-03-24 11:35:58 +01:00
parent 0162d059da
commit a6b0cbaf9d
4 changed files with 6 additions and 6 deletions

View File

@@ -16,7 +16,7 @@ public class EndpointAuthController(IMediator mediator, IConfiguration config) :
/// <returns>The created ENDPOINT_AUTH identifier.</returns>
[HttpPost]
[ProducesResponseType(StatusCodes.Status201Created)]
public async Task<IActionResult> Post([FromBody] InsertEndpointAuthProcedure procedure, CancellationToken cancel)
public async Task<IActionResult> Post([FromBody] InsertEndpointAuthCommand procedure, CancellationToken cancel)
{
var id = await mediator.Send(procedure, cancel);
return StatusCode(StatusCodes.Status201Created, id);

View File

@@ -26,7 +26,7 @@ public record InsertObjectProcedure : IRequest<long>
public InsertActionProcedure Action { get; set; } = new();
public InsertEndpointProcedure Endpoint { get; set; } = new();
public InsertEndpointAuthProcedure EndpointAuth { get; set; } = new();
public InsertEndpointAuthCommand EndpointAuth { get; set; } = new();
public InsertProfileProcedure Profile { get; set; } = new();
public InsertResultProcedure Result { get; set; } = new();
public InsertEndpointParamsProcedure EndpointParams { get; set; } = new();

View File

@@ -3,7 +3,7 @@ using ReC.Application.Common.Procedures.InsertProcedure;
namespace ReC.Application.EndpointAuth.Commands;
public record InsertEndpointAuthProcedure : IInsertProcedure
public record InsertEndpointAuthCommand : IInsertProcedure
{
public bool? Active { get; set; }
public string? Description { get; set; }
@@ -18,9 +18,9 @@ public record InsertEndpointAuthProcedure : IInsertProcedure
public string? Workstation { get; set; }
}
public class InsertEndpointAuthProcedureHandler(ISender sender) : IRequestHandler<InsertEndpointAuthProcedure, long>
public class InsertEndpointAuthProcedureHandler(ISender sender) : IRequestHandler<InsertEndpointAuthCommand, long>
{
public async Task<long> Handle(InsertEndpointAuthProcedure request, CancellationToken cancel)
public async Task<long> Handle(InsertEndpointAuthCommand request, CancellationToken cancel)
{
return await sender.Send(new InsertObjectProcedure
{

View File

@@ -23,7 +23,7 @@ public class EndpointAuthProcedureTests : RecApplicationTestBase
[Test]
public async Task InsertEndpointAuthProcedure_runs_via_mediator()
{
var procedure = new InsertEndpointAuthProcedure { Active = true, Description = "auth", TypeId = 1, ApiKey = "key", ApiValue = "value" };
var procedure = new InsertEndpointAuthCommand { Active = true, Description = "auth", TypeId = 1, ApiKey = "key", ApiValue = "value" };
var (sender, scope) = CreateScopedSender();
using var _ = scope;