<commit_before>package com.ofg.microservice.fraud

import org.springframework.stereotype.Service

/**
 * Created by Ceyhun.Hallac on 03/10/2014.
 */
@Service
class FraudService {

    FraudStatus checkLoanApplication(LoanApplication loanApplication) {
        return null;
    }
}<commit_msg>FraudServicce - first draft<commit_after>package com.ofg.microservice.fraud

import org.springframework.stereotype.Service

/**
 * Created by Ceyhun.Hallac on 03/10/2014.
 */
@Service
class FraudService {
    
    private final String JOB_POSITION_OTHER = 'OTHER' 
    private final String JOB_POSITION_FINANCE_SECTOR = 'FINANCE SECTOR' 
    private final String JOB_POSITION_IT = 'IT' 
    private final Integer MIN_AGE = 18 
    private final Integer MAX_AGE = 65
    private final BigDecimal MIN_AMOUNT = 1000
    private final BigDecimal MAX_AMOUNT = 2000

    FraudStatus checkLoanApplication(LoanApplication loanApplication) {

        final FraudStatus status
        if(isClientFraud(loanApplication)) {
            status = FraudStatus.FRAUD
        } else if(isClientFishy(loanApplication)) {
            status = FraudStatus.FISHY
        } else if(isClientOK(loanApplication)) {
            status = FraudStatus.OK
        }
        
        return status;
    }
    
    boolean isClientFraud(LoanApplication loanApplication) {
        return JOB_POSITION_OTHER.equals(loanApplication.job) && 
                loanApplication.age < MIN_AGE && 
                loanApplication.amount > MAX_AMOUNT && 
                isCustomerNameFraud(loanApplication.firstName, loanApplication.lastName)
    }
    
    boolean isClientFishy(LoanApplication loanApplication) {
        //TODO to be implemented
    }
    
    boolean isClientOK(LoanApplication loanApplication) {
        //TODO to be implemented
    }
    
    boolean isCustomerNameOK(String firstName, String lastName) {
        //TODO to be implemented
    }
    
    
}
{'fraction_non_alphanumeric': 0.06950207468879668, 'fraction_numerical': 0.014522821576763486, 'mean_word_length': 2.760233918128655, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1888947', 'n_tokens_mistral': 604, 'n_tokens_neox': 543, 'n_words': 120}