Exemple #1
0
        public async Task <IEnumerable <string> > SetOrderBadges(string username, string userId)
        {
            var applicationUser = await _databaseRepository.GetApplicationUser(username);

            var menu = await _menuService.GetActiveMenu();

            var lastOrder = await _databaseRepository.GetLastOrder(userId);

            var badges = _badgeService.ExtractOrderBadges(applicationUser, lastOrder, DateTime.Parse(menu.Vendor.SubmitOrderTime));

            _databaseRepository.SaveApplicationUser(applicationUser);
            _databaseRepository.SaveUserOrder(lastOrder);
            return(badges);
        }