Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class GrievanceCallRequest {
Long beneficiaryRegID;
Integer callTypeID;
Long benCallID;
Integer providerServiceMapId;
Integer providerServiceMapID;
String createdBy;

}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Set<Object[]> getOutboundCallTypes(@Param("providerServiceMapID") Integer provid
@Query("select callType from CallType callType where deleted = false and callTypeID = :callTypeID")
CallType getCallTypeDetails(@Param("callTypeID") Integer callTypeID);

@Query("select callType, callGroupType from CallType "
@Query("select callGroupType, callType from CallType "
+ "where callTypeID = :callTypeID")
Set<Object[]> getCallDetails(@Param("callTypeID") Integer callTypeID);
}
Original file line number Diff line number Diff line change
Expand Up @@ -492,13 +492,12 @@ public String completeGrievanceCall(String request) throws Exception {
Boolean isCompleted = grievanceCallRequest.getIsCompleted();
Long beneficiaryRegID = grievanceCallRequest.getBeneficiaryRegID();
Integer callTypeID = grievanceCallRequest.getCallTypeID();
Integer providerServiceMapId = grievanceCallRequest.getProviderServiceMapId();
Integer providerServiceMapID = grievanceCallRequest.getProviderServiceMapID();

CallType callTypeObj = new CallType();
String response = "failure";
int updateCount = 0;
int updateCallCounter = 0;
int callCounter = 0;
try {

GrievanceDetails grievanceCallStatus = new GrievanceDetails();
Expand Down Expand Up @@ -534,34 +533,41 @@ public String completeGrievanceCall(String request) throws Exception {
boolean isRetryNeeded = grievanceCallStatus.getRetryNeeded();
if (callGroupType.equals("Valid")) {
// Conditions when no reattempt is needed
if (callType.equals("Valid") || callType.equals("Wrong Number") || callType.equals("Test Call")) {
if (callType.equals("Valid") || callType.equals("Test Call")) {
isRetryNeeded = false;
} else if (callType.equals("Disconnected Call") || callType.equals("Serviced Call") ||
callType.equals("Silent Call") || callType.equals("Call Back")) {
// Reattempt is needed for these call subtypes
isRetryNeeded = true;
}
}
if (callGroupType.equals("Invalid") && callType.equals("Wrong Number")) {
isRetryNeeded = false;
//isCompleted = true;
grievanceDataRepo.updateCompletedStatusInCall(isCompleted, isRetryNeeded, complaintID, userID, beneficiaryRegID, providerServiceMapID);
}

// Check if max attempts (3) are reached
if (isRetryNeeded == true && callCounter < grievanceAllocationRetryConfiguration) {
if (isRetryNeeded == true && grievanceCallStatus.getCallCounter() < grievanceAllocationRetryConfiguration) {
// Increment the call counter for reattempt
grievanceCallStatus.setCallCounter(grievanceCallStatus.getCallCounter() + 1);
// Update the retryNeeded flag
grievanceCallStatus.setRetryNeeded(true);
updateCallCounter = grievanceDataRepo.updateCallCounter(callCounter, grievanceCallStatus.getRetryNeeded(), grievanceCallRequest.getComplaintID(),
grievanceCallRequest.getBeneficiaryRegID(), grievanceCallRequest.getProviderServiceMapId(),
isRetryNeeded = true;
//isCompleted = false;
updateCallCounter = grievanceDataRepo.updateCallCounter(grievanceCallStatus.getCallCounter(), isRetryNeeded, grievanceCallRequest.getComplaintID(),
grievanceCallRequest.getBeneficiaryRegID(), grievanceCallRequest.getProviderServiceMapID(),
grievanceCallRequest.getUserID());
// response = "Successfully closing call."; // Return success when reattempt logic is applied successfully. The grievance call needs to be retried, and a reattempt is performed.
// Return success when reattempt logic is applied successfully. The grievance call needs to be retried, and a reattempt is performed.
if (updateCallCounter > 0)
response = "Successfully closing call";
else {
response = "failure";
response = "failure in closing call";
}
} else if (callCounter == grievanceAllocationRetryConfiguration) {
} else if (grievanceCallStatus.getCallCounter()== grievanceAllocationRetryConfiguration) {
// Max attempts reached, no further reattempt
grievanceCallStatus.setRetryNeeded(false);
updateCount = grievanceDataRepo.updateCompletedStatusInCall(isCompleted, grievanceCallStatus.getRetryNeeded(), complaintID, userID, beneficiaryRegID, providerServiceMapId);
isRetryNeeded = false;
//isCompleted = true;
updateCount = grievanceDataRepo.updateCompletedStatusInCall(isCompleted, isRetryNeeded, complaintID, userID, beneficiaryRegID, providerServiceMapID);
response = "max_attempts_reached"; // Indicate that max attempts are reached


Expand Down
Loading