Refactor procedure classes into feature-based namespaces

Moved Insert, Update, and Delete procedure records for Action, Profile, and Result entities from common namespaces to feature-specific namespaces. Updated all relevant using directives and controller references. No logic changes; this improves code organization and maintainability.
This commit is contained in:
2026-01-16 09:34:41 +01:00
parent 82de285891
commit f6b95331e1
13 changed files with 31 additions and 9 deletions

View File

@@ -1,30 +0,0 @@
namespace ReC.Application.Common.Procedures.DeleteProcedure;
public record DeleteActionProcedure : IDeleteProcedure
{
/// <summary>
/// Start GUID/ID (inclusive)
/// </summary>
public long Start { get; set; }
/// <summary>
/// End GUID/ID (inclusive). If 0, will be set to Start value.
/// </summary>
public long End { get; set; }
/// <summary>
/// If true, delete even if dependent RESULT data exists
/// </summary>
public bool Force { get; set; }
public DeleteObjectProcedure ToObjectProcedure()
{
return new DeleteObjectProcedure
{
Entity = "ACTION",
Start = Start,
End = End,
Force = Force
};
}
}

View File

@@ -1,30 +0,0 @@
namespace ReC.Application.Common.Procedures.DeleteProcedure;
public record DeleteProfileProcedure : IDeleteProcedure
{
/// <summary>
/// Start GUID/ID (inclusive)
/// </summary>
public long Start { get; set; }
/// <summary>
/// End GUID/ID (inclusive). If 0, will be set to Start value.
/// </summary>
public long End { get; set; }
/// <summary>
/// If true, delete even if dependent ACTION data exists
/// </summary>
public bool Force { get; set; }
public DeleteObjectProcedure ToObjectProcedure()
{
return new DeleteObjectProcedure
{
Entity = "PROFILE",
Start = Start,
End = End,
Force = Force
};
}
}

View File

@@ -1,30 +0,0 @@
namespace ReC.Application.Common.Procedures.DeleteProcedure;
public record DeleteResultProcedure : IDeleteProcedure
{
/// <summary>
/// Start GUID/ID (inclusive)
/// </summary>
public long Start { get; set; }
/// <summary>
/// End GUID/ID (inclusive). If 0, will be set to Start value.
/// </summary>
public long End { get; set; }
/// <summary>
/// Force parameter (not used for RESULT entity as it has no dependencies)
/// </summary>
public bool Force { get; set; }
public DeleteObjectProcedure ToObjectProcedure()
{
return new DeleteObjectProcedure
{
Entity = "RESULT",
Start = Start,
End = End,
Force = Force
};
}
}

View File

@@ -1,27 +0,0 @@
namespace ReC.Application.Common.Procedures.InsertProcedure;
public record InsertActionProcedure : IInsertProcedure
{
public long? ProfileId { get; set; }
public bool? Active { get; set; }
public byte? Sequence { get; set; }
public long? EndpointId { get; set; }
public long? EndpointAuthId { get; set; }
public short? EndpointParamsId { get; set; }
public short? SqlConnectionId { get; set; }
public byte? TypeId { get; set; }
public string? PreSql { get; set; }
public string? HeaderSql { get; set; }
public string? BodySql { get; set; }
public string? PostSql { get; set; }
public byte? ErrorActionId { get; set; }
public InsertObjectProcedure ToObjectProcedure(string? addedWho = null)
{
return new InsertObjectProcedure
{
Entity = "ACTION",
Action = this
}.AddedBy(addedWho);
}
}

View File

@@ -2,6 +2,8 @@
using MediatR;
using Microsoft.Data.SqlClient;
using ReC.Application.Common.Exceptions;
using ReC.Application.OutResults.Commands;
using ReC.Application.Profile.Commands;
namespace ReC.Application.Common.Procedures.InsertProcedure;

View File

@@ -1,21 +0,0 @@
namespace ReC.Application.Common.Procedures.InsertProcedure;
public record InsertProfileProcedure : IInsertProcedure
{
public bool? Active { get; set; }
public byte? TypeId { get; set; }
public string? Mandantor { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public byte? LogLevelId { get; set; }
public short? LanguageId { get; set; }
public InsertObjectProcedure ToObjectProcedure(string? addedWho = null)
{
return new InsertObjectProcedure
{
Entity = "PROFILE",
Profile = this
}.AddedBy(addedWho);
}
}

View File

@@ -1,18 +0,0 @@
namespace ReC.Application.Common.Procedures.InsertProcedure;
public record InsertResultProcedure : IInsertProcedure
{
public long? ActionId { get; set; }
public short? StatusId { get; set; }
public string? Header { get; set; }
public string? Body { get; set; }
public InsertObjectProcedure ToObjectProcedure(string? addedWho = null)
{
return new InsertObjectProcedure
{
Entity = "RESULT",
Result = this
}.AddedBy(addedWho ?? "Rec.API");
}
}

View File

@@ -1,28 +0,0 @@
namespace ReC.Application.Common.Procedures.UpdateProcedure;
public record UpdateActionProcedure : IUpdateProcedure
{
public long? ProfileId { get; set; }
public bool? Active { get; set; }
public byte? Sequence { get; set; }
public long? EndpointId { get; set; }
public long? EndpointAuthId { get; set; }
public short? EndpointParamsId { get; set; }
public short? SqlConnectionId { get; set; }
public byte? TypeId { get; set; }
public string? PreSql { get; set; }
public string? HeaderSql { get; set; }
public string? BodySql { get; set; }
public string? PostSql { get; set; }
public byte? ErrorActionId { get; set; }
public UpdateObjectProcedure ToObjectProcedure(long guid, string? changedWho = null)
{
return new UpdateObjectProcedure
{
Entity = "ACTION",
Guid = guid,
Action = this
}.ChangedBy(changedWho);
}
}

View File

@@ -2,6 +2,9 @@ using DigitalData.Core.Abstraction.Application.Repository;
using MediatR;
using Microsoft.Data.SqlClient;
using ReC.Application.Common.Exceptions;
using ReC.Application.OutResults.Commands;
using ReC.Application.Profile.Commands;
using ReC.Application.RecActions.Commands;
namespace ReC.Application.Common.Procedures.UpdateProcedure;

View File

@@ -1,25 +0,0 @@
namespace ReC.Application.Common.Procedures.UpdateProcedure;
public record UpdateProfileProcedure : IUpdateProcedure
{
public bool? Active { get; set; }
public byte? TypeId { get; set; }
public string? Mandantor { get; set; }
public string? Name { get; set; }
public string? Description { get; set; }
public byte? LogLevelId { get; set; }
public short? LanguageId { get; set; }
public DateTime? FirstRun { get; set; }
public DateTime? LastRun { get; set; }
public string? LastResult { get; set; }
public UpdateObjectProcedure ToObjectProcedure(long guid, string? changedWho = null)
{
return new UpdateObjectProcedure
{
Entity = "PROFILE",
Guid = guid,
Profile = this
}.ChangedBy(changedWho);
}
}

View File

@@ -1,19 +0,0 @@
namespace ReC.Application.Common.Procedures.UpdateProcedure;
public record UpdateResultProcedure : IUpdateProcedure
{
public long? ActionId { get; set; }
public short? StatusId { get; set; }
public string? Header { get; set; }
public string? Body { get; set; }
public UpdateObjectProcedure ToObjectProcedure(long guid, string? changedWho = null)
{
return new UpdateObjectProcedure
{
Entity = "RESULT",
Guid = guid,
Result = this
}.ChangedBy(changedWho);
}
}