using OmsorgCore.Domain.Entities;

namespace OmsorgCore.Application.Services;

public enum UpdateOrderFailureReason
{
    OrderNotFound,
    InvalidStatusTransition
}

public class UpdateOrderResult
{
    public bool Success { get; init; }
    public UpdateOrderFailureReason? FailureReason { get; init; }
    public Order? Order { get; init; }

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

    public static UpdateOrderResult Ok(Order order) => new()
    {
        Success = true,
        Order = order
    };
}
