Files
TeleWave/backend/src/TeleWave.Application/Programming/Groups/GroupErrors.cs
T
Leonid Pershin 2045b1a3f2
ci / build-backend (push) Successful in 2m5s
ci / build-frontend (push) Successful in 40s
ci / tests (push) Successful in 2m3s
ci / sonar (push) Successful in 7m39s
Add error handling for future schedule conflicts and media asset usage
Introduced new error types for handling conflicts when attempting to delete shows or media assets that are currently scheduled or in use. Updated the DeleteShowCommandHandler and DeleteMediaAssetCommandHandler to check for these conditions and return appropriate error responses. This enhances the robustness of the application by preventing unintended deletions and improving user feedback.
2026-07-27 02:18:25 +03:00

29 lines
1.0 KiB
C#

using TeleWave.Application.Common.Models;
namespace TeleWave.Application.Programming.Groups;
public static class GroupErrors
{
public static readonly Error NotFound = Error.NotFound("Groups.NotFound", "Группа не найдена.");
public static readonly Error ItemNotFound = Error.NotFound(
"Groups.ItemNotFound",
"Позиция в группе не найдена."
);
public static readonly Error ElementNotFound = Error.NotFound(
"Groups.ElementNotFound",
"Шоу или коллекция не найдены."
);
public static readonly Error InUse = Error.Conflict(
"Groups.InUse",
"Группа используется в сетке: на неё ссылается слот, врезка стыка или запасная группа шаблона."
);
public static readonly Error FilterNotSet = Error.Validation(
"Groups.FilterNotSet",
"У группы не задано правило набора."
);
}