feat(slots): update balance handling on spin results
This commit is contained in:
		
					parent
					
						
							
								93c5dc7fe3
							
						
					
				
			
			
				commit
				
					
						a3f34e960b
					
				
			
		
					 2 changed files with 7 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -54,12 +54,13 @@ public class SlotService {
 | 
			
		|||
        SpinResult spinResult = new SpinResult();
 | 
			
		||||
        spinResult.setStatus(status.name().toLowerCase());
 | 
			
		||||
 | 
			
		||||
        this.balanceService.subtractFunds(user, betAmount);
 | 
			
		||||
 | 
			
		||||
        if (status == Status.WIN) {
 | 
			
		||||
            BigDecimal winAmount = betAmount.multiply(winSymbol.getPayoutMultiplier());
 | 
			
		||||
            this.balanceService.addFunds(user, winAmount);
 | 
			
		||||
            spinResult.setAmount(winAmount);
 | 
			
		||||
        } else {
 | 
			
		||||
            this.balanceService.subtractFunds(user, betAmount);
 | 
			
		||||
            spinResult.setAmount(betAmount);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue