namespace CONTROLLER.Configurations
{
    public class AppSettings
    {
        public ConnectionStrings ConnectionStrings { get; set; } = new ConnectionStrings();
        public ApiSettings ApiSettings { get; set; } = new ApiSettings();
        public ServiceSettings ServiceSettings { get; set; } = new ServiceSettings();
        public SerilogSettings Serilog { get; set; } = new SerilogSettings();
        public string AllowedHosts { get; set; } = "*";
    }

    public class ConnectionStrings
    {
        public string Default { get; set; } = "";
    }

    public class ApiSettings
    {
        public string BaseUrl { get; set; } = "http://localhost:5002";
        public int Timeout { get; set; } = 30;
        public int LabelDownloadTimeout { get; set; } = 2;
        public int InterfaceTimeout { get; set; } = 3;
    }

    public class ServiceSettings
    {
        public int MaxRetryCount { get; set; } = 3;
        public int RetryIntervalMs { get; set; } = 1000;
    }

    public class SerilogSettings
    {
        public MinimumLevel MinimumLevel { get; set; } = new MinimumLevel();
        public List<WriteTo> WriteTo { get; set; } = new List<WriteTo>();
    }

    public class MinimumLevel
    {
        public string Default { get; set; } = "Information";
        public Dictionary<string, string> Override { get; set; } = new Dictionary<string, string>();
    }

    public class WriteTo
    {
        public string Name { get; set; } = "File";
        public Args Args { get; set; } = new Args();
    }

    public class Args
    {
        public string Path { get; set; } = "logs/api_log-.txt";
        public string RollingInterval { get; set; } = "Day";
        public long FileSizeLimitBytes { get; set; } = 10485760;
        public bool RollOnFileSizeLimit { get; set; } = true;
        public int RetainedFileCountLimit { get; set; } = 30;
        public bool Shared { get; set; } = true;
        public string OutputTemplate { get; set; } = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] {SourceContext}: {Message}{NewLine}{Exception}";
    }
}