Refactor endpoint Procedures to Commands for CQRS alignment

Renamed Insert/Update/DeleteEndpointProcedure classes to their
respective Command counterparts to follow CQRS conventions.
Updated controller actions, handlers, InsertObjectProcedure,
and related unit tests to use the new Command types.
No functional changes were made; this is a naming refactor.
This commit is contained in:
2026-03-24 11:38:22 +01:00
parent 5df36d94e0
commit 4999beda3b
6 changed files with 16 additions and 16 deletions

View File

@@ -0,0 +1,25 @@
using MediatR;
using ReC.Application.Common.Procedures.UpdateProcedure;
using ReC.Application.Common.Procedures.UpdateProcedure.Dto;
namespace ReC.Application.Endpoints.Commands;
public record UpdateEndpointCommand : IUpdateProcedure<UpdateEndpointDto>
{
public long Id { get; set; }
public UpdateEndpointDto Data { get; set; } = null!;
}
public class UpdateEndpointProcedureHandler(ISender sender) : IRequestHandler<UpdateEndpointCommand, int>
{
public async Task<int> Handle(UpdateEndpointCommand request, CancellationToken cancel)
{
return await sender.Send(new UpdateObjectProcedure
{
Entity = "ENDPOINT",
Id = request.Id,
Endpoint = request.Data
}, cancel);
}
}