public async Task <PurchaseDto> GetPrizeByPurchaseGuid(Guid id) { var purchase = _purchaseRepository.GetPurchaseByPurchaseGuid(id); var prizeDto = await _prizeManager.GetPrizeById(purchase.PrizeId); purchase.Price = prizeDto.Price; purchase.Name = prizeDto.Name; purchase.Picture = prizeDto.Picture; purchase.BalanceLeft = _balanceLogic.GetCurrentBalance(purchase.UserEmail); return(purchase); }
public async Task <bool> IsBalanceEnough(string userEmail, int prizeId) { var prize = await _prizeManager.GetPrizeById(prizeId); var price = prize.Price; var balance = GetCurrentBalance(userEmail); return(balance >= price); }
public async Task <PrizeDto> Get(int id) { return(await _prizeManager.GetPrizeById(id)); }