Update scheduling parameters and refactor channel endpoints: extend HorizonDays to 7 and RetentionDays to 90 in appsettings.json. Consolidate channel-related endpoint logic by removing obsolete files and enhancing the ShowEndpoints with audience and genre management capabilities. Improve error handling and streamline command handlers for channel operations.
build / backend (push) Successful in 7m40s
build / frontend (push) Failing after 39s
tests / backend-tests (push) Successful in 6m9s

This commit is contained in:
Leonid Pershin
2026-07-26 13:32:13 +03:00
parent c4ef954dea
commit 66040a8841
272 changed files with 27944 additions and 8699 deletions
@@ -0,0 +1,42 @@
namespace TeleWave.Domain.Programming;
/// <summary>
/// Состояние слота: где остановились в текущем элементе. Курсор хранит ссылку на элемент, а не
/// числовой индекс в группе, — при удалении позиции из группы он корректно переезжает на следующую,
/// а не сдвигает всё.
///
/// Состояние существует потому, что сетка эластичная: сколько единиц уйдёт за один выход слота,
/// зависит от фактических длительностей, и вычислить это арифметически от эпохи нельзя.
/// </summary>
public class SlotState
{
public Guid SlotId { get; private set; }
public GroupElementKind? CurrentElementKind { get; private set; }
public Guid? CurrentElementId { get; private set; }
/// <summary>Позиция следующей единицы внутри текущего элемента.</summary>
public int NextUnitIndex { get; private set; }
private SlotState() { }
public static SlotState Create(Guid slotId) => new() { SlotId = slotId, NextUnitIndex = 0 };
/// <summary>Продолжить текущий элемент со следующей единицы.</summary>
public void Advance(int nextUnitIndex) => NextUnitIndex = Math.Max(0, nextUnitIndex);
/// <summary>Перейти к другому элементу, начав его с указанной единицы.</summary>
public void MoveTo(GroupElementKind kind, Guid elementId, int nextUnitIndex = 0)
{
CurrentElementKind = kind;
CurrentElementId = elementId;
NextUnitIndex = Math.Max(0, nextUnitIndex);
}
/// <summary>Забыть текущий элемент — например, когда он исчез из группы.</summary>
public void Reset()
{
CurrentElementKind = null;
CurrentElementId = null;
NextUnitIndex = 0;
}
}