Rename Profile*Procedure types to Profile*Command for clarity
Renamed InsertProfileProcedure, UpdateProfileProcedure, and DeleteProfileProcedure (and their handlers) to use the "Command" suffix for consistency. Updated all usages in controllers, handlers, and tests. No logic changes; only type names were updated for improved clarity.
This commit is contained in:
@@ -23,7 +23,7 @@ public class ProfileController(IMediator mediator) : ControllerBase
|
|||||||
/// <returns>The created profile identifier.</returns>
|
/// <returns>The created profile identifier.</returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ProducesResponseType(StatusCodes.Status201Created)]
|
[ProducesResponseType(StatusCodes.Status201Created)]
|
||||||
public async Task<IActionResult> Post([FromBody] InsertProfileProcedure procedure, CancellationToken cancel)
|
public async Task<IActionResult> Post([FromBody] InsertProfileCommand procedure, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
var id = await mediator.Send(procedure, cancel);
|
var id = await mediator.Send(procedure, cancel);
|
||||||
return CreatedAtAction(nameof(Get), new { id }, id);
|
return CreatedAtAction(nameof(Get), new { id }, id);
|
||||||
@@ -37,7 +37,7 @@ public class ProfileController(IMediator mediator) : ControllerBase
|
|||||||
/// <returns>No content on success.</returns>
|
/// <returns>No content on success.</returns>
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> Put([FromBody] UpdateProfileProcedure procedure, CancellationToken cancel)
|
public async Task<IActionResult> Put([FromBody] UpdateProfileCommand procedure, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
await mediator.Send(procedure, cancel);
|
await mediator.Send(procedure, cancel);
|
||||||
return NoContent();
|
return NoContent();
|
||||||
@@ -51,7 +51,7 @@ public class ProfileController(IMediator mediator) : ControllerBase
|
|||||||
/// <returns>No content on success.</returns>
|
/// <returns>No content on success.</returns>
|
||||||
[HttpDelete]
|
[HttpDelete]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
public async Task<IActionResult> Delete([FromBody] DeleteProfileProcedure procedure, CancellationToken cancel)
|
public async Task<IActionResult> Delete([FromBody] DeleteProfileCommand procedure, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
await mediator.Send(procedure, cancel);
|
await mediator.Send(procedure, cancel);
|
||||||
return NoContent();
|
return NoContent();
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ public record InsertObjectProcedure : IRequest<long>
|
|||||||
public InsertActionProcedure Action { get; set; } = new();
|
public InsertActionProcedure Action { get; set; } = new();
|
||||||
public InsertEndpointCommand Endpoint { get; set; } = new();
|
public InsertEndpointCommand Endpoint { get; set; } = new();
|
||||||
public InsertEndpointAuthCommand EndpointAuth { get; set; } = new();
|
public InsertEndpointAuthCommand EndpointAuth { get; set; } = new();
|
||||||
public InsertProfileProcedure Profile { get; set; } = new();
|
public InsertProfileCommand Profile { get; set; } = new();
|
||||||
public InsertResultProcedure Result { get; set; } = new();
|
public InsertResultProcedure Result { get; set; } = new();
|
||||||
public InsertEndpointParamsCommand EndpointParams { get; set; } = new();
|
public InsertEndpointParamsCommand EndpointParams { get; set; } = new();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ using ReC.Application.Common.Procedures.DeleteProcedure;
|
|||||||
|
|
||||||
namespace ReC.Application.Profile.Commands;
|
namespace ReC.Application.Profile.Commands;
|
||||||
|
|
||||||
public record DeleteProfileProcedure : IDeleteProcedure
|
public record DeleteProfileCommand : IDeleteProcedure
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Start GUID/ID (inclusive)
|
/// Start GUID/ID (inclusive)
|
||||||
@@ -21,9 +21,9 @@ public record DeleteProfileProcedure : IDeleteProcedure
|
|||||||
public bool Force { get; set; }
|
public bool Force { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeleteProfileProcedureHandler(ISender sender) : IRequestHandler<DeleteProfileProcedure, int>
|
public class DeleteProfileProcedureHandler(ISender sender) : IRequestHandler<DeleteProfileCommand, int>
|
||||||
{
|
{
|
||||||
public async Task<int> Handle(DeleteProfileProcedure request, CancellationToken cancel)
|
public async Task<int> Handle(DeleteProfileCommand request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
return await sender.Send(new DeleteObjectProcedure
|
return await sender.Send(new DeleteObjectProcedure
|
||||||
{
|
{
|
||||||
@@ -3,7 +3,7 @@ using ReC.Application.Common.Procedures.InsertProcedure;
|
|||||||
|
|
||||||
namespace ReC.Application.Profile.Commands;
|
namespace ReC.Application.Profile.Commands;
|
||||||
|
|
||||||
public record InsertProfileProcedure : IInsertProcedure
|
public record InsertProfileCommand : IInsertProcedure
|
||||||
{
|
{
|
||||||
public bool? Active { get; set; }
|
public bool? Active { get; set; }
|
||||||
public byte? TypeId { get; set; }
|
public byte? TypeId { get; set; }
|
||||||
@@ -14,9 +14,9 @@ public record InsertProfileProcedure : IInsertProcedure
|
|||||||
public short? LanguageId { get; set; }
|
public short? LanguageId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InsertProfileProcedureHandler(ISender sender) : IRequestHandler<InsertProfileProcedure, long>
|
public class InsertProfileProcedureHandler(ISender sender) : IRequestHandler<InsertProfileCommand, long>
|
||||||
{
|
{
|
||||||
public async Task<long> Handle(InsertProfileProcedure request, CancellationToken cancel)
|
public async Task<long> Handle(InsertProfileCommand request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
return await sender.Send(new InsertObjectProcedure
|
return await sender.Send(new InsertObjectProcedure
|
||||||
{
|
{
|
||||||
@@ -4,16 +4,16 @@ using ReC.Application.Common.Procedures.UpdateProcedure.Dto;
|
|||||||
|
|
||||||
namespace ReC.Application.Profile.Commands;
|
namespace ReC.Application.Profile.Commands;
|
||||||
|
|
||||||
public record UpdateProfileProcedure : IUpdateProcedure<UpdateProfileDto>
|
public record UpdateProfileCommand : IUpdateProcedure<UpdateProfileDto>
|
||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
|
|
||||||
public UpdateProfileDto Data { get; set; } = null!;
|
public UpdateProfileDto Data { get; set; } = null!;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UpdateProfileProcedureHandler(ISender sender) : IRequestHandler<UpdateProfileProcedure, int>
|
public class UpdateProfileProcedureHandler(ISender sender) : IRequestHandler<UpdateProfileCommand, int>
|
||||||
{
|
{
|
||||||
public async Task<int> Handle(UpdateProfileProcedure request, CancellationToken cancel)
|
public async Task<int> Handle(UpdateProfileCommand request, CancellationToken cancel)
|
||||||
{
|
{
|
||||||
return await sender.Send(new UpdateObjectProcedure
|
return await sender.Send(new UpdateObjectProcedure
|
||||||
{
|
{
|
||||||
@@ -23,7 +23,7 @@ public class ProcedureExecutionTests : RecApplicationTestBase
|
|||||||
[Test]
|
[Test]
|
||||||
public async Task ExecuteInsertProcedure_runs_with_addedWho()
|
public async Task ExecuteInsertProcedure_runs_with_addedWho()
|
||||||
{
|
{
|
||||||
var procedure = new InsertProfileProcedure { Name = "name" };
|
var procedure = new InsertProfileCommand { Name = "name" };
|
||||||
|
|
||||||
var (sender, scope) = CreateScopedSender();
|
var (sender, scope) = CreateScopedSender();
|
||||||
using var _ = scope;
|
using var _ = scope;
|
||||||
@@ -35,7 +35,7 @@ public class ProcedureExecutionTests : RecApplicationTestBase
|
|||||||
[Test]
|
[Test]
|
||||||
public async Task ExecuteUpdateProcedure_runs_with_changedWho()
|
public async Task ExecuteUpdateProcedure_runs_with_changedWho()
|
||||||
{
|
{
|
||||||
var procedure = new UpdateProfileProcedure { Data = { Name = "updated" }, Id = 123 };
|
var procedure = new UpdateProfileCommand { Data = { Name = "updated" }, Id = 123 };
|
||||||
|
|
||||||
var (sender, scope) = CreateScopedSender();
|
var (sender, scope) = CreateScopedSender();
|
||||||
using var _ = scope;
|
using var _ = scope;
|
||||||
@@ -47,7 +47,7 @@ public class ProcedureExecutionTests : RecApplicationTestBase
|
|||||||
[Test]
|
[Test]
|
||||||
public async Task ExecuteDeleteProcedure_runs()
|
public async Task ExecuteDeleteProcedure_runs()
|
||||||
{
|
{
|
||||||
var procedure = new DeleteProfileProcedure { Start = 1, End = 2, Force = true };
|
var procedure = new DeleteProfileCommand { Start = 1, End = 2, Force = true };
|
||||||
|
|
||||||
var (sender, scope) = CreateScopedSender();
|
var (sender, scope) = CreateScopedSender();
|
||||||
using var _ = scope;
|
using var _ = scope;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class ProfileProcedureTests : RecApplicationTestBase
|
|||||||
[Test]
|
[Test]
|
||||||
public async Task InsertProfileProcedure_runs_via_mediator()
|
public async Task InsertProfileProcedure_runs_via_mediator()
|
||||||
{
|
{
|
||||||
var procedure = new InsertProfileProcedure { Active = true, TypeId = 1, Name = "name", Mandantor = "man" };
|
var procedure = new InsertProfileCommand { Active = true, TypeId = 1, Name = "name", Mandantor = "man" };
|
||||||
|
|
||||||
var (sender, scope) = CreateScopedSender();
|
var (sender, scope) = CreateScopedSender();
|
||||||
using var _ = scope;
|
using var _ = scope;
|
||||||
@@ -35,7 +35,7 @@ public class ProfileProcedureTests : RecApplicationTestBase
|
|||||||
[Test]
|
[Test]
|
||||||
public async Task UpdateProfileProcedure_runs_via_mediator()
|
public async Task UpdateProfileProcedure_runs_via_mediator()
|
||||||
{
|
{
|
||||||
var procedure = new UpdateProfileProcedure { Data = { Active = false, TypeId = 2, Name = "updated", Mandantor = "man2" }, Id = 45 };
|
var procedure = new UpdateProfileCommand { Data = { Active = false, TypeId = 2, Name = "updated", Mandantor = "man2" }, Id = 45 };
|
||||||
|
|
||||||
var (sender, scope) = CreateScopedSender();
|
var (sender, scope) = CreateScopedSender();
|
||||||
using var _ = scope;
|
using var _ = scope;
|
||||||
@@ -47,7 +47,7 @@ public class ProfileProcedureTests : RecApplicationTestBase
|
|||||||
[Test]
|
[Test]
|
||||||
public async Task DeleteProfileProcedure_runs_via_mediator()
|
public async Task DeleteProfileProcedure_runs_via_mediator()
|
||||||
{
|
{
|
||||||
var procedure = new DeleteProfileProcedure { Start = 9, End = 10, Force = false };
|
var procedure = new DeleteProfileCommand { Start = 9, End = 10, Force = false };
|
||||||
|
|
||||||
var (sender, scope) = CreateScopedSender();
|
var (sender, scope) = CreateScopedSender();
|
||||||
using var _ = scope;
|
using var _ = scope;
|
||||||
|
|||||||
Reference in New Issue
Block a user