private bool IsDataVerified(CreditRequest creditRequest) { return(IsPersonalDataValid(creditRequest.Requester) && AreNamesCorrect(creditRequest.Requester) && IsEmployed(creditRequest.Requester) && IsProperIncome(creditRequest.Requester)); }
private bool IsRiskEstimatedOk(CreditRequest creditRequest) { switch (creditRequest.RiskOfInvestment) { case RiskLevel.Low: { return(creditRequest.Amount <= 500000 && creditRequest.Percentage >= 6.0 && creditRequest.TimeInMonths >= 12); } case RiskLevel.Normal: { return(creditRequest.Amount <= 250000 && creditRequest.Percentage >= 10.0 && creditRequest.TimeInMonths >= 24); } case RiskLevel.High: { return(creditRequest.Amount <= 100000 && creditRequest.Percentage >= 12.0 && creditRequest.TimeInMonths >= 24); } case RiskLevel.VeryHigh: { return(creditRequest.Amount <= 75000 && creditRequest.Percentage >= 15.0 && creditRequest.TimeInMonths >= 36); } default: { return(false); } } }
public void Process(CreditRequest creditRequest, ref string returnMessage) { if (IsDataVerified(creditRequest) && _nextStage != null) { _nextStage.Process(creditRequest, ref returnMessage); } else { returnMessage = "Verifier failed"; } }
public void Process(CreditRequest creditRequest, ref string returnMessage) { if (IsAnalysisFine(creditRequest) && _nextStage != null) { _nextStage.Process(creditRequest, ref returnMessage); } else { returnMessage = "Analyzer failed"; } }
public bool IsAnalysisFine(CreditRequest creditRequest) { int points = 0; points += GetPointsForEmployment(creditRequest.Requester.EmploymentType); points += GetPointsForIncome(creditRequest.Requester.MonthIncome); points += GetPointsForAge(creditRequest.Requester.Age); points += GetPointsForCreditHistory(creditRequest.Requester.CreditHistory); points += GetPointsForCreditStatus(creditRequest.Requester.HasAlreadyCredit); return(points > 8); }
public void Process(CreditRequest creditRequest, ref string returnMessage) { if (IsRiskEstimatedOk(creditRequest)) { returnMessage = "Credit acquired"; } else { returnMessage = "RiskEstimator failed"; } if (_nextStage != null) { _nextStage.Process(creditRequest, ref returnMessage); } }