public ManualIfNotDecided(
     string outerContextDescription,
     AutoDecisionResponse autoDecisionResponse
     ) : base(outerContextDescription)
 {
     this.autoDecisionResponse = autoDecisionResponse;
 }         // constructor
Beispiel #2
0
        public MainStrategyUpdateCrC(
            DateTime now,
            int customerID,
            long cashRequestID,
            AutoDecisionResponse autoDecisionResponse,
            AConnection db,
            ASafeLog log
            ) : base(db, log)
        {
            this.now = now;

            this.customerID           = customerID;
            CashRequestID             = cashRequestID;
            this.autoDecisionResponse = autoDecisionResponse;

            this.loanSourceToUse = this.autoDecisionResponse.LoanSource;

            this.repaymentPeriodToUse = this.autoDecisionResponse.RepaymentPeriod;

            this.isCustomerRepaymentPeriodSelectionAllowedToUse = this.loanSourceToUse.ValidatePeriodSelectionAllowed(
                this.autoDecisionResponse.IsCustomerRepaymentPeriodSelectionAllowed
                );

            if (this.autoDecisionResponse.DecidedToApprove)
            {
                this.interestRateToUse = this.loanSourceToUse.ValidateInterestRate(this.autoDecisionResponse.InterestRate);
            }

            this.repaymentPeriodToUse = this.loanSourceToUse.ValidateRepaymentPeriod(this.repaymentPeriodToUse);
        }         // constructor
 public DispatchNotifications(
     string outerContextDescription,
     bool isSilentlyApproved,
     StrategiesMailer mailer,
     MedalResult medal,
     CustomerDetails customerDetails,
     AutoDecisionResponse autoDecisionResponse,
     OfferResult offerResult,
     Guid?approvalTrailUniqueID,
     string silentEmailRecipient,
     string silentEmailSenderName,
     string silentEmailSenderAddress
     ) : base(outerContextDescription)
 {
     this.isSilentlyApproved = isSilentlyApproved;
     this.mailer             = mailer;
     this.medal                    = medal;
     this.customerDetails          = customerDetails;
     this.autoDecisionResponse     = autoDecisionResponse;
     this.offerResult              = offerResult;
     this.approvalTrailUniqueID    = approvalTrailUniqueID;
     this.silentEmailRecipient     = silentEmailRecipient;
     this.silentEmailSenderName    = silentEmailSenderName;
     this.silentEmailSenderAddress = silentEmailSenderAddress;
 }         // constructor
Beispiel #4
0
 public LockRerejected(
     string outerContextDescription,
     AutoDecisionResponse response
     ) : base(outerContextDescription)
 {
     this.autoDecisionResponse = response;
 }         // constructor
Beispiel #5
0
        }         // Create

        public override bool SetResult(AutoDecisionResponse response)
        {
            Log.Debug("Back door simple flow: using manual decision...");

            if (!CalculateMedalAndOffer())
            {
                Log.Debug(
                    "Back door simple flow: failed to set manual for customer {0} because of medal/offer.",
                    this.customerID
                    );
                return(false);
            }             // if

            response.CreditResult   = CreditResultStatus.WaitingForDecision;
            response.UserStatus     = Status.Manual;
            response.SystemDecision = SystemDecision.Manual;

            response.HasApprovalChance = false;

            DoDelay();

            Log.Debug("Back door simple flow: manual decision.");

            return(true);
        }         // SetResults
Beispiel #6
0
 protected ALockManual(
     string outerContextDescription,
     AutoDecisionResponse response
     ) : base(outerContextDescription)
 {
     this.autoDecisionResponse = response;
 }         // constructor
Beispiel #7
0
        public WriteDecisionDown(
            string outerContextDescription,
            int underwriterID,
            int customerID,
            long cashRequestID,
            long nlCashRequestID,
            int offerValidForHours,
            AutoDecisionResponse autoDecisionResponse,
            MedalResult medal,
            bool overrideApprovedRejected,
            int experianConsumerScore
            ) : base(
                outerContextDescription,
                underwriterID,
                cashRequestID,
                nlCashRequestID,
                offerValidForHours,
                autoDecisionResponse
                )
        {
            this.customerID = customerID;
            this.medal      = medal;
            this.overrideApprovedRejected = overrideApprovedRejected;
            this.experianConsumerScore    = experianConsumerScore;

            this.outcome          = "'not executed'";
            WriteDecisionOutput   = null;
            CashRequestWasWritten = false;
        }         // constructor
