public async Task <IActionResult> Deposit(DepositType type, [FromBody] DepositDTO model) { if (type == DepositType.Cash) { try { await _accountApplicationService.DepositCashAsync(AccountId.With(model.AccountId), model.Amount); } catch (Exception e) { return(BadRequest(new { Error = e.Message })); } return(Ok(new { isSuccess = true })); } if (type == DepositType.Check) { try { await _accountApplicationService.DepositCheckAsync(AccountId.With(model.AccountId), model.Amount); } catch (Exception e) { return(BadRequest(new { Error = e.Message })); } return(Ok(new { isSuccess = true })); } return(BadRequest()); }