refactoring
This commit is contained in:
@@ -7,6 +7,7 @@ public class ConfigTransferPackage
|
||||
public bool IncludesSecrets { get; set; }
|
||||
public ConfigTransferSharePoint? SharePointConfig { get; set; }
|
||||
public ConfigTransferExportSettings? ExportSettings { get; set; }
|
||||
public List<ConfigTransferSourceSystemDefinition> SourceSystemDefinitions { get; set; } = [];
|
||||
public List<ConfigTransferCurrencyExchangeRate> CurrencyExchangeRates { get; set; } = [];
|
||||
public List<ConfigTransferHanaServer> HanaServers { get; set; } = [];
|
||||
public List<ConfigTransferSite> Sites { get; set; } = [];
|
||||
@@ -16,6 +17,17 @@ public class ConfigTransferPackage
|
||||
public List<ConfigTransferSapFieldMapping> SapFieldMappings { get; set; } = [];
|
||||
}
|
||||
|
||||
public class ConfigTransferSourceSystemDefinition
|
||||
{
|
||||
public string Code { get; set; } = string.Empty;
|
||||
public string DisplayName { get; set; } = string.Empty;
|
||||
public string ConnectionKind { get; set; } = SourceSystemConnectionKinds.Hana;
|
||||
public bool IsActive { get; set; } = true;
|
||||
public string CentralServiceUrl { get; set; } = string.Empty;
|
||||
public string? CentralUsername { get; set; }
|
||||
public string? CentralPassword { get; set; }
|
||||
}
|
||||
|
||||
public class ConfigTransferSharePoint
|
||||
{
|
||||
public string SiteUrl { get; set; } = string.Empty;
|
||||
@@ -35,12 +47,6 @@ public class ConfigTransferExportSettings
|
||||
public bool DebugLoggingEnabled { get; set; }
|
||||
public string LocalSiteExportFolder { get; set; } = string.Empty;
|
||||
public string LocalConsolidatedExportFolder { get; set; } = string.Empty;
|
||||
public string? SapUsername { get; set; }
|
||||
public string? SapPassword { get; set; }
|
||||
public string? Bi1Username { get; set; }
|
||||
public string? Bi1Password { get; set; }
|
||||
public string? SageUsername { get; set; }
|
||||
public string? SagePassword { get; set; }
|
||||
}
|
||||
|
||||
public class ConfigTransferCurrencyExchangeRate
|
||||
@@ -57,11 +63,10 @@ public class ConfigTransferCurrencyExchangeRate
|
||||
public class ConfigTransferHanaServer
|
||||
{
|
||||
public string Key { get; set; } = Guid.NewGuid().ToString("N");
|
||||
public string SourceSystem { get; set; } = string.Empty;
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Host { get; set; } = string.Empty;
|
||||
public int Port { get; set; } = 30015;
|
||||
public string? Username { get; set; }
|
||||
public string? Password { get; set; }
|
||||
public string DatabaseName { get; set; } = string.Empty;
|
||||
public bool UseSsl { get; set; }
|
||||
public bool ValidateCertificate { get; set; }
|
||||
@@ -75,7 +80,7 @@ public class ConfigTransferSite
|
||||
public string Schema { get; set; } = string.Empty;
|
||||
public string TSC { get; set; } = string.Empty;
|
||||
public string Land { get; set; } = string.Empty;
|
||||
public string SourceSystem { get; set; } = "SAP";
|
||||
public string SourceSystem { get; set; } = string.Empty;
|
||||
public string? UsernameOverride { get; set; }
|
||||
public string? PasswordOverride { get; set; }
|
||||
public string LocalExportFolderOverride { get; set; } = string.Empty;
|
||||
|
||||
@@ -10,10 +10,4 @@ public class ExportSettings
|
||||
public bool DebugLoggingEnabled { get; set; }
|
||||
public string LocalSiteExportFolder { get; set; } = string.Empty;
|
||||
public string LocalConsolidatedExportFolder { get; set; } = string.Empty;
|
||||
public string SapUsername { get; set; } = string.Empty;
|
||||
public string SapPassword { get; set; } = string.Empty;
|
||||
public string Bi1Username { get; set; } = string.Empty;
|
||||
public string Bi1Password { get; set; } = string.Empty;
|
||||
public string SageUsername { get; set; } = string.Empty;
|
||||
public string SagePassword { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ public class FieldTransformationRule
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public string SourceSystem { get; set; } = "SAP";
|
||||
public string SourceSystem { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string SourceField { get; set; } = nameof(SalesRecord.Material);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace TrafagSalesExporter.Models;
|
||||
@@ -7,6 +8,9 @@ public class HanaServer
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public string SourceSystem { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
@@ -15,8 +19,10 @@ public class HanaServer
|
||||
|
||||
public int Port { get; set; } = 30015;
|
||||
|
||||
[NotMapped]
|
||||
public string Username { get; set; } = string.Empty;
|
||||
|
||||
[NotMapped]
|
||||
public string Password { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
@@ -66,6 +72,7 @@ public class HanaServer
|
||||
var pwdMasked = string.IsNullOrEmpty(Password) ? "" : "***";
|
||||
var copy = new HanaServer
|
||||
{
|
||||
SourceSystem = SourceSystem,
|
||||
Host = Host,
|
||||
Port = Port,
|
||||
Username = Username,
|
||||
|
||||
@@ -22,7 +22,7 @@ public class Site
|
||||
public string Land { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string SourceSystem { get; set; } = "SAP";
|
||||
public string SourceSystem { get; set; } = string.Empty;
|
||||
|
||||
public string UsernameOverride { get; set; } = string.Empty;
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace TrafagSalesExporter.Models;
|
||||
|
||||
public class SourceSystemDefinition
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public string Code { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string DisplayName { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public string ConnectionKind { get; set; } = SourceSystemConnectionKinds.Hana;
|
||||
|
||||
public bool IsActive { get; set; } = true;
|
||||
|
||||
public string CentralServiceUrl { get; set; } = string.Empty;
|
||||
|
||||
public string CentralUsername { get; set; } = string.Empty;
|
||||
|
||||
public string CentralPassword { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public static class SourceSystemConnectionKinds
|
||||
{
|
||||
public const string Hana = "HANA";
|
||||
public const string SapGateway = "SAP_GATEWAY";
|
||||
public const string ManualExcel = "MANUAL_EXCEL";
|
||||
|
||||
public static readonly string[] All = [Hana, SapGateway, ManualExcel];
|
||||
}
|
||||
Reference in New Issue
Block a user