public static LoanApplicationCoreStateObject GetBorrowerWithAllStipsButIDVerification(RegisterBorrowerRequest borrower, string employerAddress1, string employerAddress2, string employerCity, string employerState, string employerZipCode,
                                                                                              string currentEmployer, int lengthYears, string phoneNumber, string phoneExtension, string jobTitle, DateTime startDate, EmploymentStatus status)
        {
            var statusClient  = new LoanApplicationStatusClient();
            var filePath      = AppDomain.CurrentDomain.BaseDirectory.ToString() + "Resources\\";
            var fileName      = "logo.jpg";
            var borrowerState = RegisterBorrower(borrower);

            borrowerState = GetPrimaryOffer(borrowerState.Borrower, (Guid)borrowerState.LoanApplicationGuid, borrowerState.BorrowerGuid.ToString());
            var employmentUpdate = CoreModelConstructors.CreateUpdateEmploymentRequestAuto();

            EmploymentInformation(employmentUpdate, (Guid)borrowerState.BorrowerGuid);
            borrowerState.LoanApplicationStipsCompleted++;
            var statusNoContent = statusClient.UpdateStatusJob();

            //ID
            EmailVerification(borrowerState.BorrowerGuid.ToString(), borrowerState.Borrower.Borrower.EmailAddress);
            var request = CoreModelConstructors.CreateCoreLinkBankAccountRequest("wells", (Guid)borrowerState.LoanApplicationGuid, "plaid_test", "plaid_good", PIEPER_JONES.Common.Enums.BankProvider.Plaid);

            statusNoContent = statusClient.UpdateStatusJob();
            IncomeVerification(borrowerState.LoanApplicationGuid.ToString(), filePath, fileName, null);
            borrowerState.LoanApplicationStipsCompleted++;
            statusNoContent = statusClient.UpdateStatusJob();
            BankStatementVerification(borrowerState.LoanApplicationGuid.ToString(), filePath, fileName, null);
            borrowerState.LoanApplicationStipsCompleted++;
            statusNoContent = statusClient.UpdateStatusJob();
            UpdateHomePayment(1700, GetRandomEnumValue <OccupancyStatus>(), borrowerState.BorrowerGuid.ToString());
            borrowerState.LoanApplicationStipsCompleted++;
            //Get all of these updated via the "batch job"
            statusNoContent = statusClient.UpdateStatusJob();
            return(borrowerState);
        }
        public void PipelineLoanStateAllStipsButEmailVerificationAndBankLinking()
        {
            var statusUpdateClient = new LoanApplicationStatusClient();
            var borrowerState      = GetBorrowerWithAllStipsButEmailAndBankverification(borrowerRegistration);

            //All Stips are completed now besides Email and BankLinking...now fill out bank linking...
            var stateResult = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());

            Assert.That(stateResult.content.LoanApplicationState == LoanApplicationState.Applying);
            Assert.That(stateResult.content.LoanApplicationStatus == LoanApplicationStatus.AppStipsPending);

            //Link Bank Account
            var request = CoreModelConstructors.CreateCoreLinkBankAccountRequest("wells", (Guid)borrowerState.LoanApplicationGuid, "plaid_test", "plaid_good", PIEPER_JONES.Common.Enums.BankProvider.Plaid);

            BankLinking(borrowerState.LoanApplicationGuid.ToString(), (Guid)borrowerState.BorrowerGuid, borrowerRegistration, request);
            //All Stips but EmailVerification let's verifyEmail
            var statusUpdateResponse = statusUpdateClient.UpdateStatusJob();

            stateResult = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());
            Assert.That(stateResult.content.LoanApplicationState == LoanApplicationState.Applying);

            //Now that we are down to one REAL stip, we check for EmailOnlyPending
            Assert.That(stateResult.content.LoanApplicationStatus == LoanApplicationStatus.EmailOnlyPending);

            //Verify The Email Address and check status again
            EmailVerification(borrowerState.LoanApplicationGuid.ToString(), borrowerRegistration.Borrower.EmailAddress);

            //We should now be ready for the AppSubmitPending status
            statusUpdateResponse = statusUpdateClient.UpdateStatusJob();
            stateResult          = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());
            Assert.That(stateResult.content.LoanApplicationState == LoanApplicationState.Applying);
            Assert.That(stateResult.content.LoanApplicationStatus == LoanApplicationStatus.AppSubmitPending);

            //Ready to Submit the LoanApplication now
            SubmitLoanApplication(borrowerState.LoanApplicationGuid.ToString(), borrowerRegistration);
            stateResult          = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());
            statusUpdateResponse = statusUpdateClient.UpdateStatusJob();

            //Now to move to Review
            Assert.That(stateResult.content.LoanApplicationState == LoanApplicationState.Reviewing);
            Assert.That(stateResult.content.LoanApplicationStatus == LoanApplicationStatus.NewAppNeedInitialReview, $"Did not successfully transition to status NewAppNeedInitialReview, status is {stateResult.content.LoanApplicationStatus}.");
        }
        public static LoanApplicationCoreStateObject TransitionToReviewingState(RegisterBorrowerRequest borrowerRegistration)
        {
            var loanApplicationClient = new LoanApplicationClient();
            var statusUpdateClient    = new LoanApplicationStatusClient();
            var borrowerState         = GetBorrowerWithAllStipsButEmailAndBankverification(borrowerRegistration);
            var stateResult           = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());

            EmailVerification(borrowerState.LoanApplicationGuid.ToString(), borrowerRegistration.Borrower.EmailAddress);

            var statusUpdateResponse = statusUpdateClient.UpdateStatusJob();

            stateResult = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());

            var request = CoreModelConstructors.CreateCoreLinkBankAccountRequest("wells", (Guid)borrowerState.LoanApplicationGuid, "plaid_test", "plaid_good", PIEPER_JONES.Common.Enums.BankProvider.Plaid);

            BankLinking(borrowerState.LoanApplicationGuid.ToString(), (Guid)borrowerState.BorrowerGuid, borrowerRegistration, request);
            statusUpdateResponse = statusUpdateClient.UpdateStatusJob();
            stateResult          = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());
            borrowerState        = SubmitLoanApplication(borrowerState.LoanApplicationGuid.ToString(), borrowerRegistration);
            stateResult          = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());
            return(borrowerState);
        }
