Beispiel #1
0
        public static bool DispositionDataObjects(List <DataObject> dataObjects, AgentIdObject agent, Disposition?disposition)
        {
            var dataClient = new DataObjectClient();

            if (dataObjects.Count > 0)
            {
                var alertsClient = new AlertFlagClient();
                foreach (DataObject d in dataObjects)
                {
                    DataObjectDispositionRequest req = new DataObjectDispositionRequest();
                    req.DataObjectGuid      = (Guid)d.DataObjectGuid;
                    req.DispositionedByRole = (AgentRole)Enum.Parse(typeof(AgentRole), agent.agentRoleNames[0]);
                    req.DispositionedBy     = (Guid)agent.agentGuid;
                    req.Disposition         = disposition == null ? Disposition.FalsePositive  : (Disposition)disposition;
                    req.DispositionDate     = DateTime.Now;
                    ResponseObject <EmptyResult> dispositionDataResponse = dataClient.Disposition(req);
                    if (dispositionDataResponse.statusCode != System.Net.HttpStatusCode.OK || dispositionDataResponse.statusCode != System.Net.HttpStatusCode.NoContent)
                    {
                        log.Error($"We could not successfully clear alerts for alert flag with guid {d.DataObjectGuid.ToString()} on loanapplication {d.LoanApplicationGuid.ToString()}.");
                        return(false);
                    }
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #2
0
        public static ResponseObject <GetOffersResponse> UpdateLoanApplicationPassStips(string loanApplicationGuid)
        {
            var loanAppClient      = new LoanApplicationClient();
            var loanApp            = loanAppClient.GetLoanApplication(loanApplicationGuid);
            var saveLoanAppRequest = new UpdateLoanApplicationRequest();

            saveLoanAppRequest.LoanApplication = loanApp.content;

            saveLoanAppRequest.LoanApplicationVerificationFlags = new LoanApplicationVerificationFlags();
            saveLoanAppRequest.LoanApplicationVerificationFlags.AccountHolderVerified      = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.AccountNumberVerified      = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.AddressVerified            = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.DobVerified                = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.EmailVerified              = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.EmployerNameVerified       = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.EmploymentStatusVerified   = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.NameVerified               = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.OtherContactNumberVerified = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.OwnRentVerified            = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.PrimaryPhoneNumberVerified = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.SsnVerified                = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.WorkAddressVerified        = true;
            saveLoanAppRequest.LoanApplicationVerificationFlags.WorkPhoneNumberVerified    = true;
            saveLoanAppRequest.VerifiedBorrowerIncome = loanApp.content.LoanFile.Borrowers[0].AnnualIncome;
            saveLoanAppRequest.VerifiedBorrowerDebt   = loanApp.content.LoanFile.Debt[0].Amount;
            //saveLoanAppRequest.VerifiedBorrowerIncome
            //Dispositions for uploaded files
            var docGuids = GetFileUploadGuids(loanApplicationGuid);

            foreach (string dg in docGuids)
            {
                ResponseObject <EmptyResult> disposition = new UploadedDocumentsClient().DocumentDisposition(dg, "Pass");
            }

            var findAlertsRequest = new SearchAlertFlagsRequest();

            findAlertsRequest.LoanApplicationGuid = new Guid(loanApplicationGuid);
            var alertsClient = new AlertFlagClient();
            var alerts       = alertsClient.AlertFlagSearch(findAlertsRequest);
            var agentGuid    = (Guid)GetAgentByUserName("uw").agentGuid;
            var agent        = GetAgentByUserName("uw");

            if (ClearAlerts(alerts.content, agent) == false)
            {
                Assert.Fail("Cannot continue because alerts could not be cleared.");
            }

            var findDataObjectsRequest = new SearchDataObjectRequest();

            findDataObjectsRequest.LoanApplicationGuid = new Guid(loanApplicationGuid);
            var dataObjectClient = new DataObjectClient();
            var dataObjects      = dataObjectClient.DataObjectSearch(findDataObjectsRequest);

            if (DispositionDataObjects(dataObjects.content, agent, Disposition.FalsePositive) == false)
            {
                Assert.Fail("Cannot continue because data object could not be dispositioned.");
            }

            var response         = loanAppClient.SaveLoanApplicationUW(saveLoanAppRequest);
            var hardPullResponse = new LoanApplicationThirdPartyClient().RunHardPull(loanApplicationGuid);
            var reprice          = new LoanApplicationOffersClient().Reprice(loanApplicationGuid);

            return(reprice);
        }