Skip to content

Commit

Permalink
Merge pull request #303 from fiterlatam/fix/FBR-467
Browse files Browse the repository at this point in the history
fix prequalification of existing group
  • Loading branch information
BrianMuhimbura authored Nov 28, 2023
2 parents 880005d + 855825e commit 2cbb32f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,22 @@ public String newClientIdentifierDetails(@Context final UriInfo uriInfo) {

String type = queryParameters.getFirst("type");
String groupingType = queryParameters.getFirst("groupingType");
String groupId = queryParameters.getFirst("groupId");
Long agencyId = null;
Long centerId = null;
if (!StringUtils.isBlank(groupId)){
GroupPrequalificationData prequalificationGroup = this.prequalificationReadPlatformService.retrieveOne(Long.valueOf(groupId));
agencyId = prequalificationGroup.getAgencyId();
centerId = prequalificationGroup.getCenterId();
}

if (queryParameters.getFirst("agencyId") != null) {
agencyId = NumberUtils.toLong(queryParameters.getFirst("agencyId"), Long.MAX_VALUE);
}
if (queryParameters.getFirst("centerId") != null) {
centerId = NumberUtils.toLong(queryParameters.getFirst("centerId"), Long.MAX_VALUE);
}

Collection<LoanProductData> loanProducts = this.loanProductReadPlatformService.retrieveAllLoanProducts();
Integer prequalificationType = null;
if (StringUtils.isNotBlank(groupingType)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ public CommandProcessingResult processPrequalification(JsonCommand command) {
if (previousPrequalificationId != null) {
parentGroup = this.prequalificationGroupRepositoryWrapper.findOneWithNotFoundDetection(previousPrequalificationId);
if (!parentGroup.getStatus().equals(PrequalificationStatus.COMPLETED.getValue())
&& !parentGroup.getStatus().equals(PrequalificationStatus.REJECTED.getValue())) {
&& !parentGroup.getStatus().equals(PrequalificationStatus.REJECTED.getValue())
&& !parentGroup.getStatus().equals(PrequalificationStatus.TIME_EXPIRED.getValue())) {
throw new PrequalificationStatusNotCompletedException(PrequalificationStatus.fromInt(parentGroup.getStatus()).toString());
}
existingGroupParentGroup = this.groupRepositoryWrapper.findOneWithPrequalificationIdNotFoundDetection(parentGroup);
Expand Down

0 comments on commit 2cbb32f

Please sign in to comment.