Spring Boot, Software Engineering, Spring Framework, Api Development, Java Development.
doInTransactionWithoutResult(TransactionStatus status) { Wallet wallet = walletRepository.findByUserId(userId); if (wallet.getBalance() >= amount) { wallet.setBalance(wallet.getBalance() - amount); walletRepository.save(wallet); } else { throw new InsufficientBalanceException("Insufficient balance