Ejemplo n.º 1
0
        /// <summary>
        /// Begins the User Transaction for checking out goods at the grocery kiosk.
        /// </summary>
        /// <param name="userBasket"> Takes a list of items the user would like to purchase</param>
        /// <returns>A user basket with total price and discounts applied.</returns>
        public BasketModel BeginTransaction(string[] userBasket)
        {
            List <ItemModel>      kioskItems      = _dataStore.GetKioskItems();
            List <PromotionModel> kisokPromotions = _dataStore.GetKioskPromotions();
            var basket = GroceryKioskHelper.GetItemAndAddOrUpdateBasket(userBasket, kioskItems);

            _promotionService.ApplyPromotionsToBasket(basket, kisokPromotions);
            return(basket);
        }