Add maintenance management features: implement maintenance endpoints in the API, enhance media upload handling to skip duplicate files, and update frontend routes and translations for maintenance operations.

This commit is contained in:
Leonid Pershin
2026-07-24 19:52:56 +03:00
parent 6e7db4a6a9
commit 4202c51a5b
17 changed files with 411 additions and 5 deletions
@@ -0,0 +1,7 @@
using LiteCqrs;
using TeleWave.Application.Common.Models;
namespace TeleWave.Application.Maintenance.DeleteAllShows;
/// <summary>Удаляет ВСЕ шоу (с сериями через каскад). Медиа-ассеты остаются в библиотеке.</summary>
public sealed record DeleteAllShowsCommand : ICommand<Result<int>>;
@@ -0,0 +1,20 @@
using LiteCqrs;
using Microsoft.EntityFrameworkCore;
using TeleWave.Application.Common.Interfaces;
using TeleWave.Application.Common.Models;
namespace TeleWave.Application.Maintenance.DeleteAllShows;
public sealed class DeleteAllShowsCommandHandler(IAppDbContext dbContext)
: ICommandHandler<DeleteAllShowsCommand, Result<int>>
{
public async Task<Result<int>> Handle(
DeleteAllShowsCommand command,
CancellationToken cancellationToken
)
{
// Серии удаляются каскадом (FK Show → ShowEpisode: OnDelete Cascade).
var deleted = await dbContext.Shows.ExecuteDeleteAsync(cancellationToken);
return Result.Success(deleted);
}
}