using OmsorgCore.Domain.Entities;

namespace OmsorgCore.Application.Services;

public enum CreateRoleFailureReason
{
    NameRequired,
    NameTaken
}

public class CreateRoleResult
{
    public bool Success { get; init; }
    public CreateRoleFailureReason? FailureReason { get; init; }
    public Role? Role { get; init; }

    public static CreateRoleResult Fail(CreateRoleFailureReason reason) => new()
    {
        Success = false,
        FailureReason = reason
    };

    public static CreateRoleResult Ok(Role role) => new()
    {
        Success = true,
        Role = role
    };
}
