From b7aba343b638d1bc39cbc9acd058a3bbbc71c5ac Mon Sep 17 00:00:00 2001 From: Muhimbura Brian Mart Date: Wed, 27 Sep 2023 12:46:41 +0300 Subject: [PATCH] send to analysis unit --- .../api/PrequalificationChecklistApiResource.java | 9 +++------ .../domain/PreQualificationsEnumerations.java | 3 ++- .../domain/PrequalificationStatus.java | 7 ++++--- .../PrequalificationWritePlatformServiceImpl.java | 5 ++--- .../portfolio/group/data/GroupGeneralData.java | 14 +++++++------- .../group/service/AllGroupTypesDataMapper.java | 6 +++--- 6 files changed, 21 insertions(+), 23 deletions(-) diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/PrequalificationChecklistApiResource.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/PrequalificationChecklistApiResource.java index 69be8d6d5bf..d1e7df750bc 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/PrequalificationChecklistApiResource.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/api/PrequalificationChecklistApiResource.java @@ -111,16 +111,13 @@ public String validateHardPolicyChecklist(@PathParam("prequalificationId") final if (is(commandParam, "validateprequalification")) { final CommandWrapper validateCommandRequest = builder.validatePrequalificationHardPolicies(prequalificationId).build(); result = this.commandsSourceWritePlatformService.logCommandSource(validateCommandRequest); - } - else if (is(commandParam, "bureauValidation")) { + } else if (is(commandParam, "bureauValidation")) { final CommandWrapper validateCommandRequest = builder.bureauValidationProcessing(prequalificationId).build(); result = this.commandsSourceWritePlatformService.logCommandSource(validateCommandRequest); - } - else if (is(commandParam, "requestUpdates")) { + } else if (is(commandParam, "requestUpdates")) { final CommandWrapper validateCommandRequest = builder.requestUpdatePrequalification(prequalificationId).build(); result = this.commandsSourceWritePlatformService.logCommandSource(validateCommandRequest); - } - else if (is(commandParam, "sendToAnalysis")) { + } else if (is(commandParam, "sendToAnalysis")) { final CommandWrapper validateCommandRequest = builder.sendGroupForAnalysis(prequalificationId).build(); result = this.commandsSourceWritePlatformService.logCommandSource(validateCommandRequest); } else { diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/domain/PreQualificationsEnumerations.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/domain/PreQualificationsEnumerations.java index c5a893b47f3..1456cb6f52b 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/domain/PreQualificationsEnumerations.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/domain/PreQualificationsEnumerations.java @@ -66,7 +66,8 @@ public static EnumOptionData status(final PrequalificationStatus status) { PrequalificationStatus.PREQUALIFICATION_UPDATE_REQUESTED.getCode(), "PREQUALIFICATION_UPDATE_REQUESTED"); case AGENCY_LEAD_PENDING_APPROVAL_WITH_EXCEPTIONS -> new EnumOptionData( PrequalificationStatus.AGENCY_LEAD_PENDING_APPROVAL_WITH_EXCEPTIONS.getValue().longValue(), - PrequalificationStatus.AGENCY_LEAD_PENDING_APPROVAL_WITH_EXCEPTIONS.getCode(), "AGENCY_LEAD_PENDING_APPROVAL_WITH_EXCEPTIONS"); + PrequalificationStatus.AGENCY_LEAD_PENDING_APPROVAL_WITH_EXCEPTIONS.getCode(), + "AGENCY_LEAD_PENDING_APPROVAL_WITH_EXCEPTIONS"); default -> new EnumOptionData(PrequalificationStatus.INVALID.getValue().longValue(), PrequalificationStatus.INVALID.getCode(), "INVALID"); }; diff --git a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/domain/PrequalificationStatus.java b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/domain/PrequalificationStatus.java index 0bb26d059cf..179c10eab22 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/domain/PrequalificationStatus.java +++ b/fineract-provider/src/main/java/org/apache/fineract/organisation/prequalification/domain/PrequalificationStatus.java @@ -34,8 +34,9 @@ public enum PrequalificationStatus { 800, "prequalification.status.expired"), COMPLETED(900, "prequalification.status.completed"), CONSENT_ADDED(901, "prequalification.status.concent.added"), AGENCY_LEAD_PENDING_APPROVAL(902, "prequalification.status.pending.approval"), PREQUALIFICATION_UPDATE_REQUESTED(903, - "prequalification.status.update.requested"),AGENCY_LEAD_PENDING_APPROVAL_WITH_EXCEPTIONS(904, - "prequalification.status.pending.approval.exceptions"), INVALID(0, "prequalification.status.invalid"); + "prequalification.status.update.requested"), AGENCY_LEAD_PENDING_APPROVAL_WITH_EXCEPTIONS(904, + "prequalification.status.pending.approval.exceptions"), INVALID(0, + "prequalification.status.invalid"); private final Integer value; private final String code; @@ -124,7 +125,7 @@ public static PrequalificationStatus fromString(String status) { clientStatus = PrequalificationStatus.AGENCY_LEAD_PENDING_APPROVAL; } else if (status.equalsIgnoreCase(PrequalificationStatus.PREQUALIFICATION_UPDATE_REQUESTED.toString())) { clientStatus = PrequalificationStatus.PREQUALIFICATION_UPDATE_REQUESTED; - }else if (status.equalsIgnoreCase(PrequalificationStatus.AGENCY_LEAD_PENDING_APPROVAL_WITH_EXCEPTIONS.toString())) { + } else if (status.equalsIgnoreCase(PrequalificationStatus.AGENCY_LEAD_PENDING_APPROVAL_WITH_EXCEPTIONS.toString())) { clientStatus = PrequalificationStatus.AGENCY_LEAD_PENDING_APPROVAL_WITH_EXCEPTIONS; } 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 136851b72e3..beb472f171f 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 @@ -31,7 +31,6 @@ import java.util.Map; import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; - import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.fineract.infrastructure.codes.service.CodeValueReadPlatformService; @@ -591,8 +590,8 @@ public CommandProcessingResult sendForAnalysis(Long entityId, JsonCommand comman final PrequalificationGroup prequalificationGroup = this.prequalificationGroupRepositoryWrapper .findOneWithNotFoundDetection(entityId); - PrequalificationChecklistData prequalificationChecklistData = this.prequalificationChecklistReadPlatformService. - retrieveHardPolicyValidationResults(entityId); + PrequalificationChecklistData prequalificationChecklistData = this.prequalificationChecklistReadPlatformService + .retrieveHardPolicyValidationResults(entityId); GenericValidationResultSet prequalification = prequalificationChecklistData.getPrequalification(); List exceptionsList = List.of("ORANGE", "RED", "YELLOW"); diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java index 2d94ff3a9af..7fa69e7f429 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/data/GroupGeneralData.java @@ -262,7 +262,7 @@ public static GroupGeneralData lookup(final Long groupId, final String accountNo final Collection closureReasons = null; return new GroupGeneralData(groupId, accountNo, groupName, null, null, null, null, null, null, null, null, null, null, null, clientMembers, null, null, null, null, null, groupRoles, null, null, null, null, closureReasons, null, null, null, null, - null, null, null,null); + null, null, null, null); } public static GroupGeneralData template(final Long officeId, final Long centerId, final String accountNo, final String centerName, @@ -279,7 +279,7 @@ public static GroupGeneralData template(final Long officeId, final Long centerId return new GroupGeneralData(null, accountNo, null, null, null, null, officeId, null, centerId, centerName, staffId, staffName, null, null, clientMembers, null, centerOptions, officeOptions, staffOptions, clientOptions, groupRoles, availableRoles, null, null, null, closureReasons, null, parentOfficesOptions, responsibleUserOptions, portfolioCenterOptions, - centerGroupLocations, null, null,null); + centerGroupLocations, null, null, null); } public static GroupGeneralData withTemplate(final GroupGeneralData templatedGrouping, final GroupGeneralData grouping) { @@ -363,7 +363,7 @@ public static GroupGeneralData instance(final Long id, final String accountNo, f return new GroupGeneralData(id, accountNo, name, externalId, status, activationDate, officeId, officeName, centerId, centerName, staffId, staffName, hierarchy, groupLevel, clientMembers, activeClientMembers, centerOptions, officeOptions, staffOptions, clientOptions, groupRoles, availableRoles, role, calendarsData, collectionMeetingCalendar, closureReasons, timeline, - parentOfficesOptions, responsibleUserOptions, portfolioCenterOptions, centerGroupLocations, null, null,null); + parentOfficesOptions, responsibleUserOptions, portfolioCenterOptions, centerGroupLocations, null, null, null); } private GroupGeneralData(final Long id, final String accountNo, final String name, final String externalId, final EnumOptionData status, @@ -462,8 +462,8 @@ public static GroupGeneralData updateSelectedRole(final GroupGeneralData groupin grouping.staffName, grouping.hierarchy, grouping.groupLevel, grouping.clientMembers, grouping.activeClientMembers, grouping.centerOptions, grouping.officeOptions, grouping.staffOptions, grouping.clientOptions, grouping.groupRoles, grouping.availableRoles, selectedRole, grouping.calendarsData, grouping.collectionMeetingCalendar, grouping.closureReasons, - null, null, null, null, null, - grouping.prequalificationNumber, grouping.prequalificationId, grouping.prequalificationStatus); + null, null, null, null, null, grouping.prequalificationNumber, grouping.prequalificationId, + grouping.prequalificationStatus); } public static GroupGeneralData withClosureReasons(final Collection closureReasons) { @@ -500,7 +500,7 @@ public static GroupGeneralData withClosureReasons(final Collection clientMembers() { @@ -643,6 +643,6 @@ public void setPrequalificationId(Long prequalificationId) { } public void setPrequalificationStatus(EnumOptionData prequalificationStatus) { - this.prequalificationStatus= prequalificationStatus; + this.prequalificationStatus = prequalificationStatus; } } diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/AllGroupTypesDataMapper.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/AllGroupTypesDataMapper.java index 22c64725a02..fedb0a9f8fd 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/AllGroupTypesDataMapper.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/group/service/AllGroupTypesDataMapper.java @@ -81,8 +81,8 @@ public AllGroupTypesDataMapper() { sqlBuilder.append("g.meeting_day as meetingDay, cvMeetingDay.code_value as meetingDayValue, "); sqlBuilder.append("cvMeetingDay.order_position as meetingDayOrderPosition, g.meeting_start_time as meetingStartTime, "); sqlBuilder.append("g.meeting_end_time as meetingEndTime, g.reference_point as referencePoint, "); - sqlBuilder.append("prequalGroup.prequalification_number as prequalificationNumber, " + - "prequalGroup.status as prequalificationStatus, g.prequalification_id as prequalificationId "); + sqlBuilder.append("prequalGroup.prequalification_number as prequalificationNumber, " + + "prequalGroup.status as prequalificationStatus, g.prequalification_id as prequalificationId "); sqlBuilder.append("from m_group g "); sqlBuilder.append("join m_office o on o.id = g.office_id "); @@ -183,7 +183,7 @@ public GroupGeneralData mapRow(final ResultSet rs, @SuppressWarnings("unused") f final Long prequalificationId = rs.getLong("prequalificationId"); final Long prequalificationStatusId = rs.getLong("prequalificationStatus"); EnumOptionData prequalificationStatus = null; - if (prequalificationStatusId!=null){ + if (prequalificationStatusId != null) { prequalificationStatus = PreQualificationsEnumerations.status(prequalificationStatusId.intValue()); }