Beispiel #1
0
        public ProfileSummaryModel CreateProfile(Customer customer, CreditBureauModel creditBureau, CompanyScoreModel companyScore)
        {
            TimeCounter tc      = new TimeCounter("ProfileSummaryModel 1 building time for customer " + customer.Id);
            var         summary = new ProfileSummaryModel();

            using (tc.AddStep("BuildCustomerSummary Time taken")) {
                BuildCustomerSummary(summary, customer);
            }
            using (tc.AddStep("BuildCreditBureau Time taken")) {
                BuildCreditBureau(customer, summary, creditBureau);
            }
            using (tc.AddStep("AddDecisionHistory Time taken")) {
                AddDecisionHistory(summary, customer);
            }
            using (tc.AddStep("BuildRequestedLoan Time taken")) {
                BuildRequestedLoan(summary, customer);
            }
            using (tc.AddStep("BuildAlerts Time taken")) {
                BuildAlerts(summary, customer);
            }
            using (tc.AddStep("BuildCompaniesHouseAlerts Time taken")) {
                BuildCompaniesHouseAlerts(summary, companyScore);
            }
            log.Info(tc.ToString());
            return(summary);
        }
Beispiel #2
0
        private void BuildCreditBureau(Customer customer, ProfileSummaryModel summary, CreditBureauModel creditBureauModel = null)
        {
            var creditBureau = new CreditBureau();

            if (creditBureauModel == null)
            {
                creditBureauModel = this.creditBureauModelBuilder.Create(customer);
            }

            if (creditBureauModel.Consumer != null && creditBureauModel.Consumer.ServiceLogId != null)
            {
                creditBureau.CreditBureauScore      = creditBureauModel.Consumer.Score;
                creditBureau.TotalDebt              = creditBureauModel.Consumer.TotalAccountBalances;
                creditBureau.TotalMonthlyRepayments = creditBureauModel.Consumer.TotalMonthlyRepayments;
                creditBureau.CreditCardBalances     = creditBureauModel.Consumer.CreditCardBalances;
                creditBureau.BorrowerType           = customer.PersonalInfo.TypeOfBusiness.TypeOfBussinessForWeb();
                creditBureau.FinancialAccounts      = creditBureauModel.Consumer.AccountsInformation.Count();
                creditBureau.ThinFile = creditBureau.FinancialAccounts == 0 ? "Yes" : "No";
                // patch to fix crashing underwriter
                creditBureau.ApplicantDOBs = new List <DateTime?> {
                    creditBureauModel.Consumer.Applicant != null ? creditBureauModel.Consumer.Applicant.DateOfBirth : null
                };

                if (creditBureauModel.Directors.Any())
                {
                    foreach (var director in creditBureauModel.Directors)
                    {
                        if (director != null && director.ServiceLogId != null && !director.AccountsInformation.Any())
                        {
                            creditBureau.NumDirectorThinFiles++;
                        }

                        if (director == null || director.ServiceLogId == null)
                        {
                            creditBureau.NumDirectorNA++;
                        }
                    }
                }
            }
            else
            {
                creditBureau.ThinFile = "N/A";
            }

            summary.CreditBureau = creditBureau;
        }