Skip to content

Commit

Permalink
Merge pull request #403 from fiterlatam/FBR-429-loan-restructure
Browse files Browse the repository at this point in the history
FBR-429 fixed prequalificationgroup id issue for restructured loans
  • Loading branch information
faheem205 authored Jan 8, 2024
2 parents d30e0f5 + ea63c96 commit cab004b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ private Long openNewLoanAccount(RestructureCreditsRequest request, JsonCommand c
loanObject.add("principal", this.fromApiJsonHelper.parse(request.getTotalLoanAmount().toPlainString()));
loanObject.add("locale", command.jsonElement("locale"));
loanObject.add("dateFormat", command.jsonElement("dateFormat"));
loanObject.addProperty("isRestructuredLoan", true);
JsonElement finalCommand = this.fromApiJsonHelper.parse(loanObject.toString());

JsonCommand jsonCommand = JsonCommand.fromExistingCommand(command, finalCommand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public final class LoanApplicationCommandFromApiJsonHelper {
LoanApiConstants.paymentCapacityParamName, LoanApiConstants.facilitatorParamName, LoanApiConstants.maidenNameParamName,
LoanApiConstants.politicallyExposedParamName, LoanApiConstants.otherIncomeParamName, LoanApiConstants.currentLoansParamName,
LoanApiConstants.dateOfBirthParamName, LoanApiConstants.businessActivityParamName, LoanApiConstants.LOAN_ADDITIONAL_DATA,
"borrowerCycle", "isBulkImport"));
"borrowerCycle", "isBulkImport","isRestructuredLoan"));

private final FromJsonHelper fromApiJsonHelper;
private final CalculateLoanScheduleQueryFromApiJsonHelper apiJsonHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ private Loan assembleApplication(final JsonElement element, final Long clientId,

PrequalificationGroup prequalificationGroup = null;
final Boolean isBulkImport = this.fromApiJsonHelper.extractBooleanNamed("isBulkImport", element);
if (isBulkImport == null || !isBulkImport) {
final Boolean isRestructuredLoan = this.fromApiJsonHelper.extractBooleanNamed("isRestructuredLoan", element);
if ((isBulkImport == null || !isBulkImport) && (isRestructuredLoan == null || !isRestructuredLoan)) {
final Long prequalificationId = this.fromApiJsonHelper.extractLongNamed("prequalificationId", element);
prequalificationGroup = this.prequalificationGroupRepositoryWrapper.findOneWithNotFoundDetection(prequalificationId);
if (!PrequalificationStatus.BURO_CHECKED.getValue().equals(prequalificationGroup.getStatus())) {
Expand Down

0 comments on commit cab004b

Please sign in to comment.