Ejemplo n.º 1
0
        public void ValidateUserWallet(User user)
        {
            var cacheKey  = user.Email + "validated";
            var validated = MemoryCache.Get <object>(cacheKey);

            if (validated == null)
            {
                var wallet = Data.GetByUser(user.Id);
                if (wallet == null)
                {
                    throw new NotFoundException("Wallet was not defined.");
                }

                wallet.AUCBalance = GetAucAmount(wallet.Address);
                ActionBusiness.InsertNewAucVerification(user.Id, wallet.AUCBalance.Value);
                Data.Update(wallet);

                ValidateAucAmount(wallet.AUCBalance.Value, UserBusiness.GetMinimumAucAmountForUser(user));
                MemoryCache.Set <object>(cacheKey, true, 20);
            }
        }