using ErsatzTV.Application.Scheduling; namespace ErsatzTV.Controllers.Api.Requests; public record ReplacePlayoutTemplatesRequest(List Items) { // Index is assigned from array order (top-to-bottom priority), mirroring the Blazor editor. public ReplacePlayoutTemplateItems ToCommand(int playoutId, Option expectedVersion = default) => new( playoutId, (Items ?? []) .Select((item, index) => item.ToReplaceItem(index)) .ToList(), expectedVersion); }