using ErsatzTV.Application.Configuration;
using Serilog.Events;

namespace ErsatzTV.Controllers.Api.Requests;

public record UpdateLoggingSettingsRequest(
    LogEventLevel DefaultMinimumLogLevel,
    LogEventLevel ScanningMinimumLogLevel,
    LogEventLevel SchedulingMinimumLogLevel,
    LogEventLevel SearchingMinimumLogLevel,
    LogEventLevel StreamingMinimumLogLevel,
    LogEventLevel HttpMinimumLogLevel)
{
    public UpdateLoggingSettings ToCommand() =>
        new(
            new LoggingSettingsViewModel
            {
                DefaultMinimumLogLevel = DefaultMinimumLogLevel,
                ScanningMinimumLogLevel = ScanningMinimumLogLevel,
                SchedulingMinimumLogLevel = SchedulingMinimumLogLevel,
                SearchingMinimumLogLevel = SearchingMinimumLogLevel,
                StreamingMinimumLogLevel = StreamingMinimumLogLevel,
                HttpMinimumLogLevel = HttpMinimumLogLevel
            });
}
