src/main/java/RulesEngineModel/RulesEngine.java
private boolean checkIfIsDisqualified(IPerson person, IProduct product) {

        //disqualified by default
        boolean isDisqualified = true;

        String state = person.getState();
        Integer creditScore = person.getCreditScore();
        Integer minCreditScoreRule = product.getMinimumCreditScoreRules();

        List<String> disqualifiedStatesRule = product.getProductDisqualifiedStates();

        // qualified if disqualifiedStatesRule list does not contain person's state
        if(state != null && !disqualifiedStatesRule.contains(state)) {
            isDisqualified = false;

            // disqualified if person's credit score is lower then minCreditScoreRule
            if(creditScore < minCreditScoreRule) {
                isDisqualified = true;
            }
        }

        return isDisqualified;
    }
//Check if applicant is disqualified due to person's residing State or credit score, based on the product's rules
Check if applicant is disqualified due to person's residing State or credit score, based on the product's rules
Check if applicant is disqualified due to person ' s residing State or credit score based on the product ' s rules
private boolean checkIfIsDisqualified(IPerson person, IProduct product) {
        boolean isDisqualified = true;
        String state = person.getState();
        Integer creditScore = person.getCreditScore();
        Integer minCreditScoreRule = product.getMinimumCreditScoreRules();
        List<String> disqualifiedStatesRule = product.getProductDisqualifiedStates();
        if(state != null && !disqualifiedStatesRule.contains(state)) {
            isDisqualified = false;
            if(creditScore < minCreditScoreRule) {
                isDisqualified = true;
            }
        }
        return isDisqualified;
    }
private boolean checkIfIsDisqualified ( IPerson person , IProduct product ) { boolean isDisqualified = true ; String state = person . getState ( ) ; Integer creditScore = person . getCreditScore ( ) ; Integer minCreditScoreRule = product . getMinimumCreditScoreRules ( ) ; List < String > disqualifiedStatesRule = product . getProductDisqualifiedStates ( ) ; if ( state != null && ! disqualifiedStatesRule . contains ( state ) ) { isDisqualified = false ; if ( creditScore < minCreditScoreRule ) { isDisqualified = true ; } } return isDisqualified ; }
Check if applicant is disqualified due to person's residing State or credit score, based on the product's rules
Check if applicant is disqualified due to person ' s residing State or credit score based on the product ' s rules
//disqualified by default // qualified if disqualifiedStatesRule list does not contain person's state // disqualified if person's credit score is lower then minCreditScoreRule