using ErsatzTV.Application.Scheduling; using ErsatzTV.Core.Domain.Scheduling; namespace ErsatzTV.Controllers.Api.Requests; public record ReplaceBlockRequest( string Name, int Minutes, BlockStopScheduling StopScheduling, List Items) { public ReplaceBlockItems ToCommand(int blockGroupId, int blockId, Option> expectedVersions = default) => new( blockGroupId, blockId, Name, Minutes, StopScheduling, (Items ?? []).Select((item, index) => item.ToReplaceItem(index)).ToList(), expectedVersions); }