Example #1
0
        private async Task <CreateAccountResponse> GetAdditionalInfo(IAccountApplication accountApp, string additionalInfo = null)
        {
            if (additionalInfo == null)
            {
                try
                {
                    additionalInfo = await _environmentAdapter.GetApplicationAdditionalInfo(accountApp, "Set debit");
                }
                catch (Exception)
                {
                    _accountModule.SaveChanges();
                    _customerModule.SaveChanges();
                    return(new CreateAccountResponse {
                        Application = accountApp
                    });
                }
            }

            var account = _accountModule.CreateAccount(new AccountInfo {
                Debit = decimal.Parse(additionalInfo), Nrb = accountApp.Nrb
            }, accountApp.Applicants.First().Id);

            accountApp.AdditionalDataCollected(account);
            _accountModule.StageChanges();
            return(new CreateAccountResponse {
                Account = account
            });
        }