using OmsorgCore.Domain.Entities;

namespace OmsorgCore.Application.Services;

public enum UpdateTimeEntryFailureReason
{
    NotFound,
    NotEditable,
    OrderNotFound
}

public class UpdateTimeEntryResult
{
    public bool Success { get; init; }
    public UpdateTimeEntryFailureReason? FailureReason { get; init; }
    public TimeEntry? TimeEntry { get; init; }

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

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