public void NewAppNeedInitialToInReviewNeedUwDecision()
        {
            LoanApplicationCoreStateObject loanApplicationInfo         = TransitionToReviewingState(borrowerRegistration);
            ResponseObject <GetLoanApplicationStatusResponse> response = coreLoanApplicationStatusClient
                                                                         .GetStatusByLoanApplication(loanApplicationInfo.LoanApplicationGuid.ToString());

            if (response.content == null ||
                response.content.LoanApplicationState != LoanApplicationState.Reviewing ||
                response.content.LoanApplicationStatus != LoanApplicationStatus.NewAppNeedInitialReview)
            {
                var message = response.content == null ? "No response was returned, null content object." : $"State = {response.content.LoanApplicationState.ToString()}, Status = {response.content.LoanApplicationStatus.ToString()}";
                log.Error("Failing test due to invalid setup state for our loan application...");
                Assert.Fail($"Loan Application State or Status not in the valid state or status; unable to continue - {message}");
            }

            AssignAgentToLoanApplication((Guid)loanApplicationInfo.LoanApplicationGuid, AgentRole.UW, "clpuw");
            var coreLoanAppClient = new LoanApplicationClient();
            var workflowResponse  = coreLoanAppClient.WorkflowAction(loanApplicationInfo.LoanApplicationGuid.ToString(), LoanApplicationWorkflowAction.SendToUW);

            Assert.That(workflowResponse.statusCode == HttpStatusCode.OK, $"Invalid status code returned when attempting workflow transition:  {workflowResponse.statusCode}");
            log.Info("Checking the actual status of our loan application after transitioning to SendToUW");

            var statusResponse = coreLoanApplicationStatusClient.GetStatusByLoanApplication(loanApplicationInfo.LoanApplicationGuid.ToString());

            log.Info("transitioning the status...");

            coreLoanApplicationStatusClient
            .UpdateStatusByLoanApplication(loanApplicationInfo.LoanApplicationGuid.ToString());
            Assert.That(statusResponse.statusCode == HttpStatusCode.OK, $"We received an invalid status code from our core loanapplication status request:  {statusResponse.statusCode}.");
            Assert.NotNull(statusResponse.content, "We have a response but the response content is null for our status request");
            ValidateApplicationState(statusResponse.content, LoanApplicationState.Reviewing, LoanApplicationStatus.InReviewNeedDecision);
            log.Info("We have successfully transitioned our loan application into the Reviewing/InReviewNeedDecision.  Now we must check to see if we have an Agent assigned.");
        }
        public void PipelineLoanStateQuoting()
        {
            var borrowerState = new LoanApplicationCoreStateObject();

            borrowerState = RegisterBorrower(borrowerRegistration);
            borrowerState = GetBorrowerToQuoting(borrowerRegistration, (Guid)borrowerState.LoanApplicationGuid);
            var stateResult = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());

            Assert.That(stateResult.content.LoanApplicationState == LoanApplicationState.Quoting);
            Assert.That(stateResult.content.LoanApplicationStatus == LoanApplicationStatus.OfferSelectPending);
        }
Пример #3
0
        public void AgentSearchQuoting()
        {
            emailAddress = GetRandomEmail();
            borrowerRegistration.Borrower.EmailAddress = emailAddress;
            var borrowerState = new LoanApplicationCoreStateObject();

            borrowerState = RegisterBorrower(borrowerRegistration);
            borrowerState = GetBorrowerToQuoting(borrowerRegistration, (Guid)borrowerState.LoanApplicationGuid);
            var stateResult = loanApplicationClient.Status(borrowerState.LoanApplicationGuid.ToString());

            Assert.That(stateResult.content.LoanApplicationState == LoanApplicationState.Quoting);
        }
Пример #4
0
        public static LoanApplicationCoreStateObject GetBorrowerToQuoting(RegisterBorrowerRequest borrower, Guid applicationGuid)
        {
            var loanApplicationOffersClient = new LoanApplicationOffersClient();
            var offerJson = new GenerateOffersRequest();

            offerJson.LoanAmount = borrower.LoanApplication.RequestedLoanAmount;
            var result      = loanApplicationOffersClient.GenerateOffers(offerJson, applicationGuid.ToString());
            var stateObject = new LoanApplicationCoreStateObject();

            stateObject.Borrower            = borrower;
            stateObject.LoanApplicationGuid = applicationGuid;
            return(stateObject);
        }
