Example #1
0
        public async Task <int> ConvertBytes(string username, int requestedVips)
        {
            var bytesConverted = _convertBytesCommand.Convert(username, requestedVips);

            await UpdateClientVips(username).ConfigureAwait(false);
            await UpdateClientBytes(username).ConfigureAwait(false);

            return(bytesConverted);
        }
        public int Convert(string username)
        {
            var conversionAmount = _configService.Get <int>("BytesToVip");

            var usersBytes = _getUserByteCountRepository.Get(username, conversionAmount);

            var closestWholeBytes = (int)Math.Floor(usersBytes);

            var convertedBytes = _convertBytesCommand.Convert(username, closestWholeBytes);

            return(convertedBytes);
        }