From 855825ec40afc95df4f02b67218946b5cd98acc5 Mon Sep 17 00:00:00 2001 From: Muhimbura Brian Mart Date: Tue, 28 Nov 2023 22:27:20 +0300 Subject: [PATCH] fix prequalification of existing group --- .../api/GroupPrequalificationApiResource.java | 8 ++++++++ .../service/PrequalificationWritePlatformServiceImpl.java | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/GroupPrequalificationApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/GroupPrequalificationApiResource.java index 82e5148ff9e..e2ab1fe3fb9 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/GroupPrequalificationApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/GroupPrequalificationApiResource.java @@ -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 loanProducts = this.loanProductReadPlatformService.retrieveAllLoanProducts(); Integer prequalificationType = null; if (StringUtils.isNotBlank(groupingType)) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationWritePlatformServiceImpl.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationWritePlatformServiceImpl.java index f7540bbd058..4240f201604 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationWritePlatformServiceImpl.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/service/PrequalificationWritePlatformServiceImpl.java @@ -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);