diff --git a/src/ReC.API/Controllers/ProfileController.cs b/src/ReC.API/Controllers/ProfileController.cs index 761d166..ac0f906 100644 --- a/src/ReC.API/Controllers/ProfileController.cs +++ b/src/ReC.API/Controllers/ProfileController.cs @@ -23,7 +23,7 @@ public class ProfileController(IMediator mediator) : ControllerBase /// The created profile identifier. [HttpPost] [ProducesResponseType(StatusCodes.Status201Created)] - public async Task Post([FromBody] InsertProfileProcedure procedure, CancellationToken cancel) + public async Task Post([FromBody] InsertProfileCommand procedure, CancellationToken cancel) { var id = await mediator.Send(procedure, cancel); return CreatedAtAction(nameof(Get), new { id }, id); @@ -37,7 +37,7 @@ public class ProfileController(IMediator mediator) : ControllerBase /// No content on success. [HttpPut] [ProducesResponseType(StatusCodes.Status204NoContent)] - public async Task Put([FromBody] UpdateProfileProcedure procedure, CancellationToken cancel) + public async Task Put([FromBody] UpdateProfileCommand procedure, CancellationToken cancel) { await mediator.Send(procedure, cancel); return NoContent(); @@ -51,7 +51,7 @@ public class ProfileController(IMediator mediator) : ControllerBase /// No content on success. [HttpDelete] [ProducesResponseType(StatusCodes.Status204NoContent)] - public async Task Delete([FromBody] DeleteProfileProcedure procedure, CancellationToken cancel) + public async Task Delete([FromBody] DeleteProfileCommand procedure, CancellationToken cancel) { await mediator.Send(procedure, cancel); return NoContent(); diff --git a/src/ReC.Application/Common/Procedures/InsertProcedure/InsertObjectProcedure.cs b/src/ReC.Application/Common/Procedures/InsertProcedure/InsertObjectProcedure.cs index 1b4102e..ccf3f33 100644 --- a/src/ReC.Application/Common/Procedures/InsertProcedure/InsertObjectProcedure.cs +++ b/src/ReC.Application/Common/Procedures/InsertProcedure/InsertObjectProcedure.cs @@ -27,7 +27,7 @@ public record InsertObjectProcedure : IRequest public InsertActionProcedure Action { get; set; } = new(); public InsertEndpointCommand Endpoint { 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 InsertEndpointParamsCommand EndpointParams { get; set; } = new(); } diff --git a/src/ReC.Application/Profile/Commands/DeleteProfileProcedure.cs b/src/ReC.Application/Profile/Commands/DeleteProfileCommand.cs similarity index 80% rename from src/ReC.Application/Profile/Commands/DeleteProfileProcedure.cs rename to src/ReC.Application/Profile/Commands/DeleteProfileCommand.cs index 085d4a3..c7183c5 100644 --- a/src/ReC.Application/Profile/Commands/DeleteProfileProcedure.cs +++ b/src/ReC.Application/Profile/Commands/DeleteProfileCommand.cs @@ -3,7 +3,7 @@ using ReC.Application.Common.Procedures.DeleteProcedure; namespace ReC.Application.Profile.Commands; -public record DeleteProfileProcedure : IDeleteProcedure +public record DeleteProfileCommand : IDeleteProcedure { /// /// Start GUID/ID (inclusive) @@ -21,9 +21,9 @@ public record DeleteProfileProcedure : IDeleteProcedure public bool Force { get; set; } } -public class DeleteProfileProcedureHandler(ISender sender) : IRequestHandler +public class DeleteProfileProcedureHandler(ISender sender) : IRequestHandler { - public async Task Handle(DeleteProfileProcedure request, CancellationToken cancel) + public async Task Handle(DeleteProfileCommand request, CancellationToken cancel) { return await sender.Send(new DeleteObjectProcedure { diff --git a/src/ReC.Application/Profile/Commands/InsertProfileProcedure.cs b/src/ReC.Application/Profile/Commands/InsertProfileCommand.cs similarity index 76% rename from src/ReC.Application/Profile/Commands/InsertProfileProcedure.cs rename to src/ReC.Application/Profile/Commands/InsertProfileCommand.cs index d669e12..e79e3fc 100644 --- a/src/ReC.Application/Profile/Commands/InsertProfileProcedure.cs +++ b/src/ReC.Application/Profile/Commands/InsertProfileCommand.cs @@ -3,7 +3,7 @@ using ReC.Application.Common.Procedures.InsertProcedure; namespace ReC.Application.Profile.Commands; -public record InsertProfileProcedure : IInsertProcedure +public record InsertProfileCommand : IInsertProcedure { public bool? Active { get; set; } public byte? TypeId { get; set; } @@ -14,9 +14,9 @@ public record InsertProfileProcedure : IInsertProcedure public short? LanguageId { get; set; } } -public class InsertProfileProcedureHandler(ISender sender) : IRequestHandler +public class InsertProfileProcedureHandler(ISender sender) : IRequestHandler { - public async Task Handle(InsertProfileProcedure request, CancellationToken cancel) + public async Task Handle(InsertProfileCommand request, CancellationToken cancel) { return await sender.Send(new InsertObjectProcedure { diff --git a/src/ReC.Application/Profile/Commands/UpdateProfileProcedure.cs b/src/ReC.Application/Profile/Commands/UpdateProfileCommand.cs similarity index 71% rename from src/ReC.Application/Profile/Commands/UpdateProfileProcedure.cs rename to src/ReC.Application/Profile/Commands/UpdateProfileCommand.cs index f339f8d..1f0791d 100644 --- a/src/ReC.Application/Profile/Commands/UpdateProfileProcedure.cs +++ b/src/ReC.Application/Profile/Commands/UpdateProfileCommand.cs @@ -4,16 +4,16 @@ using ReC.Application.Common.Procedures.UpdateProcedure.Dto; namespace ReC.Application.Profile.Commands; -public record UpdateProfileProcedure : IUpdateProcedure +public record UpdateProfileCommand : IUpdateProcedure { public long Id { get; set; } public UpdateProfileDto Data { get; set; } = null!; } -public class UpdateProfileProcedureHandler(ISender sender) : IRequestHandler +public class UpdateProfileProcedureHandler(ISender sender) : IRequestHandler { - public async Task Handle(UpdateProfileProcedure request, CancellationToken cancel) + public async Task Handle(UpdateProfileCommand request, CancellationToken cancel) { return await sender.Send(new UpdateObjectProcedure { diff --git a/tests/ReC.Tests/Application/Procedures/ProcedureExecutionTests.cs b/tests/ReC.Tests/Application/Procedures/ProcedureExecutionTests.cs index 5afa4c5..f609691 100644 --- a/tests/ReC.Tests/Application/Procedures/ProcedureExecutionTests.cs +++ b/tests/ReC.Tests/Application/Procedures/ProcedureExecutionTests.cs @@ -23,7 +23,7 @@ public class ProcedureExecutionTests : RecApplicationTestBase [Test] public async Task ExecuteInsertProcedure_runs_with_addedWho() { - var procedure = new InsertProfileProcedure { Name = "name" }; + var procedure = new InsertProfileCommand { Name = "name" }; var (sender, scope) = CreateScopedSender(); using var _ = scope; @@ -35,7 +35,7 @@ public class ProcedureExecutionTests : RecApplicationTestBase [Test] 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(); using var _ = scope; @@ -47,7 +47,7 @@ public class ProcedureExecutionTests : RecApplicationTestBase [Test] 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(); using var _ = scope; diff --git a/tests/ReC.Tests/Application/Profile/ProfileProcedureTests.cs b/tests/ReC.Tests/Application/Profile/ProfileProcedureTests.cs index 501e783..23f6955 100644 --- a/tests/ReC.Tests/Application/Profile/ProfileProcedureTests.cs +++ b/tests/ReC.Tests/Application/Profile/ProfileProcedureTests.cs @@ -23,7 +23,7 @@ public class ProfileProcedureTests : RecApplicationTestBase [Test] 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(); using var _ = scope; @@ -35,7 +35,7 @@ public class ProfileProcedureTests : RecApplicationTestBase [Test] 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(); using var _ = scope; @@ -47,7 +47,7 @@ public class ProfileProcedureTests : RecApplicationTestBase [Test] 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(); using var _ = scope;