ChannelResponseModel and BulkChannelRequests DTOs lacked file-scoped #nullable enable, so the OpenAPI generator emitted every string property as a ["null","string"] union (project Nullable default is disable), polluting SPA typegen with needless `| null` unions. ChannelStateResponseModel already complied with this convention (precedent: PlayoutResponseModel). All properties in both files are always populated (never null in practice), so no property needed to become explicitly optional/nullable - just adding #nullable enable was sufficient to clean up the generated schema. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
23 lines
695 B
C#
23 lines
695 B
C#
#nullable enable
|
|
using ErsatzTV.Application.Channels;
|
|
|
|
namespace ErsatzTV.Controllers.Api.Requests;
|
|
|
|
public record BulkRenumberChannelRequest(int Id, string Number);
|
|
|
|
public record BulkRenumberChannelsRequest(List<BulkRenumberChannelRequest> Channels)
|
|
{
|
|
public UpdateChannelNumbers ToCommand() =>
|
|
new(Channels.Select(c => new ChannelSortViewModel { Id = c.Id, Number = c.Number }).ToList());
|
|
}
|
|
|
|
public record BulkMoveChannelsToGroupRequest(List<int> ChannelIds, string Group)
|
|
{
|
|
public BulkMoveChannelsToGroup ToCommand() => new(ChannelIds, Group);
|
|
}
|
|
|
|
public record BulkDeleteChannelsRequest(List<int> ChannelIds)
|
|
{
|
|
public BulkDeleteChannels ToCommand() => new(ChannelIds);
|
|
}
|