using OmsorgCore.Domain.Entities;

namespace OmsorgCore.Application.Services;

public enum SubmitTimeEntryFailureReason
{
    NotFound,
    NoSelfServiceTransition
}

public class SubmitTimeEntryResult
{
    public bool Success { get; init; }
    public SubmitTimeEntryFailureReason? FailureReason { get; init; }
    public TimeEntry? TimeEntry { get; init; }

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

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