public async Task <ActionResult <LedgerTransactionResultDto> > Create([FromBody] InputLedgerTransactionDto ledgerTransactionDto) { try { LedgerTransactionResultDto result; if (ledgerTransactionDto.TransactionType == LedgerTransactionTypeEnum.Deposit) { result = await _transactionService.MakeDepositAsync(ledgerTransactionDto, GetCurrentUserAccountId()); } else { result = await _transactionService.MakeWithdrawalAsync(ledgerTransactionDto, GetCurrentUserAccountId()); } if (result.ResultType != LedgerTransactionResultTypeEnum.Success) { return(BadRequest(new ErrorResult(result.ResultType.GetDescription()))); } return(Ok(result)); } catch { return(BadRequest(new ErrorResult("Oops, something went wrong! Please try again"))); } }