using OmsorgCore.Domain.Entities;

namespace OmsorgCore.Application.Services;

public enum DecideTimeEntryFailureReason
{
    NotFound,
    InvalidStatusTransition
}

public class DecideTimeEntryResult
{
    public bool Success { get; init; }
    public DecideTimeEntryFailureReason? FailureReason { get; init; }
    public TimeEntry? TimeEntry { get; init; }

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

    public static DecideTimeEntryResult Ok(TimeEntry timeEntry) => new()
    {
        Success = true,
        TimeEntry = timeEntry
    };
}
