-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapprovalFactors.js
65 lines (45 loc) · 1.2 KB
/
approvalFactors.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const CREDIT_MINIMUM = 640;
const GOOD = 0
const BAD = 1
const MEDIUM = 2
function IsCreditValid(creditRating) {
if(creditRating >= CREDIT_MINIMUM){
return GOOD;
}
else{
return BAD;
}
}
function LTV(downPayment , houseAppraisalValue) {
loanValue = (1 - (downPayment/houseAppraisalValue));
if(loanValue <= .80) {
return GOOD;
}
else if(loanValue <= .95){
pmiHouseValueAdded = houseAppraisalValue + (houseAppraisalValue*.01)
return MEDIUM;
}else if (loanValue <= 1.0){
pmiHouseValueAdded = houseAppraisalValue + (houseAppraisalValue*.01)
return BAD;
}
else {
return BAD;
}
}
function DTI(grossIncome, carPayment , creditCardPayment , mortgage, studentLoans) {
totalDebtToIncome = ((carPayment + creditCardPayment + mortgage + studentLoans)/grossIncome);
totalMortgageDebt = mortgage / grossIncome;
if(totalMortgageDebt >= .28) {
return BAD;
}
else if(totalDebtToIncome <= .36){
return GOOD;
}
else if (totalDebtToIncome <= .43){
return MEDIUM;
}
else{
return BAD;
}
}
export default { IsCreditValid, LTV , DTI };