namespace OmsorgCore.Application.Services;

public enum DeleteRoleFailureReason
{
    RoleNotFound,
    InUse
}

public class DeleteRoleResult
{
    public bool Success { get; init; }
    public DeleteRoleFailureReason? FailureReason { get; init; }

    /// <summary>Nur gesetzt bei <see cref="DeleteRoleFailureReason.InUse"/> - Anzahl der Benutzer, die dieser Rolle noch zugewiesen sind.</summary>
    public int AssignedUserCount { get; init; }

    public static DeleteRoleResult Fail(DeleteRoleFailureReason reason, int assignedUserCount = 0) => new()
    {
        Success = false,
        FailureReason = reason,
        AssignedUserCount = assignedUserCount
    };

    public static DeleteRoleResult Ok() => new()
    {
        Success = true
    };
}
