#nullable enable
using ErsatzTV.Core.Domain;
using Newtonsoft.Json;

namespace ErsatzTV.Core.Api.Channels;

public record ChannelResponseModel(
    int Id,
    string Number,
    double SortNumber,
    string Name,
    string Group,
    string Categories,
    [property: JsonProperty("ffmpegProfile")]
    string FFmpegProfile,
    string Language,
    string StreamingMode,
    bool IsEnabled,
    bool ShowInEpg,
    int PlayoutCount,
    // Rooted, directly-usable logo URL for the SPA's <img src>; null when the channel has no logo
    // (SPA then renders the generated initials fallback). See ErsatzTV.Application Channels.Mapper.GetLogoUrl.
    string? Logo,
    // Server-declared browser-preview capability; see ChannelPreviewResponseModel.
    ChannelPreviewResponseModel Preview,
    // Immutable creation-provenance (auto-tuned vs user-created). Raw fact; the SPA decides how to render it.
    // Unknown for rows created before the origin column existed (never back-filled).
    ChannelOrigin Origin,
    // Server-derived health rollup (api.channel-health-object). See ChannelHealthResponseModel.
    ChannelHealthResponseModel Health);
