- CreatePlayoutRequest now carries a PlayoutScheduleKind discriminator, a
nullable ProgramScheduleId, and a ScheduleFile so POST /api/playouts can
create Classic, Block, Sequential, Scripted, or ExternalJson playouts (not
just Classic). ToCommand() validates per-kind requirements and returns
Either<BaseError, CreatePlayout>, surfacing 422 on mismatched fields via the
existing ToErrorResult() mapping.
- Add PUT /api/playouts/{id} (UpdatePlayoutDetailsRequest): DailyRebuildTime is
always applied (null clears the daily reset, matching the Blazor
SchedulePlayoutReset "Do not automatically reset" semantics); ScheduleFile is
only valid for Sequential/Scripted/ExternalJson playouts (422 otherwise) and
dispatches the matching Update*Playout command.
- Playout existence is checked via GetPlayoutById (real 404) before dispatching
UpdatePlayout, since the command's own "Playout does not exist." validation
produces a plain BaseError (422), not NotFoundError -- an existing quirk in
UpdatePlayoutHandler left as-is (out of scope for this slice).
- Extend ApiErrorResponseMetadataTests + PlayoutControllerTests for the new
Update action and the widened Create action (block/sequential/file-kind
validation paths).
- Regenerate ErsatzTV/wwwroot/openapi/v1.json via update-openapi.sh.
9 lines
469 B
C#
9 lines
469 B
C#
namespace ErsatzTV.Controllers.Api.Requests;
|
|
|
|
/// <summary>
|
|
/// DailyRebuildTime is always applied: a null value clears the daily reset (matches the Blazor
|
|
/// "Do not automatically reset" option in SchedulePlayoutReset.razor). ScheduleFile is only valid
|
|
/// for Sequential, Scripted, and ExternalJson playouts; omit it (null) to leave it unchanged.
|
|
/// </summary>
|
|
public record UpdatePlayoutDetailsRequest(TimeSpan? DailyRebuildTime, string ScheduleFile);
|