using OmsorgCore.Domain.Entities;

namespace OmsorgCore.Application.Services;

public enum UpdateAbsenceFailureReason
{
    NotFound,
    AlreadyDecided
}

public class UpdateAbsenceResult
{
    public bool Success { get; init; }
    public UpdateAbsenceFailureReason? FailureReason { get; init; }
    public Absence? Absence { get; init; }

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

    public static UpdateAbsenceResult Ok(Absence absence) => new()
    {
        Success = true,
        Absence = absence
    };
}
