Skip to content

Commit

Permalink
Bug/FBR-488: Approve/Reject Loan Request Fixes (#327)
Browse files Browse the repository at this point in the history
Co-authored-by: Julius Peter Oketayot <[email protected]>
  • Loading branch information
fiter-julius-oketayot and Julius Peter Oketayot authored Dec 8, 2023
1 parent 9f72c02 commit db83041
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.concurrent.atomic.AtomicReference;
import javax.transaction.Transactional;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService;
import org.apache.fineract.infrastructure.core.api.JsonCommand;
Expand Down Expand Up @@ -106,7 +107,6 @@
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;

@Service
@Slf4j
Expand Down Expand Up @@ -855,7 +855,11 @@ public CommandProcessingResult processAnalysisRequest(Long entityId, JsonCommand
}
}

if (prequalificationGroup.isPrequalificationTypeIndividual() && action.equals("approveanalysis")) {
final Long productId = prequalificationGroup.getLoanProduct().getId();
final LoanProduct loanProduct = this.loanProductRepository.findById(productId)
.orElseThrow(() -> new LoanProductNotFoundException(productId));
final Boolean requireCommitteeApproval = ObjectUtils.defaultIfNull(loanProduct.getRequireCommitteeApproval(), Boolean.FALSE);
if (prequalificationGroup.isPrequalificationTypeIndividual() && action.equals("approveanalysis") && requireCommitteeApproval) {
PrequalificationStatusRange statusRange = resolveIndividualStatusRange(prequalificationGroup, action);
prequalificationStatus = PrequalificationStatus.fromInt(statusRange.getStatus());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoField;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.persistence.PersistenceException;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.fineract.accounting.journalentry.data.LumaBitacoraTransactionTypeEnum;
Expand Down Expand Up @@ -164,19 +176,6 @@
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;

import javax.persistence.PersistenceException;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoField;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

@Service
public class LoanApplicationWritePlatformServiceJpaRepositoryImpl implements LoanApplicationWritePlatformService {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1698,4 +1698,12 @@ public BigDecimal getPaymentToleranceLimit() {
public void setPaymentToleranceLimit(BigDecimal paymentToleranceLimit) {
this.paymentToleranceLimit = paymentToleranceLimit;
}

public Boolean getRequireCommitteeApproval() {
return requireCommitteeApproval;
}

public void setRequireCommitteeApproval(Boolean requireCommitteeApproval) {
this.requireCommitteeApproval = requireCommitteeApproval;
}
}

0 comments on commit db83041

Please sign in to comment.