public async Task <IRealizeOrderPropositionResponse> RealizeOrderProposition(IRealizeOrderPropositionRequest request)
        {
            try
            {
                IGetOrderPropositionByIdRequest getOrderPropositionByIdRequest =
                    new GetOrderPropositionByIdRequest(request.OrderPropositionId);
                IGetOrderPropositionResponse getOrderPropositionResponse = await _orderPropositionsProvider.GetOrderPropositionById(getOrderPropositionByIdRequest);

                if (getOrderPropositionResponse.Result == OrderPropositionsProvideResultEnum.Exception ||
                    getOrderPropositionResponse.Result == OrderPropositionsProvideResultEnum.Forbidden)
                {
                    return(new RealizeOrderPropositionResponse(RealizeOrderPropositionResult.Exception));
                }

                if (getOrderPropositionResponse.Result == OrderPropositionsProvideResultEnum.NotFound)
                {
                    return(new RealizeOrderPropositionResponse(RealizeOrderPropositionResult.NotFound));
                }

                OrderProposition orderProposition = getOrderPropositionResponse.OrderProposition;
                if (request.UserId != orderProposition.CreatorID)
                {
                    return(new RealizeOrderPropositionResponse(RealizeOrderPropositionResult.Forbidden));
                }

                ICreateOrderResponse createOrderResponse = await _orderCreator.CreateOrder(new CreateOrderRequest(request.OrderPropositionId));

                return(createOrderResponse.Result switch
                {
                    CreateOrderResult.Success => new RealizeOrderPropositionResponse(createOrderResponse.Order),
                    CreateOrderResult.Exception => new RealizeOrderPropositionResponse(RealizeOrderPropositionResult.Exception),
                    CreateOrderResult.CreatedNotFound => new RealizeOrderPropositionResponse(RealizeOrderPropositionResult.Exception),
                    _ => throw new ArgumentOutOfRangeException()
                });
            }
        public async Task <ActionResult> GetOrderPropositionById(Guid id)
        {
            try
            {
                Guid loggedInUserId = _userIdFromClaimsExpander.ExpandIdFromClaims(HttpContext.User);


                IGetOrderPropositionResponse response =
                    await _orderPropositionsProvider.GetOrderPropositionById(new GetOrderPropositionByIdRequest(id));

                IGetOrderPropositionPositionsResponse getOrderPropositionPositionsResponse = await _orderPropositionsPositionsProvider.GetOrderPropositionPositionsByOrderPropositionId(
                    new GetOrderPropositionPositionByOrderPropositionIdRequest(id));

                switch (response.Result)
                {
                case OrderPropositionsProvideResultEnum.Success:
                    return(Ok(new GetOrderPropositionResponse
                    {
                        Creator = _objectToApiModelConverter.ConvertUser(_userProvider.GetUserById(new ProvideUserRequest(response.OrderProposition.CreatorID)).Result.User),
                        Restaurant = _objectToApiModelConverter.ConvertRestaurant(_restaurantProvider.GetRestaurant(new GetRestaurantRequest(response.OrderProposition.RestaurantId)).Result.Restaurant),

                        OrderProposition = _objectToApiModelConverter.ConvertOrderProposition(response.OrderProposition),
                        Positions = getOrderPropositionPositionsResponse.OrderPropositionPositions.Select(x => new ExtendedOrderPropositionPositionApiModel
                        {
                            MealId = x.MealId,
                            Id = x.Id,
                            CreationDate = x.CreationDate,
                            Meal = _objectToApiModelConverter.ConvertMeal(_mealProvider.GetMealById(new GetMealByIdRequest(x.MealId)).Result.Meal),
                            OrderPropositionId = x.OrderPropositionId,
                            UserId = x.UserId,
                            User = _objectToApiModelConverter.ConvertUser(_userProvider.GetUserById(new ProvideUserRequest(x.UserId)).Result.User)
                        }).ToList()
                    }));

                case OrderPropositionsProvideResultEnum.NotFound:
                    return(StatusCode(404));

                case OrderPropositionsProvideResultEnum.Exception:
                    return(StatusCode(500));

                case OrderPropositionsProvideResultEnum.Forbidden:
                    return(StatusCode(403));

                default:
                    throw new ArgumentOutOfRangeException();
                }
                ;
            }
            catch (Exception ex)
            {
                _logger.Log(ex);
                return(StatusCode(500));
            }
        }