Rename Result*Procedure to Result*Command for consistency
Refactor all Result-related procedure records, handlers, and usages to use the *Command suffix instead of *Procedure. Update controller actions, handler interfaces, tests, and InsertObjectProcedure accordingly. No functional changes; improves naming consistency across the codebase.
This commit is contained in:
@@ -30,7 +30,7 @@ public class ResultController(IMediator mediator) : ControllerBase
|
||||
/// <returns>The created RESULT identifier.</returns>
|
||||
[HttpPost]
|
||||
[ProducesResponseType(StatusCodes.Status201Created)]
|
||||
public async Task<IActionResult> Post([FromBody] InsertResultProcedure procedure, CancellationToken cancel)
|
||||
public async Task<IActionResult> Post([FromBody] InsertResultCommand procedure, CancellationToken cancel)
|
||||
{
|
||||
var id = await mediator.Send(procedure, cancel);
|
||||
return CreatedAtAction(nameof(Get), new { actionId = procedure.ActionId }, new { id, procedure.ActionId });
|
||||
@@ -44,7 +44,7 @@ public class ResultController(IMediator mediator) : ControllerBase
|
||||
/// <returns>No content on success.</returns>
|
||||
[HttpPut]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public async Task<IActionResult> Put([FromBody] UpdateResultProcedure procedure, CancellationToken cancel)
|
||||
public async Task<IActionResult> Put([FromBody] UpdateResultCommand procedure, CancellationToken cancel)
|
||||
{
|
||||
await mediator.Send(procedure, cancel);
|
||||
return NoContent();
|
||||
@@ -58,7 +58,7 @@ public class ResultController(IMediator mediator) : ControllerBase
|
||||
/// <returns>No content on success.</returns>
|
||||
[HttpDelete]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
public async Task<IActionResult> Delete([FromBody] DeleteResultProcedure procedure, CancellationToken cancel)
|
||||
public async Task<IActionResult> Delete([FromBody] DeleteResultCommand procedure, CancellationToken cancel)
|
||||
{
|
||||
await mediator.Send(procedure, cancel);
|
||||
return NoContent();
|
||||
|
||||
@@ -28,7 +28,7 @@ public record InsertObjectProcedure : IRequest<long>
|
||||
public InsertEndpointCommand Endpoint { get; set; } = new();
|
||||
public InsertEndpointAuthCommand EndpointAuth { get; set; } = new();
|
||||
public InsertProfileCommand Profile { get; set; } = new();
|
||||
public InsertResultProcedure Result { get; set; } = new();
|
||||
public InsertResultCommand Result { get; set; } = new();
|
||||
public InsertEndpointParamsCommand EndpointParams { get; set; } = new();
|
||||
}
|
||||
|
||||
|
||||
@@ -148,7 +148,7 @@ public class InvokeRecActionViewCommandHandler(
|
||||
|
||||
var statusCode = (short)response.StatusCode;
|
||||
|
||||
await sender.Send(new InsertResultProcedure()
|
||||
await sender.Send(new InsertResultCommand()
|
||||
{
|
||||
StatusId = statusCode,
|
||||
ActionId = action.Id,
|
||||
|
||||
@@ -3,7 +3,7 @@ using ReC.Application.Common.Procedures.DeleteProcedure;
|
||||
|
||||
namespace ReC.Application.Results.Commands;
|
||||
|
||||
public record DeleteResultProcedure : IDeleteProcedure
|
||||
public record DeleteResultCommand : IDeleteProcedure
|
||||
{
|
||||
/// <summary>
|
||||
/// Start GUID/ID (inclusive)
|
||||
@@ -21,9 +21,9 @@ public record DeleteResultProcedure : IDeleteProcedure
|
||||
public bool Force { get; set; }
|
||||
}
|
||||
|
||||
public class DeleteResultProcedureHandler(ISender sender) : IRequestHandler<DeleteResultProcedure, int>
|
||||
public class DeleteResultProcedureHandler(ISender sender) : IRequestHandler<DeleteResultCommand, int>
|
||||
{
|
||||
public async Task<int> Handle(DeleteResultProcedure request, CancellationToken cancel)
|
||||
public async Task<int> Handle(DeleteResultCommand request, CancellationToken cancel)
|
||||
{
|
||||
return await sender.Send(new DeleteObjectProcedure
|
||||
{
|
||||
@@ -3,7 +3,7 @@ using ReC.Application.Common.Procedures.InsertProcedure;
|
||||
|
||||
namespace ReC.Application.Results.Commands;
|
||||
|
||||
public record InsertResultProcedure : IInsertProcedure
|
||||
public record InsertResultCommand : IInsertProcedure
|
||||
{
|
||||
public long? ActionId { get; set; }
|
||||
public short? StatusId { get; set; }
|
||||
@@ -13,9 +13,9 @@ public record InsertResultProcedure : IInsertProcedure
|
||||
public string? Error { get; set; }
|
||||
}
|
||||
|
||||
public class InsertResultProcedureHandler(ISender sender) : IRequestHandler<InsertResultProcedure, long>
|
||||
public class InsertResultProcedureHandler(ISender sender) : IRequestHandler<InsertResultCommand, long>
|
||||
{
|
||||
public async Task<long> Handle(InsertResultProcedure request, CancellationToken cancel)
|
||||
public async Task<long> Handle(InsertResultCommand request, CancellationToken cancel)
|
||||
{
|
||||
return await sender.Send(new InsertObjectProcedure
|
||||
{
|
||||
@@ -4,16 +4,16 @@ using ReC.Application.Common.Procedures.UpdateProcedure.Dto;
|
||||
|
||||
namespace ReC.Application.Results.Commands;
|
||||
|
||||
public record UpdateResultProcedure : IUpdateProcedure<UpdateResultDto>
|
||||
public record UpdateResultCommand : IUpdateProcedure<UpdateResultDto>
|
||||
{
|
||||
public long Id { get; set; }
|
||||
|
||||
public UpdateResultDto Data { get; set; } = null!;
|
||||
}
|
||||
|
||||
public class UpdateResultProcedureHandler(ISender sender) : IRequestHandler<UpdateResultProcedure, int>
|
||||
public class UpdateResultProcedureHandler(ISender sender) : IRequestHandler<UpdateResultCommand, int>
|
||||
{
|
||||
public async Task<int> Handle(UpdateResultProcedure request, CancellationToken cancel)
|
||||
public async Task<int> Handle(UpdateResultCommand request, CancellationToken cancel)
|
||||
{
|
||||
return await sender.Send(new UpdateObjectProcedure
|
||||
{
|
||||
@@ -23,7 +23,7 @@ public class ResultProcedureTests : RecApplicationTestBase
|
||||
[Test]
|
||||
public async Task InsertResultProcedure_runs_via_mediator()
|
||||
{
|
||||
var procedure = new InsertResultProcedure { ActionId = 1, StatusId = 200, Header = "h", Body = "b" };
|
||||
var procedure = new InsertResultCommand { ActionId = 1, StatusId = 200, Header = "h", Body = "b" };
|
||||
|
||||
var (sender, scope) = CreateScopedSender();
|
||||
using var _ = scope;
|
||||
@@ -35,7 +35,7 @@ public class ResultProcedureTests : RecApplicationTestBase
|
||||
[Test]
|
||||
public async Task UpdateResultProcedure_runs_via_mediator()
|
||||
{
|
||||
var procedure = new UpdateResultProcedure { Data = { ActionId = 2, StatusId = 500, Header = "h2", Body = "b2" }, Id = 55 };
|
||||
var procedure = new UpdateResultCommand { Data = { ActionId = 2, StatusId = 500, Header = "h2", Body = "b2" }, Id = 55 };
|
||||
|
||||
var (sender, scope) = CreateScopedSender();
|
||||
using var _ = scope;
|
||||
@@ -47,7 +47,7 @@ public class ResultProcedureTests : RecApplicationTestBase
|
||||
[Test]
|
||||
public async Task DeleteResultProcedure_runs_via_mediator()
|
||||
{
|
||||
var procedure = new DeleteResultProcedure { Start = 11, End = 12, Force = false };
|
||||
var procedure = new DeleteResultCommand { Start = 11, End = 12, Force = false };
|
||||
|
||||
var (sender, scope) = CreateScopedSender();
|
||||
using var _ = scope;
|
||||
|
||||
Reference in New Issue
Block a user