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:
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
{
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user