Refactor entity selection to use EntityType enum

Replaced string-based entity identifiers in CRUD procedure and command classes with a strongly-typed EntityType enum. Updated all relevant handlers and records to use the new enum property, improving type safety and maintainability. Added necessary using directives and updated documentation comments to reflect these changes.
This commit is contained in:
2026-04-16 17:14:29 +02:00
parent d61f5ce885
commit 6681e56afc
21 changed files with 48 additions and 30 deletions

View File

@@ -1,5 +1,6 @@
using MediatR;
using ReC.Application.Common.Procedures.DeleteProcedure;
using ReC.Application.Common.Procedures;
namespace ReC.Application.Endpoints.Commands;
@@ -27,7 +28,7 @@ public class DeleteEndpointProcedureHandler(ISender sender) : IRequestHandler<De
{
return await sender.Send(new DeleteObjectProcedure
{
Entity = "ENDPOINT",
Entity = EntityType.Endpoint,
Start = request.Start,
End = request.End,
Force = request.Force

View File

@@ -1,5 +1,6 @@
using MediatR;
using MediatR;
using ReC.Application.Common.Procedures.InsertProcedure;
using ReC.Application.Common.Procedures;
namespace ReC.Application.Endpoints.Commands;
@@ -16,7 +17,7 @@ public class InsertEndpointProcedureHandler(ISender sender) : IRequestHandler<In
{
return await sender.Send(new InsertObjectProcedure
{
Entity = "ENDPOINT",
Entity = EntityType.Endpoint,
Endpoint = request
}, cancel);
}

View File

@@ -1,6 +1,7 @@
using MediatR;
using ReC.Application.Common.Procedures.UpdateProcedure;
using ReC.Application.Common.Procedures.UpdateProcedure.Dto;
using ReC.Application.Common.Procedures;
namespace ReC.Application.Endpoints.Commands;
@@ -17,7 +18,7 @@ public class UpdateEndpointProcedureHandler(ISender sender) : IRequestHandler<Up
{
return await sender.Send(new UpdateObjectProcedure
{
Entity = "ENDPOINT",
Entity = EntityType.Endpoint,
Id = request.Id,
Endpoint = request.Data
}, cancel);