Ejemplo n.º 1
0
        protected override void ExecuteStep()
        {
            DateTime now = DateTime.UtcNow;

            var sp = new GetCustomerCompanyID(DB, Log)
            {
                CustomerID = this.customerID,
                Now        = now,
            };

            sp.ExecuteNonQuery();

            CompanyID = sp.CompanyID;

            TypeOfBusiness tob;

            TypeOfBusiness = Enum.TryParse(sp.TypeOfBusiness, true, out tob) ? tob : TypeOfBusiness.Entrepreneur;

            MonthlyRepayment = InjectorStub.GetEngine().GetMonthlyRepaymentData(this.customerID, now);

            Log.Debug(
                "Customer {0} at {1}: company ID is {2}, monthly repayment is {3} (requested {4} for {5}).",
                this.customerID,
                now.MomentStr(),
                CompanyID,
                MonthlyRepayment.MonthlyPayment.ToString("C0"),
                MonthlyRepayment.RequestedAmount.ToString("C0"),
                Grammar.Number(MonthlyRepayment.RequestedTerm, "month")
                );
        }         // ExecuteStep
Ejemplo n.º 2
0
        public ApplyBackdoorLogic(
            string outerContextDescription,
            bool backdoorEnabled,
            int customerID,
            string customerEmail,
            bool customerOwnsProperty,
            bool customerIsTest,
            CashRequestOriginator?cashRequestOriginator,
            long cashRequestID,
            long nlCashRequestID,
            int homeOwnerCap,
            int notHomeOwnerCap,
            int smallLoanScenarioLimit,
            bool aspireToMinSetupFee,
            TypeOfBusiness typeOfBusiness,
            int customerOriginID,
            MonthlyRepaymentData requestedLoan,
            int delay,
            int offerValidHours,
            string tag
            ) : base(outerContextDescription)
        {
            this.backdoorEnabled        = backdoorEnabled;
            this.customerID             = customerID;
            this.customerEmail          = customerEmail;
            this.customerOwnsProperty   = customerOwnsProperty;
            this.customerIsTest         = customerIsTest;
            this.cashRequestOriginator  = cashRequestOriginator ?? CashRequestOriginator.Other;
            this.cashRequestID          = cashRequestID;
            this.nlCashRequestID        = nlCashRequestID;
            this.homeOwnerCap           = homeOwnerCap;
            this.notHomeOwnerCap        = notHomeOwnerCap;
            this.smallLoanScenarioLimit = smallLoanScenarioLimit;
            this.aspireToMinSetupFee    = aspireToMinSetupFee;
            this.typeOfBusiness         = typeOfBusiness;
            this.customerOriginID       = customerOriginID;
            this.requestedLoan          = requestedLoan;
            this.delay           = delay;
            this.offerValidHours = offerValidHours;
            this.tag             = tag;

            BackdoorLogicApplied = false;

            AutoDecisionResponse = new AutoDecisionResponse(this.customerID);

            Medal       = null;
            OfferResult = null;
        }         // constructor
Ejemplo n.º 3
0
        public CalculateOfferIfPossible(
            string outerContextDescription,
            int customerID,
            long cashRequestID,
            long nlCashRequestID,
            string tag,
            AutoRejectionOutput autoRejectionOutput,
            MonthlyRepaymentData requestedLoan,
            int homeOwnerCap,
            int notHomeOwnerCap,
            int smallLoanScenarioLimit,
            bool aspireToMinSetupFee
            ) : base(outerContextDescription)
        {
            this.customerID             = customerID;
            this.cashRequestID          = cashRequestID;
            this.nlCashRequestID        = nlCashRequestID;
            this.autoRejectionOutput    = autoRejectionOutput ?? new AutoRejectionOutput();
            this.requestedLoan          = requestedLoan;
            this.homeOwnerCap           = homeOwnerCap;
            this.notHomeOwnerCap        = notHomeOwnerCap;
            this.smallLoanScenarioLimit = smallLoanScenarioLimit;
            this.aspireToMinSetupFee    = aspireToMinSetupFee;

            OfferResult     = null;
            ProposedAmount  = 0;
            this.loanSource = null;

            this.gradeID    = null;
            this.subGradeID = null;

            this.allLoanSources = ((LoanSourceName[])Enum.GetValues(typeof(LoanSourceName))).Select(x => (int)x).ToArray();

            this.medalAgent = new CalculateMedal(
                this.customerID,
                this.cashRequestID,
                this.nlCashRequestID,
                DateTime.UtcNow,
                false,
                true
                )
            {
                Tag = tag,
            };
        }         // constructor
Ejemplo n.º 4
0
 public void SetAdditionalCustomerData(
     long acashRequestID,
     long anlCashRequestID,
     int asmallLoanScenarioLimit,
     bool aaspireToMinSetupFee,
     TypeOfBusiness atypeOfBusiness,
     int acustomerOriginID,
     MonthlyRepaymentData arequestedLoan,
     int aofferValidHours
     )
 {
     this.cashRequestID          = acashRequestID;
     this.nlCashRequestID        = anlCashRequestID;
     this.smallLoanScenarioLimit = asmallLoanScenarioLimit;
     this.aspireToMinSetupFee    = aaspireToMinSetupFee;
     this.typeOfBusiness         = atypeOfBusiness;
     this.customerOriginID       = acustomerOriginID;
     this.requestedLoan          = arequestedLoan;
     this.offerValidHours        = aofferValidHours;
 }         // SetAdditionalCustomerData