namespace TrafagSalesExporter.Models; public class ConfigTransferPackage { public int Version { get; set; } = 1; public DateTime ExportedAtUtc { get; set; } = DateTime.UtcNow; public bool IncludesSecrets { get; set; } public ConfigTransferSharePoint? SharePointConfig { get; set; } public ConfigTransferExportSettings? ExportSettings { get; set; } public List SourceSystemDefinitions { get; set; } = []; public List CurrencyExchangeRates { get; set; } = []; public List FinanceReferences { get; set; } = []; public List FinanceIntercompanyRules { get; set; } = []; public List FinanceRules { get; set; } = []; public List HanaServers { get; set; } = []; public List Sites { get; set; } = []; public List FieldTransformationRules { get; set; } = []; public List SapSourceDefinitions { get; set; } = []; public List SapJoinDefinitions { get; set; } = []; public List SapFieldMappings { get; set; } = []; public List ManualExcelColumnMappings { 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; public string ExportFolder { get; set; } = string.Empty; public string CentralExportFolder { get; set; } = string.Empty; public string TenantId { get; set; } = string.Empty; public string ClientId { get; set; } = string.Empty; public string? ClientSecret { get; set; } } public class ConfigTransferExportSettings { public string DateFilter { get; set; } = "2025-01-01"; public int TimerHour { get; set; } = 3; public int TimerMinute { get; set; } public bool TimerEnabled { get; set; } = true; public bool DebugLoggingEnabled { get; set; } public string LocalSiteExportFolder { get; set; } = string.Empty; public string LocalConsolidatedExportFolder { get; set; } = string.Empty; } public class ConfigTransferCurrencyExchangeRate { public string FromCurrency { get; set; } = string.Empty; public string ToCurrency { get; set; } = string.Empty; public decimal Rate { get; set; } public DateTime ValidFrom { get; set; } public DateTime? ValidTo { get; set; } public string Notes { get; set; } = string.Empty; public bool IsActive { get; set; } = true; } public class ConfigTransferFinanceReference { public string Key { get; set; } = string.Empty; public string Label { get; set; } = string.Empty; public int Year { get; set; } = 2025; public decimal? LocalCurrencyValue { get; set; } public decimal? CheckValue { get; set; } public string Notes { get; set; } = string.Empty; public bool IsActive { get; set; } = true; } public class ConfigTransferFinanceIntercompanyRule { public string ScopeKey { get; set; } = string.Empty; public string CustomerNumber { get; set; } = string.Empty; public string CustomerNameContains { get; set; } = string.Empty; public string Notes { get; set; } = string.Empty; public bool IsActive { get; set; } = true; } 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 DatabaseName { get; set; } = string.Empty; public bool UseSsl { get; set; } public bool ValidateCertificate { get; set; } public string AdditionalParams { get; set; } = string.Empty; } public class ConfigTransferSite { public string Key { get; set; } = Guid.NewGuid().ToString("N"); public string? HanaServerKey { get; set; } 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; } = string.Empty; public string? UsernameOverride { get; set; } public string? PasswordOverride { get; set; } public string LocalExportFolderOverride { get; set; } = string.Empty; public string ManualImportFilePath { get; set; } = string.Empty; public DateTime? ManualImportLastUploadedAtUtc { get; set; } public string SapServiceUrl { get; set; } = string.Empty; public string SapEntitySet { get; set; } = string.Empty; public string SapEntitySetsCache { get; set; } = string.Empty; public DateTime? SapEntitySetsRefreshedAtUtc { get; set; } public bool IsActive { get; set; } = true; } public class ConfigTransferSapSourceDefinition { public string SiteKey { get; set; } = string.Empty; public string Alias { get; set; } = string.Empty; public string EntitySet { get; set; } = string.Empty; public bool IsPrimary { get; set; } public bool IsActive { get; set; } = true; public int SortOrder { get; set; } } public class ConfigTransferSapJoinDefinition { public string SiteKey { get; set; } = string.Empty; public string LeftAlias { get; set; } = string.Empty; public string RightAlias { get; set; } = string.Empty; public string LeftKeys { get; set; } = string.Empty; public string RightKeys { get; set; } = string.Empty; public string JoinType { get; set; } = "Left"; public bool IsActive { get; set; } = true; public int SortOrder { get; set; } } public class ConfigTransferSapFieldMapping { public string SiteKey { get; set; } = string.Empty; public string TargetField { get; set; } = string.Empty; public string SourceExpression { get; set; } = string.Empty; public bool IsRequired { get; set; } public bool IsActive { get; set; } = true; public int SortOrder { get; set; } } public class ConfigTransferManualExcelColumnMapping { public string SiteKey { get; set; } = string.Empty; public string TargetField { get; set; } = string.Empty; public string SourceHeader { get; set; } = string.Empty; public bool IsRequired { get; set; } public bool IsActive { get; set; } = true; public int SortOrder { get; set; } }