Implement BumperEndpoints and remove deprecated bumper-related functionality
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:
@@ -251,7 +251,7 @@ public sealed class GridScheduleGeneratorIntegrationTests(PostgresFixture fixtur
|
||||
var filler = ReadyAsset(db, $"filler-{suffix}.mkv", TimeSpan.FromMinutes(1));
|
||||
|
||||
var channel = Channel.Create($"Канал {suffix}", $"ch-{suffix}", Now.AddDays(-7));
|
||||
channel.UpdateSettings(channel.Name, isEnabled: true, bumpersEnabled: false, filler.Id);
|
||||
channel.UpdateSettings(channel.Name, isEnabled: true, filler.Id);
|
||||
|
||||
var template = ScheduleTemplate.Create(channel.Id, "Сетка");
|
||||
var layer = template.AddLayer("Базовый", 10);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace TeleWave.Integration.Tests;
|
||||
public sealed class TemplateOperationsIntegrationTests(PostgresFixture fixture)
|
||||
{
|
||||
[SkippableFact]
|
||||
public async Task Copy_MovesLayersSlotsAndJunctions_AndReplacesTargetGrid()
|
||||
public async Task Copy_MovesLayersAndSlots_AndReplacesTargetGrid()
|
||||
{
|
||||
Skip.IfNot(fixture.Available, "Docker недоступен");
|
||||
|
||||
@@ -36,7 +36,6 @@ public sealed class TemplateOperationsIntegrationTests(PostgresFixture fixture)
|
||||
|
||||
Assert.Equal(1, result.Value.Layers);
|
||||
Assert.Equal(1, result.Value.Slots);
|
||||
Assert.Equal(1, result.Value.Junctions);
|
||||
|
||||
await using var verify = fixture.CreateContext();
|
||||
var target = verify.Channels.Single(c => c.Id == targetId);
|
||||
@@ -54,13 +53,15 @@ public sealed class TemplateOperationsIntegrationTests(PostgresFixture fixture)
|
||||
Assert.Equal(groupId, slot.GroupId);
|
||||
Assert.Single(verify.Groups.Where(g => g.Id == groupId));
|
||||
|
||||
// Стык переехал своей копией, и слот ссылается на неё, а не на стык чужого канала.
|
||||
var junction = verify.JunctionTemplates.Single(j => j.ChannelId == targetId);
|
||||
Assert.Equal(junction.Id, slot.JunctionAfterId);
|
||||
Assert.NotEqual(
|
||||
verify.JunctionTemplates.Single(j => j.ChannelId == sourceId).Id,
|
||||
slot.JunctionAfterId
|
||||
);
|
||||
// Стыки общие — копия ссылается на тот же стык, а не заводит свой.
|
||||
var sourceSlot = verify
|
||||
.ScheduleTemplates.Include(t => t.Layers)
|
||||
.ThenInclude(l => l.Slots)
|
||||
.Single(t => t.ChannelId == sourceId)
|
||||
.Layers.SelectMany(l => l.Slots)
|
||||
.Single();
|
||||
Assert.Equal(sourceSlot.JunctionAfterId, slot.JunctionAfterId);
|
||||
Assert.NotNull(slot.JunctionAfterId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -148,9 +149,22 @@ public sealed class TemplateOperationsIntegrationTests(PostgresFixture fixture)
|
||||
var source = Channel.Create($"Источник {suffix}", $"src-{suffix}", DateTimeOffset.UtcNow);
|
||||
var target = Channel.Create($"Приёмник {suffix}", $"dst-{suffix}", DateTimeOffset.UtcNow);
|
||||
|
||||
var junction = JunctionTemplate.Create(source.Id, "Прайм");
|
||||
var junction = JunctionTemplate.Create($"Прайм {suffix}");
|
||||
var ad = junction.AddElement(JunctionElementKind.Ad);
|
||||
ad.Update(JunctionElementKind.Ad, group.Id, null, JunctionAmountMode.Count, 2, true, null);
|
||||
ad.Update(
|
||||
new JunctionElementSettings(
|
||||
JunctionElementKind.Ad,
|
||||
group.Id,
|
||||
null,
|
||||
null,
|
||||
JunctionAmountMode.Count,
|
||||
2,
|
||||
true,
|
||||
null,
|
||||
JunctionElement.DefaultChoiceWeight,
|
||||
null
|
||||
)
|
||||
);
|
||||
db.JunctionTemplates.Add(junction);
|
||||
|
||||
var sourceTemplate = ScheduleTemplate.Create(source.Id, "Сетка источника");
|
||||
|
||||
Reference in New Issue
Block a user