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.
29 lines
1.0 KiB
C#
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",
|
|
"У группы не задано правило набора."
|
|
);
|
|
}
|