API gap: scheduling REST surface — blocks/decos/templates/deco-templates + playout create/detail editors (#144 blocker) #162

Closed
opened 2026-07-07 13:24:21 +02:00 by timothy · 1 comment
Owner

Recon for #144 (2026-07-07) — blocks #91 phase (b), part of epic #59. Pattern follows #151–#153/#155.

Zero REST endpoints exist for the entire scheduling-editor surface; every Blazor editor injects IMediator directly. The full CQRS layer already exists in ErsatzTV.Application/Scheduling/ + ErsatzTV.Application/Playouts/Commands/, so the API work is thin wrappers (mirror ScheduleController + its Requests/ DTO pattern). No new domain logic; ordering is expressed via item Index in bulk Replace*Items calls (no move/reorder commands — parity-faithful).

Slices (each = controller + v1.json regen + web/src/api client + screen):

  • S1 Blocks: groups list/create/delete; blocks list/create/copy/delete; GetBlockById/GetBlockItems/ReplaceBlockItems/PreviewBlockPlayout. Richest item model (collection pickers + watermarks + graphics elements). [L]
  • S2 Templates (needs S1): group/template CRUD+copy; GetTemplateItems/GetBlocksByBlockGroupId/ReplaceTemplateItems. [M]
  • S3 Decos: group/deco CRUD, tree; GetDecoById/UpdateDeco (~28-field model: watermark/graphics/break-content/default-filler/dead-air-fallback modes). [XL form]
  • S4 Deco Templates (needs S3): group/deco-template CRUD, tree; items get/replace. [M]
  • S5 Playout create (all kinds) + detail update: POST /api/playouts is classic-only — add Block/Sequential/Scripted/ExternalJson create (CreatePlayout.cs handlers exist; kinds enum PlayoutScheduleKind) + UpdateSequentialPlayout/UpdateScriptedPlayout/UpdateExternalJsonPlayout/UpdateDefaultDeco. This is why the SPA Add-Playout button is disabled (see #144 comment). Cheap adds available: BuildPlayout/ErasePlayoutItems/ErasePlayoutHistory endpoints. [M]
  • S6 Playout wiring (needs S2+S4): GetPlayoutAlternateSchedules/ReplacePlayoutAlternateScheduleItems; GetPlayoutTemplates/ReplacePlayoutTemplateItems. [L]

Cross-cutting: verify picker-endpoint coverage before S1/S3 (watermarks/graphics-elements lists exist; collection search pickers — check). DTOs in ErsatzTV.Core/Api with #nullable enable.

Recon for #144 (2026-07-07) — blocks #91 phase (b), part of epic #59. Pattern follows #151–#153/#155. **Zero REST endpoints exist** for the entire scheduling-editor surface; every Blazor editor injects IMediator directly. The full CQRS layer already exists in `ErsatzTV.Application/Scheduling/` + `ErsatzTV.Application/Playouts/Commands/`, so the API work is thin wrappers (mirror `ScheduleController` + its Requests/ DTO pattern). No new domain logic; ordering is expressed via item `Index` in bulk `Replace*Items` calls (no move/reorder commands — parity-faithful). Slices (each = controller + v1.json regen + web/src/api client + screen): - **S1 Blocks**: groups list/create/delete; blocks list/create/copy/delete; `GetBlockById`/`GetBlockItems`/`ReplaceBlockItems`/`PreviewBlockPlayout`. Richest item model (collection pickers + watermarks + graphics elements). [L] - **S2 Templates** (needs S1): group/template CRUD+copy; `GetTemplateItems`/`GetBlocksByBlockGroupId`/`ReplaceTemplateItems`. [M] - **S3 Decos**: group/deco CRUD, tree; `GetDecoById`/`UpdateDeco` (~28-field model: watermark/graphics/break-content/default-filler/dead-air-fallback modes). [XL form] - **S4 Deco Templates** (needs S3): group/deco-template CRUD, tree; items get/replace. [M] - **S5 Playout create (all kinds) + detail update**: `POST /api/playouts` is classic-only — add Block/Sequential/Scripted/ExternalJson create (`CreatePlayout.cs` handlers exist; kinds enum `PlayoutScheduleKind`) + `UpdateSequentialPlayout`/`UpdateScriptedPlayout`/`UpdateExternalJsonPlayout`/`UpdateDefaultDeco`. This is why the SPA Add-Playout button is disabled (see #144 comment). Cheap adds available: `BuildPlayout`/`ErasePlayoutItems`/`ErasePlayoutHistory` endpoints. [M] - **S6 Playout wiring** (needs S2+S4): `GetPlayoutAlternateSchedules`/`ReplacePlayoutAlternateScheduleItems`; `GetPlayoutTemplates`/`ReplacePlayoutTemplateItems`. [L] Cross-cutting: verify picker-endpoint coverage before S1/S3 (watermarks/graphics-elements lists exist; collection search pickers — check). DTOs in ErsatzTV.Core/Api with `#nullable enable`.
Author
Owner

All six slices delivered and merged (S5 #170 → S1 #171 → S2 #173 → S3 #174 → S4 #175 → S6 #179), in the recommended order from this issue's plan. Every slice: thin REST wrappers over the existing CQRS layer + SPA screens, adversarial review, live browser E2E, green CI. The plan's core assumption held throughout — the only real deviations were deliberate hardening (rejecting what handlers silently dropped/filtered) and a handful of upstream handler bugs fixed at the root (see the #144 close-out comment for the list). Extras beyond the plan: playlist LIST endpoints + artist/multi-collection search wrappers (S3 needed them for pickers), block/template copy endpoints, and the playout default-deco read-side. Closing.

All six slices delivered and merged (S5 #170 → S1 #171 → S2 #173 → S3 #174 → S4 #175 → S6 #179), in the recommended order from this issue's plan. Every slice: thin REST wrappers over the existing CQRS layer + SPA screens, adversarial review, live browser E2E, green CI. The plan's core assumption held throughout — the only real deviations were deliberate hardening (rejecting what handlers silently dropped/filtered) and a handful of upstream handler bugs fixed at the root (see the #144 close-out comment for the list). Extras beyond the plan: playlist LIST endpoints + artist/multi-collection search wrappers (S3 needed them for pickers), block/template copy endpoints, and the playout default-deco read-side. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: timothy/ersatztv#162