public async Task <ActionResult <CurrentBalanceResponse> > Get() { var currentBalance = await _balanceService.GetCurrentAccountBalanceAsync(); var response = new CurrentBalanceResponse() { CurrentAccountBalance = currentBalance }; return(Ok(response)); }
private async Task <bool> IsEnoughBalanceAsync(CreateTransactionModel transaction) { if (transaction.Type.IsCredit()) { var currentBalance = await _balanceService.GetCurrentAccountBalanceAsync(); if (currentBalance < transaction.Amount) { return(false); } } return(true); }