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:
@@ -11,9 +11,9 @@ namespace ReC.Application.Common.Procedures.DeleteProcedure;
|
||||
public record DeleteObjectProcedure : IRequest<int>
|
||||
{
|
||||
/// <summary>
|
||||
/// Target entity: ACTION, ENDPOINT, ENDPOINT_AUTH, ENDPOINT_PARAMS, PROFILE, RESULT
|
||||
/// Target entity for the delete operation.
|
||||
/// </summary>
|
||||
public string Entity { get; set; } = null!;
|
||||
public required EntityType Entity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Start GUID/ID (inclusive)
|
||||
|
||||
@@ -18,9 +18,9 @@ namespace ReC.Application.Common.Procedures.InsertProcedure;
|
||||
public record InsertObjectProcedure : IRequest<long>
|
||||
{
|
||||
/// <summary>
|
||||
/// Target entity: ACTION, ENDPOINT, ENDPOINT_AUTH, ENDPOINT_PARAMS, PROFILE, RESULT
|
||||
/// Target entity for the insert operation.
|
||||
/// </summary>
|
||||
public string Entity { get; set; } = null!;
|
||||
public required EntityType Entity { get; set; }
|
||||
|
||||
//TODO: update to set in authentication middleware or similar, and remove from procedure properties
|
||||
internal string? AddedWho { get; private set; } = "ReC.API";
|
||||
|
||||
@@ -13,9 +13,9 @@ namespace ReC.Application.Common.Procedures.UpdateProcedure;
|
||||
public record UpdateObjectProcedure : IRequest<int>
|
||||
{
|
||||
/// <summary>
|
||||
/// Target entity: ACTION, ENDPOINT, ENDPOINT_AUTH, ENDPOINT_PARAMS, PROFILE, RESULT
|
||||
/// Target entity for the update operation.
|
||||
/// </summary>
|
||||
public string Entity { get; set; } = null!;
|
||||
public required EntityType Entity { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Target GUID to update (required)
|
||||
|
||||
Reference in New Issue
Block a user