using ErsatzTV.Application.Scheduling;

namespace ErsatzTV.Controllers.Api.Requests;

public record PlayoutTemplateItemRequest(
    int Id,
    int TemplateId,
    int? DecoTemplateId,
    List<DayOfWeek> DaysOfWeek,
    List<int> DaysOfMonth,
    List<int> MonthsOfYear,
    bool LimitToDateRange,
    int StartMonth,
    int StartDay,
    int? StartYear,
    int EndMonth,
    int EndDay,
    int? EndYear)
{
    public ReplacePlayoutTemplate ToReplaceItem(int index) =>
        new(
            Id,
            index,
            TemplateId,
            DecoTemplateId,
            DaysOfWeek ?? [],
            DaysOfMonth ?? [],
            MonthsOfYear ?? [],
            LimitToDateRange,
            StartMonth,
            StartDay,
            StartYear,
            EndMonth,
            EndDay,
            EndYear);
}
