Skip to content

Commit

Permalink
send to analysis unit
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianMuhimbura committed Sep 27, 2023
1 parent 10a5937 commit b7aba34
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<String> exceptionsList = List.of("ORANGE", "RED", "YELLOW");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public static GroupGeneralData lookup(final Long groupId, final String accountNo
final Collection<CodeValueData> 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,
Expand All @@ -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) {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<CodeValueData> closureReasons) {
Expand Down Expand Up @@ -500,7 +500,7 @@ public static GroupGeneralData withClosureReasons(final Collection<CodeValueData
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, null,
parentOfficesOptions, responsibleUserOptions, portfolioCenterOptions, centerGroupLocations, null, null,null);
parentOfficesOptions, responsibleUserOptions, portfolioCenterOptions, centerGroupLocations, null, null, null);
}

public Collection<ClientData> clientMembers() {
Expand Down Expand Up @@ -643,6 +643,6 @@ public void setPrequalificationId(Long prequalificationId) {
}

public void setPrequalificationStatus(EnumOptionData prequalificationStatus) {
this.prequalificationStatus= prequalificationStatus;
this.prequalificationStatus = prequalificationStatus;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 ");
Expand Down Expand Up @@ -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());
}

Expand Down

0 comments on commit b7aba34

Please sign in to comment.