Beispiel #4
0
        public void AgentSearchReviewing()
        {
            emailAddress = GetRandomEmail();
            borrowerRegistration.Borrower.EmailAddress = emailAddress;
            var borrowerState = GetBorrowerWithAllStipsButEmailAndBankverification(borrowerRegistration);
            var stateResult   = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());

            Assert.That(stateResult.content.LoanApplicationState == LoanApplicationState.Applying);

            EmailVerification(borrowerState.LoanApplicationGuid.ToString(), borrowerRegistration.Borrower.EmailAddress);
            stateResult = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());
            Assert.That(stateResult.content.LoanApplicationState == LoanApplicationState.Applying);

            var request = CoreModelConstructors.CreateCoreLinkBankAccountRequest("wells", (Guid)borrowerState.LoanApplicationGuid, "plaid_test", "plaid_good", PIEPER_JONES.Common.Enums.BankProvider.Plaid);

            BankLinking(borrowerState.LoanApplicationGuid.ToString(), (Guid)borrowerState.BorrowerGuid, borrowerRegistration, request);
            stateResult = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());
            Assert.That(stateResult.content.LoanApplicationState == LoanApplicationState.Applying);

            SubmitLoanApplication(borrowerState.LoanApplicationGuid.ToString(), borrowerRegistration);
            stateResult = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());
            Assert.That(stateResult.content.LoanApplicationState == LoanApplicationState.Reviewing);
        }