private void UpdateItemQuantityTo(int quantity)
        {
            UpdateItemQuantityCommand command = new UpdateItemQuantityCommand(_basketRepository);

            command.Do(_basketId,
                       _itemReference,
                       quantity);
        }
Пример #2
0
        public IActionResult PutItemBasket(string consumerId,
                                           string basketId,
                                           string itemId,
                                           [FromBody] UpdateItemQuantityResource resource)
        {
            BasketId  id     = new BasketId(basketId, consumerId);
            BasketDTO basket = _basketQuery.Get(id);

            if (basket == null)
            {
                return(new BadRequestResult());
            }

            _updateItemQuantityCommand.Do(id,
                                          itemId,
                                          resource.Quantity);

            return(GetBasket(consumerId, basketId));
        }