diff --git a/src/ReC.Application/Common/Procedures/InsertObjectProcedure.cs b/src/ReC.Application/Common/Procedures/InsertObjectProcedure.cs index 1ab6e6c..79800ca 100644 --- a/src/ReC.Application/Common/Procedures/InsertObjectProcedure.cs +++ b/src/ReC.Application/Common/Procedures/InsertObjectProcedure.cs @@ -8,91 +8,84 @@ namespace ReC.Application.Common.Procedures; public record InsertObjectProcedure : IRequest { - #region Common - - /// - /// Target entity: ACTION, ENDPOINT, ENDPOINT_AUTH, ENDPOINT_PARAMS, PROFILE, RESULT - /// public string Entity { get; set; } = "ACTION"; public string? AddedWho { get; set; } - public DateTime? AddedWhen { get; set; } - #endregion + public ActionInfo Action { get; init; } = new(); + public EndpointInfo Endpoint { get; init; } = new(); + public EndpointAuthInfo EndpointAuth { get; init; } = new(); + public ProfileInfo Profile { get; init; } = new(); + public ResultInfo Result { get; init; } = new(); + public EndpointParamsInfo EndpointParams { get; init; } = new(); - #region ACTION + public record ActionInfo + { + 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 long? ActionProfileId { get; set; } - public bool? ActionActive { get; set; } - public byte? ActionSequence { get; set; } - public long? ActionEndpointId { get; set; } - public long? ActionEndpointAuthId { get; set; } - public short? ActionEndpointParamsId { get; set; } - public short? ActionSqlConnectionId { get; set; } - public byte? ActionTypeId { get; set; } - public string? ActionPreSql { get; set; } - public string? ActionHeaderSql { get; set; } - public string? ActionBodySql { get; set; } - public string? ActionPostSql { get; set; } - public byte? ActionErrorActionId { get; set; } + public record EndpointInfo + { + public bool? Active { get; set; } + public string? Description { get; set; } + public string? Uri { get; set; } + } - #endregion + public record EndpointAuthInfo + { + public bool? Active { get; set; } + public string? Description { get; set; } + public byte? TypeId { get; set; } + public string? ApiKey { get; set; } + public string? ApiValue { get; set; } + public bool? ApiKeyAddToId { get; set; } + public string? Token { get; set; } + public string? Username { get; set; } + public string? Password { get; set; } + public string? Domain { get; set; } + public string? Workstation { get; set; } + } - #region ENDPOINT + public record ProfileInfo + { + 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 bool? EndpointActive { get; set; } - public string? EndpointDescription { get; set; } - public string? EndpointUri { get; set; } + public record ResultInfo + { + public long? ActionId { get; set; } + public short? StatusId { get; set; } + public string? Header { get; set; } + public string? Body { get; set; } + } - #endregion - - #region ENDPOINT_AUTH - - public bool? EndpointAuthActive { get; set; } - public string? EndpointAuthDescription { get; set; } - public byte? EndpointAuthTypeId { get; set; } - public string? EndpointAuthApiKey { get; set; } - public string? EndpointAuthApiValue { get; set; } - public bool? EndpointAuthApiKeyAddToId { get; set; } - public string? EndpointAuthToken { get; set; } - public string? EndpointAuthUsername { get; set; } - public string? EndpointAuthPassword { get; set; } - public string? EndpointAuthDomain { get; set; } - public string? EndpointAuthWorkstation { get; set; } - - #endregion - - #region PROFILE - - public bool? ProfileActive { get; set; } - public byte? ProfileTypeId { get; set; } - public string? ProfileMandantor { get; set; } - public string? ProfileName { get; set; } - public string? ProfileDescription { get; set; } - public byte? ProfileLogLevelId { get; set; } - public short? ProfileLanguageId { get; set; } - - #endregion - - #region RESULT - - public long? ResultActionId { get; set; } - public short? ResultStatusId { get; set; } - public string? ResultHeader { get; set; } - public string? ResultBody { get; set; } - - #endregion - - #region ENDPOINT_PARAMS - - public bool? EndpointParamsActive { get; set; } - public string? EndpointParamsDescription { get; set; } - public short? EndpointParamsGroupId { get; set; } - public byte? EndpointParamsSequence { get; set; } - public string? EndpointParamsKey { get; set; } - public string? EndpointParamsValue { get; set; } - - #endregion + public record EndpointParamsInfo + { + public bool? Active { get; set; } + public string? Description { get; set; } + public short? GroupId { get; set; } + public byte? Sequence { get; set; } + public string? Key { get; set; } + public string? Value { get; set; } + } } public class InsertObjectProcedureHandler(IRepository repo) : IRequestHandler @@ -104,57 +97,57 @@ public class InsertObjectProcedureHandler(IRepository repo) : IRequestHandler