feat(configmanager): add configuration models
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
namespace JdeScoping.ConfigManager.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Root model for pipelines.json configuration.
|
||||
/// </summary>
|
||||
public class PipelinesConfigModel
|
||||
{
|
||||
public PipelineSettings Settings { get; set; } = new();
|
||||
public ScheduleDefaults ScheduleDefaults { get; set; } = new();
|
||||
public Dictionary<string, PipelineModel> Pipelines { get; set; } = new();
|
||||
}
|
||||
|
||||
public class PipelineSettings
|
||||
{
|
||||
public string Timezone { get; set; } = "UTC";
|
||||
}
|
||||
|
||||
public class ScheduleDefaults
|
||||
{
|
||||
public ScheduleModel Mass { get; set; } = new() { Enabled = true, IntervalMinutes = 10080, PrePurge = true, ReIndex = true };
|
||||
public ScheduleModel Daily { get; set; } = new() { Enabled = true, IntervalMinutes = 1440 };
|
||||
public ScheduleModel Hourly { get; set; } = new() { Enabled = true, IntervalMinutes = 60 };
|
||||
}
|
||||
|
||||
public class PipelineModel
|
||||
{
|
||||
public PipelineSource Source { get; set; } = new();
|
||||
public PipelineSchedules Schedules { get; set; } = new();
|
||||
public PipelineDestination Destination { get; set; } = new();
|
||||
public string[]? PostScripts { get; set; }
|
||||
}
|
||||
|
||||
public class PipelineSource
|
||||
{
|
||||
public string Connection { get; set; } = string.Empty;
|
||||
public string Query { get; set; } = string.Empty;
|
||||
public string? MassQuery { get; set; }
|
||||
public Dictionary<string, ParameterDefinition> Parameters { get; set; } = new();
|
||||
}
|
||||
|
||||
public class ParameterDefinition
|
||||
{
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string? Format { get; set; }
|
||||
public string? Source { get; set; }
|
||||
}
|
||||
|
||||
public class PipelineSchedules
|
||||
{
|
||||
public ScheduleModel? Mass { get; set; }
|
||||
public ScheduleModel? Daily { get; set; }
|
||||
public ScheduleModel? Hourly { get; set; }
|
||||
}
|
||||
|
||||
public class PipelineDestination
|
||||
{
|
||||
public string Table { get; set; } = string.Empty;
|
||||
public string[] MatchColumns { get; set; } = [];
|
||||
public string[] ExcludeFromUpdate { get; set; } = [];
|
||||
}
|
||||
Reference in New Issue
Block a user