Adds BlockController (block groups + blocks CRUD, items GET, full replace, non-persisting preview) mirroring ScheduleController, plus four scheduling search picker endpoints on SearchController (collections, television shows, television seasons, smart collections). Response DTOs in ErsatzTV.Core/Api/ Scheduling; request DTOs with ToCommand index auto-assignment. #144 S1 (#162) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
21 lines
560 B
C#
21 lines
560 B
C#
using ErsatzTV.Application.Scheduling;
|
|
using ErsatzTV.Core.Domain.Scheduling;
|
|
|
|
namespace ErsatzTV.Controllers.Api.Requests;
|
|
|
|
public record ReplaceBlockRequest(
|
|
string Name,
|
|
int Minutes,
|
|
BlockStopScheduling StopScheduling,
|
|
List<BlockItemRequest> Items)
|
|
{
|
|
public ReplaceBlockItems ToCommand(int blockGroupId, int blockId) =>
|
|
new(
|
|
blockGroupId,
|
|
blockId,
|
|
Name,
|
|
Minutes,
|
|
StopScheduling,
|
|
(Items ?? []).Select((item, index) => item.ToReplaceItem(index)).ToList());
|
|
}
|