Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (push) Has been skipped
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (push) Has been skipped
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (push) Successful in 15m30s
Build ErsatzTV Image / Functional E2E (curl contracts) (push) Successful in 15m48s
Build ErsatzTV Image / Build & test (.NET) (push) Successful in 7m32s
Build ErsatzTV Image / Build & push image (amd64) (push) Has been cancelled
Closes #415. Server-derived health object on the channel list + detail DTOs (built-timeline detection, kind-agnostic across all 5 PlayoutScheduleKind; assessable gate keyed to the owning channel's mode), single "Problems" SPA filter with per-fault badges. Supersedes #72's api.channel-health-signal decision. Co-authored-by: Timothy <timothy.look@gmail.com> Co-committed-by: Timothy <timothy.look@gmail.com>
37 lines
1.6 KiB
C#
37 lines
1.6 KiB
C#
#nullable enable
|
|
namespace ErsatzTV.Core.Api.Channels;
|
|
|
|
// Server-derived per-channel health. The SPA and MCP both read Status/Faults rather than deriving a
|
|
// verdict themselves (the api.channel-health-object decision, superseding #72's raw-fact-only stance).
|
|
// Faults are plain strings (see ChannelFault) not a C# enum, to keep the OpenAPI schema simple — the
|
|
// SPA hand-maintains its own union, matching the ChannelPreviewAvailability pattern.
|
|
public record ChannelHealthResponseModel(
|
|
// One of ChannelHealthStatus's values.
|
|
string Status,
|
|
// The specific fault classes that fired (each a ChannelFault value); empty when Healthy/Unknown.
|
|
string[] Faults,
|
|
// Retained #72 fact: total playouts (mirror-aware).
|
|
int PlayoutCount,
|
|
// Count of upcoming built items pointing at a FileNotFound/Unavailable MediaItem; 0 when none.
|
|
int BrokenSourceItemCount);
|
|
|
|
public static class ChannelHealthStatus
|
|
{
|
|
public const string Healthy = "Healthy";
|
|
public const string Problems = "Problems";
|
|
public const string Unknown = "Unknown";
|
|
}
|
|
|
|
public static class ChannelFault
|
|
{
|
|
public const string NoPlayout = "NoPlayout";
|
|
public const string NeverBuilt = "NeverBuilt";
|
|
public const string BuildFailed = "BuildFailed";
|
|
public const string EmptyUpcoming = "EmptyUpcoming";
|
|
public const string BrokenSource = "BrokenSource";
|
|
}
|
|
|
|
// Per-playout upcoming-item aggregate (Task 2's repository query fills this). Lives in Core so both
|
|
// the repository interface (Core) and Mapper (Application) can reference it.
|
|
public readonly record struct PlayoutUpcoming(int TotalUpcoming, int BrokenUpcoming);
|