namespace MiGu.Server.Configs;

public record PlaybackPolicy(int RetentionDays, int SamplingHz);
public record LogRetention(int HotDays, int ColdDays);
public record VersionPolicy(int KeepReleases);
public record MonitorPanelPolicy(string[] PropertyKeys, string[] StatusKeys, string[] ActionKeys);
public record MonitorOpsPolicy(
    MonitorPanelPolicy Car,
    MonitorPanelPolicy Site,
    MonitorPanelPolicy Track,
    Dictionary<string, string[]> CarActionByType);

public record OpsConfig(
    PlaybackPolicy Playback,
    LogRetention LogRetention,
    VersionPolicy Version,
    MonitorOpsPolicy Monitor)
{
    public static OpsConfig Default() => new(
        Playback: new PlaybackPolicy(30, 5),
        LogRetention: new LogRetention(7, 180),
        Version: new VersionPolicy(5),
        Monitor: new MonitorOpsPolicy(
            Car: new MonitorPanelPolicy(Array.Empty<string>(), Array.Empty<string>(), Array.Empty<string>()),
            Site: new MonitorPanelPolicy(Array.Empty<string>(), Array.Empty<string>(), Array.Empty<string>()),
            Track: new MonitorPanelPolicy(Array.Empty<string>(), Array.Empty<string>(), Array.Empty<string>()),
            CarActionByType: new Dictionary<string, string[]>()));
}
