Implement BumperEndpoints and remove deprecated bumper-related functionality
ci / build-backend (push) Successful in 1m39s
ci / build-frontend (push) Failing after 26s
ci / tests (push) Skipped
ci / sonar (push) Skipped

Added new BumperEndpoints to the API for managing bumper templates and variants, enhancing the channel management capabilities. Removed outdated bumper-related commands and handlers from the application, streamlining the codebase and improving maintainability. Updated ChannelEndpoints to reflect these changes and ensure proper routing for the new endpoints.
This commit is contained in:
Leonid Pershin
2026-07-27 22:01:56 +03:00
parent ee0b4d2d01
commit ba3721eb92
140 changed files with 7326 additions and 3609 deletions
@@ -7,26 +7,23 @@ using Xunit;
namespace TeleWave.Application.Tests.Broadcast;
/// <summary>
/// Карточка канала: собственные свойства канала плюс блоки заставки с подблоками. Сетка сюда не
/// входит — она запрашивается отдельно.
/// Карточка канала: только собственные свойства канала. Сетка, стыки и заставки сюда не входят —
/// они общие и запрашиваются отдельно.
/// </summary>
public class ChannelDetailsTests
{
private static readonly DateTimeOffset T0 = new(2026, 1, 1, 0, 0, 0, TimeSpan.Zero);
[Fact]
public async Task GetChannel_MapsSettingsAndBumperTemplates()
public async Task GetChannel_MapsOwnSettings()
{
var fixture = new TestDb();
var channel = Channel.Create("Первый", "one", T0);
var fillerId = Guid.NewGuid();
var logoId = Guid.NewGuid();
channel.UpdateSettings("Первый", isEnabled: true, bumpersEnabled: true, fillerId);
channel.UpdateSettings("Первый", isEnabled: true, fillerId);
channel.UpdateTimeSettings(3, 120, new TimeOnly(5, 0));
channel.UpdateBumperSettings(BumperFont.Serif, BumperSelection.Random);
channel.UpdateViewerSettings(logoId, LogoCorner.BottomLeft, 0.4, showClock: true, 0.25);
// Второй блок должен приехать после дефолтного — порядок задаёт позиция.
var extra = channel.AddBumperTemplate("Ночной");
await using (var seed = fixture.New())
{
@@ -48,22 +45,11 @@ public class ChannelDetailsTests
Assert.Equal(120, dto.UtcOffsetMinutes);
Assert.Equal(new TimeOnly(5, 0), dto.DayStartTime);
Assert.Equal(fillerId, dto.FillerAssetId);
Assert.True(dto.BumpersEnabled);
Assert.Equal(BumperFont.Serif, dto.Bumper.Font);
Assert.Equal(BumperSelection.Random, dto.Bumper.Selection);
Assert.Equal(logoId, dto.Viewer.LogoImageId);
Assert.Equal(LogoCorner.BottomLeft, dto.Viewer.LogoCorner);
Assert.Equal(0.4, dto.Viewer.LogoOpacity);
Assert.True(dto.Viewer.ShowClock);
Assert.Equal(0.25, dto.Viewer.AnalogFilterStrength);
Assert.Equal(2, dto.BumperTemplates.Count);
Assert.True(dto.BumperTemplates[0].IsDefault);
Assert.Equal(extra.Id, dto.BumperTemplates[1].Id);
Assert.Equal("Ночной", dto.BumperTemplates[1].Name);
// Своего звука у свежего блока нет — джингл синтезируется.
Assert.False(dto.BumperTemplates[1].HasAudio);
Assert.NotEmpty(dto.BumperTemplates[0].Variants);
}
[Fact]