#nullable enable
using System.Collections.Generic;
using ErsatzTV.Core.Domain;
using ErsatzTV.Core.Scheduling;

namespace ErsatzTV.Core.Api.Scheduling;

/// <summary>
///     A flat, non-polymorphic projection of a program schedule item (issue #126). Unlike the
///     Application-layer <c>ProgramScheduleItemViewModel</c> hierarchy (One/Flood/Multiple/Duration
///     subtypes), every subtype-specific field is a nullable member here so the OpenAPI schema fully
///     describes the shape. The mutation fields are named 1:1 with
///     <c>ScheduleItemRequest</c> so a GET can be mapped losslessly back to a PUT/POST request.
/// </summary>
public record ScheduleItemResponseModel(
    int Id,
    int Index,
    StartType StartType,
    TimeSpan? StartTime,
    FixedStartTimeBehavior? FixedStartTimeBehavior,
    PlayoutMode PlayoutMode,
    CollectionType CollectionType,
    int? CollectionId,
    int? MultiCollectionId,
    int? SmartCollectionId,
    int? RerunCollectionId,
    int? MediaItemId,
    int? PlaylistId,
    string? SearchTitle,
    string? SearchQuery,
    PlaybackOrder PlaybackOrder,
    MarathonGroupBy MarathonGroupBy,
    bool MarathonShuffleGroups,
    bool MarathonShuffleItems,
    int? MarathonBatchSize,
    FillWithGroupMode FillWithGroupMode,
    MultipleMode? MultipleMode,
    string? MultipleCount,
    TimeSpan? PlayoutDuration,
    TailMode? TailMode,
    int? DiscardToFillAttempts,
    string? CustomTitle,
    GuideMode GuideMode,
    int? PreRollFillerId,
    int? MidRollFillerId,
    int? PostRollFillerId,
    int? TailFillerId,
    int? FallbackFillerId,
    List<int> WatermarkIds,
    List<int> GraphicsElementIds,
    string? PreferredAudioLanguageCode,
    string? PreferredAudioTitle,
    string? PreferredSubtitleLanguageCode,
    ChannelSubtitleMode? SubtitleMode,
    string? CollectionName,
    string? MultiCollectionName,
    string? SmartCollectionName,
    string? RerunCollectionName,
    string? PlaylistName,
    int? PlaylistGroupId,
    string? MediaItemName,
    string? PreRollFillerName,
    string? MidRollFillerName,
    string? PostRollFillerName,
    string? TailFillerName,
    string? FallbackFillerName,
    List<NamedIdResponseModel> Watermarks,
    List<NamedIdResponseModel> GraphicsElements,
    string? Name,
    TimeSpan? DurationEstimate);
