Performing an Automatic Review
There is support for having Capitex Företagslån generate a recommendation on how to proceed with the case, similar to the "traffic lights" from UC credit advice.
For this you would use the endpoint PerformAutomaticReview:
PerformAutomaticReview example
//Create the credit case input
CompanyCalcInput caseData =
new
CompanyCalcInput();
caseData.setCalculationDate(
new
Date());
caseData.getCalculationDate().setYear(
2020
);
caseData.getCalculationDate().setMonth(
10
);
CalcInformation calcInformation =
new
CalcInformation();
caseData.setCalcInformation(calcInformation);
DateWithDay actualDate1 =
new
DateWithDay();
caseData.setActualDate(actualDate1);
actualDate1.setDay(
14
);
actualDate1.setYear(
2020
);
actualDate1.setMonth(
10
);
Company company1 =
new
Company();
caseData.getCompanies().add(company1);
company1.setID(
"5B0A693B-65AB-46B6-826E-7B9362743D4C"
);
CompanyInformation companyInformation1 =
new
CompanyInformation();
company1.setCompanyInformation(companyInformation1);
companyInformation1.setOrgNo(
"1234567890"
);
DateWithDay currentTime =
new
DateWithDay();
currentTime.setYear(
2023
);
currentTime.setMonth(
6
);
// June
currentTime.setDay(
12
);
// 12th
PerformAutomaticReviewInput performAutomaticReviewInput =
new
PerformAutomaticReviewInput();
performAutomaticReviewInput.setInputData(caseData);
performAutomaticReviewInput.setCurrentDateTime(currentTime);
// used for the date of the recommendation
caseData = app.performAutomaticReview(performAutomaticReviewInput);
calcInformation = caseData.getCalcInformation();
CaseAction capitexRecommendation =
null
;
for
(CaseActionRecommendation recommendation : calcInformation.getCaseActionRecommendations()) {
if
(
"CAPITEX_AUTO_REVIEW"
.equals(recommendation.getRecommenderIdentifier())) {
capitexRecommendation = recommendation.getRecommendedAction();
}
}
switch
(capitexRecommendation) {
case
APPROVE: {
// do 'Beviljas' action
break
;
}
case
REVIEW: {
// do 'Pröva' action
break
;
}
case
REJECT: {
// do 'Avslå' action
break
;
}
case
NONE:
default
: {
// no recommendation at all
}
}