Refactor DbModel options to use explicit, typed classes
Replaced the old generic, dictionary-based entity configuration system with a new, strongly-typed options structure under ReC.Application.Common.Options.DbModel. Introduced specific options classes for each major database view and result type, each with clear property mappings and defaults. Added a ViewOptions class for view/schema info. Removed all legacy entity mapping infrastructure, resulting in a more maintainable and type-safe configuration approach.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
namespace ReC.Application.Common.Options.DbModel;
|
||||
|
||||
public class BodyQueryResultOptions
|
||||
{
|
||||
public string RawBody { get; set; } = "REQUEST_BODY";
|
||||
}
|
||||
16
src/ReC.Application/Common/Options/DbModel/DbModelOptions.cs
Normal file
16
src/ReC.Application/Common/Options/DbModel/DbModelOptions.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
namespace ReC.Application.Common.Options.DbModel;
|
||||
|
||||
public class DbModelOptions
|
||||
{
|
||||
public RecActionViewOptions RecActionView { get; set; } = new();
|
||||
|
||||
public ProfileViewOptions ProfileView { get; set; } = new();
|
||||
|
||||
public ResultViewOptions ResultView { get; set; } = new();
|
||||
|
||||
public HeaderQueryResultOptions HeaderQueryResult { get; set; } = new();
|
||||
|
||||
public BodyQueryResultOptions BodyQueryResult { get; set; } = new();
|
||||
|
||||
public InsertObjectResultOptions InsertObjectResult { get; set; } = new();
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ReC.Application.Common.Options.DbModel;
|
||||
|
||||
public class HeaderQueryResultOptions
|
||||
{
|
||||
public string RawHeader { get; set; } = "REQUEST_HEADER";
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ReC.Application.Common.Options.DbModel;
|
||||
|
||||
public class InsertObjectResultOptions
|
||||
{
|
||||
public string NewObjectId { get; set; } = "oGUID";
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace ReC.Application.Common.Options.DbModel;
|
||||
|
||||
public class ProfileViewOptions
|
||||
{
|
||||
public ViewOptions View { get; set; } = new() { Name = "VWREC_PROFILE", Schema = "dbo" };
|
||||
|
||||
public string Id { get; set; } = "PROFILE_GUID";
|
||||
public string Active { get; set; } = "ACTIVE";
|
||||
public string TypeId { get; set; } = "TYPE_ID";
|
||||
public string Type { get; set; } = "TYPE";
|
||||
public string Mandantor { get; set; } = "MANDANTOR";
|
||||
public string ProfileName { get; set; } = "PROFILE_NAME";
|
||||
public string Description { get; set; } = "DESCRIPTION";
|
||||
public string LogLevelId { get; set; } = "LOG_LEVEL_ID";
|
||||
public string LogLevel { get; set; } = "LOG_LEVEL";
|
||||
public string LanguageId { get; set; } = "LANGUAGE_ID";
|
||||
public string Language { get; set; } = "LANGUAGE";
|
||||
public string AddedWho { get; set; } = "ADDED_WHO";
|
||||
public string AddedWhen { get; set; } = "ADDED_WHEN";
|
||||
public string ChangedWho { get; set; } = "CHANGED_WHO";
|
||||
public string ChangedWhen { get; set; } = "CHANGED_WHEN";
|
||||
public string FirstRun { get; set; } = "FIRST_RUN";
|
||||
public string LastRun { get; set; } = "LAST_RUN";
|
||||
public string LastResult { get; set; } = "LAST_RESULT";
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
namespace ReC.Application.Common.Options.DbModel;
|
||||
|
||||
public class RecActionViewOptions
|
||||
{
|
||||
public ViewOptions View { get; set; } = new() { Name = "VWREC_ACTION", Schema = "dbo" };
|
||||
|
||||
public string Id { get; set; } = "ACTION_GUID";
|
||||
public string ProfileId { get; set; } = "PROFILE_ID";
|
||||
public string ProfileName { get; set; } = "PROFILE_NAME";
|
||||
public string ProfileType { get; set; } = "PROFILE_TYPE_ID";
|
||||
public string Sequence { get; set; } = "SEQUENCE";
|
||||
public string EndpointId { get; set; } = "ENDPOINT_ID";
|
||||
public string EndpointUri { get; set; } = "ENDPOINT_URI";
|
||||
public string EndpointAuthId { get; set; } = "ENDPOINT_AUTH_ID";
|
||||
public string EndpointAuthType { get; set; } = "ENDPOINT_AUTH_TYPE_ID";
|
||||
public string EndpointAuthTypeName { get; set; } = "ENDPOINT_AUTH_TYPE";
|
||||
public string EndpointAuthApiKey { get; set; } = "ENDPOINT_AUTH_API_KEY";
|
||||
public string EndpointAuthApiValue { get; set; } = "ENDPOINT_AUTH_API_VALUE";
|
||||
public string EndpointAuthApiKeyAddTo { get; set; } = "ENDPOINT_AUTH_API_KEY_ADD_TO_ID";
|
||||
public string EndpointAuthApiKeyAddToName { get; set; } = "ENDPOINT_AUTH_API_KEY_ADD_TO";
|
||||
public string EndpointAuthToken { get; set; } = "ENDPOINT_AUTH_TOKEN";
|
||||
public string EndpointAuthUsername { get; set; } = "ENDPOINT_AUTH_USERNAME";
|
||||
public string EndpointAuthPassword { get; set; } = "ENDPOINT_AUTH_PASSWORD";
|
||||
public string EndpointAuthDomain { get; set; } = "ENDPOINT_AUTH_DOMAIN";
|
||||
public string EndpointAuthWorkstation { get; set; } = "ENDPOINT_AUTH_WORKSTATION";
|
||||
public string EndpointParamsId { get; set; } = "ENDPOINT_PARAMS_ID";
|
||||
public string SqlConnectionId { get; set; } = "SQL_CONNECTION_ID";
|
||||
public string SqlConnectionServer { get; set; } = "SQL_CONNECTION_SERVER";
|
||||
public string SqlConnectionDb { get; set; } = "SQL_CONNECTION_DB";
|
||||
public string SqlConnectionUsername { get; set; } = "SQL_CONNECTION_USERNAME";
|
||||
public string SqlConnectionPassword { get; set; } = "SQL_CONNECTION_PASSWORD";
|
||||
public string RestType { get; set; } = "REST_TYPE_ID";
|
||||
public string RestTypeName { get; set; } = "REST_TYPE";
|
||||
public string PreprocessingQuery { get; set; } = "PREPROCESSING_QUERY";
|
||||
public string HeaderQuery { get; set; } = "HEADER_QUERY";
|
||||
public string BodyQuery { get; set; } = "BODY_QUERY";
|
||||
public string PostprocessingQuery { get; set; } = "POSTPROCESSING_QUERY";
|
||||
public string ErrorAction { get; set; } = "ERROR_ACTION_ID";
|
||||
public string ErrorActionName { get; set; } = "ERROR_ACTION";
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
namespace ReC.Application.Common.Options.DbModel;
|
||||
|
||||
public class ResultViewOptions
|
||||
{
|
||||
public ViewOptions View { get; set; } = new() { Name = "VWREC_RESULT", Schema = "dbo" };
|
||||
|
||||
public string Id { get; set; } = "RESULT_GUID";
|
||||
public string ActionId { get; set; } = "ACTION_ID";
|
||||
public string ProfileId { get; set; } = "PROFILE_ID";
|
||||
public string ProfileName { get; set; } = "PROFILE_NAME";
|
||||
public string StatusCode { get; set; } = "STATUS_ID";
|
||||
public string StatusName { get; set; } = "STATUS";
|
||||
public string Type { get; set; } = "RESULT_TYPE_ID";
|
||||
public string TypeName { get; set; } = "RESULT_TYPE";
|
||||
public string Header { get; set; } = "RESULT_HEADER";
|
||||
public string Body { get; set; } = "RESULT_BODY";
|
||||
public string Info { get; set; } = "RESULT_INFO";
|
||||
public string Error { get; set; } = "RESULT_ERROR";
|
||||
public string AddedWho { get; set; } = "ADDED_WHO";
|
||||
public string AddedWhen { get; set; } = "ADDED_WHEN";
|
||||
public string ChangedWho { get; set; } = "CHANGED_WHO";
|
||||
public string ChangedWhen { get; set; } = "CHANGED_WHEN";
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ReC.Application.Common.Options.DbModel;
|
||||
|
||||
public class ViewOptions
|
||||
{
|
||||
public string Name { get; set; } = null!;
|
||||
|
||||
public string Schema { get; set; } = "dbo";
|
||||
}
|
||||
Reference in New Issue
Block a user