Beispiel #8
0
        private static void TestReapproval(AConnection oDB, ASafeLog oLog)
        {
            var adr = new AutoDecisionResponse();

            var ra = new Agent(339, oDB, oLog).Init();

            ra.MakeDecision(adr);
        }
Beispiel #9
0
 public LockReapproved(
     string outerContextDescription,
     AutoDecisionResponse autoDecisionResponse,
     AutoReapprovalOutput output
     ) : base(outerContextDescription)
 {
     this.autoDecisionResponse = autoDecisionResponse;
     this.output = output;
 }         // constructor
 public MainStrategySetApproved(
     int customerID,
     long cashRequestID,
     bool overrideApprovedRejected,
     AutoDecisionResponse autoDecisionResponse,
     AConnection db,
     ASafeLog log
     ) : base(db, log)
 {
     CustomerID                = customerID;
     CashRequestID             = cashRequestID;
     OverrideApprovedRejected  = overrideApprovedRejected;
     this.autoDecisionResponse = autoDecisionResponse;
 }         // constructor
Beispiel #11
0
 protected ASaveDecisionBase(
     string outerContextDescription,
     int underwriterID,
     long cashRequestID,
     long nlCashRequestID,
     int offerValidForHours,
     AutoDecisionResponse autoDecisionResponse
     ) : base(outerContextDescription)
 {
     this.underwriterID        = underwriterID;
     this.cashRequestID        = cashRequestID;
     this.nlCashRequestID      = nlCashRequestID;
     this.offerValidForHours   = offerValidForHours;
     this.autoDecisionResponse = autoDecisionResponse;
 }         // constructor
Beispiel #12
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
Beispiel #13
0
        public MainStrategyContextData(MainStrategyArguments args)
        {
            this.arguments = args;

            IsSilentlyApproved             = false;
            LoanOfferEmailSendingBannedNew = false;

            AutoRejectionOutput       = null;
            AutoReapprovalOutput      = null;
            AutoApprovalTrailUniqueID = null;

            OverrideApprovedRejected = true;
            CashRequestID            = this.arguments.CashRequestID ?? 0;
            NLCashRequestID          = 0;
            CashRequestOriginator    = this.arguments.CashRequestOriginator;

            if (FinishWizardArgs != null)
            {
                CashRequestOriginator    = FinishWizardArgs.CashRequestOriginator;
                FinishWizardArgs.DoMain  = false;
                OverrideApprovedRejected = FinishWizardArgs.CashRequestOriginator != CashRequestOriginatorType.Approved;
            }             // if

            WasMismatch = false;

            AutoDecisionResponse = new AutoDecisionResponse(this.arguments.CustomerID);

            Tag = string.Format(
                "#MainStrategy_{0}_{1}",
                DateTime.UtcNow.ToString("yyyy-MM-dd-HH-mm-ss", CultureInfo.InvariantCulture),
                Guid.NewGuid().ToString().ToUpperInvariant()
                );

            CustomerDetails = new Helpers.CustomerDetails(this.arguments.CustomerID);

            HasCashRequest         = false;
            CashRequestWasWritten  = false;
            ShuttingDownUbnormally = false;
            DelayReason            = string.Empty;
            CurrentStepName        = "not started";

            WriteDecisionOutput = null;

            BackdoorLogicApplied = false;
            BackdoorInvestorID   = null;
        }         // constructor