Пример #5
0
        public static LoanApplicationCoreStateObject SubmitLoanApplication(string applicationGuid, RegisterBorrowerRequest borrower)
        {
            var loanApplicationClient = new LoanApplicationClient();
            var devinfo = new DeviceInfo();

            devinfo.BlackBoxId = "BlackBoxId".GetAppSetting();
            devinfo.IpAddress  = "127.0.0.1";
            SignAllPreLoanAppSubmitDocs(applicationGuid);
            var request = CoreModelConstructors.CreateLoanApplicationSubmitRequest(devinfo, 1, 1, 1, 1, borrower.Borrower.LastName);
            LoanApplicationCoreStateObject result = new LoanApplicationCoreStateObject();

            loanApplicationClient.SubmitLoanApplication(applicationGuid, request);
            result.ApplicaiontStatus   = LoanApplicationStatus.NewAppNeedInitialReview;
            result.ApplicationState    = LoanApplicationState.Reviewing;
            result.Borrower            = borrower;
            result.LoanApplicationGuid = new Guid(applicationGuid);
            return(result);
        }
Пример #6
0
        public static LoanApplicationCoreStateObject RegisterBorrower(RegisterBorrowerRequest borrower = null)
        {
            if (borrower == null)
            {
                borrower = CoreModelConstructors.CreateRegisterBorrowerRequest();
            }

            var  borrowersClient = new BorrowersClient();
            var  result          = borrowersClient.BorrowerRegistration(borrower);
            var  borrowerGuid    = (Guid)result.content.BorrowerGuid;
            Guid?applicationGuid = result.content.LoanApplicationGuid;
            var  returnObject    = new LoanApplicationCoreStateObject();

            returnObject.Borrower            = borrower;
            returnObject.BorrowerGuid        = borrowerGuid;
            returnObject.LoanApplicationGuid = applicationGuid;
            returnObject.ApplicaiontStatus   = LoanApplicationStatus.OfferSelectPending;
            returnObject.ApplicationState    = LoanApplicationState.Quoting;
            return(returnObject);
        }
        public void PipelineLoanStateTransitionToAccepting()
        {
            LoanApplicationCoreStateObject borrowerState = TransitionToReviewingState(borrowerRegistration);
            int emailCount  = GetEmails(emailAddress).Count;
            var stateClient = new LoanApplicationStateClient();
            var noContent   = new ResponseObject <EmptyResult>();

            noContent = loanApplicationClient
                        .WorkflowAction(borrowerState.LoanApplicationGuid.ToString(), LoanApplicationWorkflowAction.Counter);
            noContent = loanApplicationClient
                        .SetLoanAppToAccept(borrowerState.LoanApplicationGuid.ToString());
            Assert.That(noContent.statusCode == HttpStatusCode.OK);

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

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

            List <string> emails = GetEmails(emailAddress);

            Assert.That(emails.Count > emailCount);
        }
Пример #8
0
        // return a borrower that has registered and accepted the primary offer
        public static LoanApplicationCoreStateObject GetPrimaryOffer(RegisterBorrowerRequest borrower, Guid applicationGuid, string borrowerGuid = null)
        {
            var loanApplicationOffersClient = new LoanApplicationOffersClient();
            var offerJson = new GenerateOffersRequest();

            offerJson.LoanAmount = borrower.LoanApplication.RequestedLoanAmount;
            var result = loanApplicationOffersClient.GenerateOffers(offerJson, applicationGuid.ToString());

            result = loanApplicationOffersClient.GetOffer(applicationGuid.ToString());
            var offerGuid    = result.content.LoanOfferGroup.LoanApplicationOffers[0].Guid.ToString();
            var offersClient = new OffersClient();
            var noResult     = offersClient.SelectOffer(offerGuid);
            var stateObject  = new LoanApplicationCoreStateObject();

            stateObject.Borrower = borrower;
            if (borrowerGuid != null)
            {
                stateObject.BorrowerGuid = new Guid(borrowerGuid);
            }
            stateObject.OfferGuid           = new Guid(offerGuid);
            stateObject.LoanApplicationGuid = applicationGuid;
            return(stateObject);
        }