Skip to content

Commit

Permalink
FBR-460 bypass prequalification check for bulk import (#332)
Browse files Browse the repository at this point in the history
Co-authored-by: Faheem Ahmad <[email protected]>
  • Loading branch information
faheem205 and Faheem Ahmad authored Dec 12, 2023
1 parent b3fd143 commit 8e04abd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,7 @@ private CommandProcessingResult importLoan(int rowIndex, String dateFormat) {
}
}
loanJsonOb.remove("isTopup");
loanJsonOb.addProperty("isBulkImport", true);
String payload = loanJsonOb.toString();
final CommandWrapper commandRequest = new CommandWrapperBuilder() //
.createLoanApplication() //
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public final class LoanApplicationCommandFromApiJsonHelper {
LoanApiConstants.lastApplication, // glim specific
LoanApiConstants.daysInYearTypeParameterName, LoanApiConstants.fixedPrincipalPercentagePerInstallmentParamName,
LoanApiConstants.cupoIdParameterName, LoanApiConstants.PREQUALIFICATION_ID, LoanApiConstants.CASE_ID,
LoanApiConstants.LOAN_ADDITIONAL_DATA, "borrowerCycle"));
LoanApiConstants.LOAN_ADDITIONAL_DATA, "borrowerCycle", "isBulkImport"));

private final FromJsonHelper fromApiJsonHelper;
private final CalculateLoanScheduleQueryFromApiJsonHelper apiJsonHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,15 @@ private Loan assembleApplication(final JsonElement element, final Long clientId,
}
}

final Long prequalificationId = this.fromApiJsonHelper.extractLongNamed("prequalificationId", element);
final PrequalificationGroup prequalificationGroup = this.prequalificationGroupRepositoryWrapper
.findOneWithNotFoundDetection(prequalificationId);
if (!PrequalificationStatus.BURO_CHECKED.getValue().equals(prequalificationGroup.getStatus())) {
throw new PrequalificationIncorrectStatusException(PrequalificationStatus.fromInt(prequalificationGroup.getStatus()).getCode());
PrequalificationGroup prequalificationGroup = null;
final Boolean isBulkImport = this.fromApiJsonHelper.extractBooleanNamed("isBulkImport", element);
if (isBulkImport == null || !isBulkImport) {
final Long prequalificationId = this.fromApiJsonHelper.extractLongNamed("prequalificationId", element);
prequalificationGroup = this.prequalificationGroupRepositoryWrapper
.findOneWithNotFoundDetection(prequalificationId);
if (!PrequalificationStatus.BURO_CHECKED.getValue().equals(prequalificationGroup.getStatus())) {
throw new PrequalificationIncorrectStatusException(PrequalificationStatus.fromInt(prequalificationGroup.getStatus()).getCode());
}
}
loanApplicationTerms = this.loanScheduleAssembler.assembleLoanTerms(element);
loanApplicationTerms.getCalculatedRepaymentsStartingFromLocalDate();
Expand Down

0 comments on commit 8e04abd

Please sign in to comment.