Beispiel #14
0
 public ExternalNotifier(
     StrategiesMailer mailer,
     int customerId,
     MedalResult medal,
     CustomerDetails customerDetails,
     AutoDecisionResponse autoDecisionResponse,
     bool sendToCustomer,
     ASafeLog log
     )
 {
     this.mailer               = mailer;
     this.customerId           = customerId;
     this.medal                = medal;
     this.customerDetails      = customerDetails;
     this.autoDecisionResponse = autoDecisionResponse;
     this.sendToCustomer       = sendToCustomer;
     this.log = log.Safe();
 }         // constructor
        public override bool SetResult(AutoDecisionResponse response)
        {
            Log.Debug("Back door simple flow: approving customer {0}...", this.customerID);

            if (!CalculateMedalAndOffer())
            {
                Log.Debug(
                    "Back door simple flow: not approved customer {0} because medal/offer calculation failed.",
                    this.customerID
                    );
                return(false);
            }             // if

            response.ProposedAmount    = ApprovedAmount;
            response.ApprovedAmount    = ApprovedAmount;
            response.HasApprovalChance = true;
            response.CreditResult      = CreditResultStatus.Approved;
            response.UserStatus        = Status.Approved;
            response.SystemDecision    = SystemDecision.Approve;

            response.DecisionName = "Approval";
            response.AppValidFor  = DateTime.UtcNow.AddHours(this.offerValidHours);
            response.Decision     = DecisionActions.Approve;
            response.LoanOfferEmailSendingBannedNew = false;

            response.RepaymentPeriod  = OfferResult.Period;
            response.LoanSourceID     = OfferResult.LoanSourceId;
            response.LoanTypeID       = OfferResult.LoanTypeId;
            response.InterestRate     = OfferResult.InterestRate / 100;
            response.SetupFee         = OfferResult.SetupFee / 100;
            response.ProductSubTypeID = this.productSubTypeID;

            DoDelay();

            Log.Debug("Back door simple flow: approved for customer {0}.", this.customerID);

            return(true);
        }         // SetResult
Beispiel #16
0
 public LockApproved(
     string outerContextDescription,
     AutoDecisionResponse autoDecisionResponse,
     bool autoApproveIsSilent,
     OfferResult offerResult,
     int loanSourceID,
     bool isEmailSendingBanned,
     int offerValidForHours,
     int minLoanAmount,
     int maxLoanAmount,
     int?productSubTypeID
     ) : base(outerContextDescription)
 {
     this.autoDecisionResponse = autoDecisionResponse;
     this.autoApproveIsSilent  = autoApproveIsSilent;
     this.offerResult          = offerResult;
     this.loanSourceID         = loanSourceID;
     this.isEmailSendingBanned = isEmailSendingBanned;
     this.offerValidForHours   = offerValidForHours;
     this.minLoanAmount        = minLoanAmount;
     this.maxLoanAmount        = maxLoanAmount;
     this.productSubTypeID     = productSubTypeID;
     IsSilentlyApproved        = false;
 }         // constructor
 public RestoreAndSaveApproved(
     string outerContextDescription,
     int underwriterID,
     int customerID,
     long cashRequestID,
     long nlCashRequestID,
     bool overrideApprovedRejected,
     int offerValidForHours,
     AutoDecisionResponse autoDecisionResponse,
     WriteDecisionOutput approvalToRestore
     ) : base(
         outerContextDescription,
         underwriterID,
         cashRequestID,
         nlCashRequestID,
         offerValidForHours,
         autoDecisionResponse
         )
 {
     this.customerID = customerID;
     this.overrideApprovedRejected = overrideApprovedRejected;
     this.approvalToRestore        = approvalToRestore;
     this.outcome = "'not executed'";
 }         // constructor
Beispiel #18
0
        }         // Create

        public override bool SetResult(AutoDecisionResponse response)
        {
            Log.Debug("Back door simple flow: rejecting customer {0}...", this.customerID);

            if (!CalculateMedalAndOffer())
            {
                Log.Debug("Back door simple flow: failed to rejected customer {0} because of medal/offer.", this.customerID);
                return(false);
            }             // if

            response.CreditResult   = CreditResultStatus.Rejected;
            response.UserStatus     = Status.Rejected;
            response.SystemDecision = SystemDecision.Reject;
            response.DecisionName   = "Rejection";
            response.Decision       = DecisionActions.Reject;

            response.HasApprovalChance = this.hasApprovalChance;

            DoDelay();

            Log.Debug("Back door simple flow: rejected customer {0}.", this.customerID);

            return(true);
        }         // SetResults
 public abstract bool SetResult(AutoDecisionResponse response);
Beispiel #20
0
 public PreventAutoDecision(
     string outerContextDescription,
     AutoDecisionResponse autoDecisionResponse
     ) : base(outerContextDescription, autoDecisionResponse)
 {
 } // constructor
Beispiel #21
0
 public ForceManual(
     string outerContextDescription,
     AutoDecisionResponse autoDecisionResponse
     ) : base(outerContextDescription, autoDecisionResponse)
 {
 }         // constructor
Beispiel #22
0
 public LockManualAfterApproval(
     string outerContextDescription,
     AutoDecisionResponse autoDecisionResponse
     ) : base(outerContextDescription, autoDecisionResponse)
 {
 } // constructor