feat(configmanager): add configuration models
This commit is contained in:
@@ -0,0 +1,75 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace JdeScoping.ConfigManager.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Root model for appsettings.json configuration.
|
||||
/// </summary>
|
||||
public class ConfigModel
|
||||
{
|
||||
public DataSyncSection DataSync { get; set; } = new();
|
||||
public DataAccessSection DataAccess { get; set; } = new();
|
||||
public AuthSection Auth { get; set; } = new();
|
||||
public LdapSection Ldap { get; set; } = new();
|
||||
public SearchSection Search { get; set; } = new();
|
||||
public ExcelExportSection ExcelExport { get; set; } = new();
|
||||
public Dictionary<string, string> ConnectionStrings { get; set; } = new();
|
||||
}
|
||||
|
||||
public class DataSyncSection
|
||||
{
|
||||
public TimeSpan CheckInterval { get; set; } = TimeSpan.FromMinutes(1);
|
||||
public int MaxDegreeOfParallelism { get; set; } = 4;
|
||||
public int BatchSize { get; set; } = 50000;
|
||||
public int BulkCopyBatchSize { get; set; } = 5000;
|
||||
public double LookbackMultiplier { get; set; } = 1.5;
|
||||
public int PurgeRetentionDays { get; set; } = 90;
|
||||
public int SyncTimeoutSeconds { get; set; } = 3600;
|
||||
public bool Enabled { get; set; } = true;
|
||||
}
|
||||
|
||||
public class DataAccessSection
|
||||
{
|
||||
public int DefaultTimeoutSeconds { get; set; } = 30;
|
||||
public int LotUsageTimeoutSeconds { get; set; } = 120;
|
||||
public int MisDataTimeoutSeconds { get; set; } = 300;
|
||||
public string ProductionSchema { get; set; } = "prod";
|
||||
public string ArchiveSchema { get; set; } = "archive";
|
||||
public string StageSchema { get; set; } = "stage";
|
||||
public bool EnableDetailedLogging { get; set; } = false;
|
||||
}
|
||||
|
||||
public class AuthSection
|
||||
{
|
||||
public string CookieName { get; set; } = ".JdeScoping.Auth";
|
||||
public int CookieExpirationMinutes { get; set; } = 480;
|
||||
}
|
||||
|
||||
public class LdapSection
|
||||
{
|
||||
public string[] ServerUrls { get; set; } = [];
|
||||
public string GroupDn { get; set; } = string.Empty;
|
||||
public string SearchBase { get; set; } = string.Empty;
|
||||
public int ConnectionTimeoutSeconds { get; set; } = 30;
|
||||
public bool UseFakeAuth { get; set; } = false;
|
||||
public string[] AdminBypassUsers { get; set; } = [];
|
||||
}
|
||||
|
||||
public class SearchSection
|
||||
{
|
||||
public int MaxResultRows { get; set; } = 100000;
|
||||
public int TimeoutSeconds { get; set; } = 300;
|
||||
public int MaxConcurrentSearches { get; set; } = 5;
|
||||
}
|
||||
|
||||
public class ExcelExportSection
|
||||
{
|
||||
public string CriteriaSheetPassword { get; set; } = string.Empty;
|
||||
public string DataSheetPassword { get; set; } = string.Empty;
|
||||
public int MaxRowsPerSheet { get; set; } = 1000000;
|
||||
public string DefaultDateFormat { get; set; } = "yyyy-MM-dd HH:mm:ss";
|
||||
public bool DebugWriteToFile { get; set; } = false;
|
||||
public string DebugOutputDirectory { get; set; } = string.Empty;
|
||||
public string TimezoneId { get; set; } = "America/Chicago";
|
||||
public string TimezoneAbbreviation { get; set; } = "CT";
|
||||
}
|
||||
Reference in New Issue
Block a user