Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
a7a9518
adding changes related to encryption and decryption
Oct 16, 2024
e1b5318
making final field static
Oct 16, 2024
eddabe3
making enclosing method static
Oct 16, 2024
6e626bb
adding beneficiaryConsent param to createFeedback API
Dec 10, 2024
6cf8550
Merge pull request #6 from PSMRI/develop
srishtigrp78 Dec 10, 2024
2303d60
Update src/main/java/com/iemr/common/data/feedback/FeedbackDetails.java
srishtigrp78 Dec 10, 2024
68d0483
Merge pull request #7 from PSMRI/develop
srishtigrp78 Dec 10, 2024
b7718c0
adding beneficiary consent param feedbacklist response
Dec 11, 2024
f9feef6
adding space
Dec 11, 2024
019d315
Merge pull request #8 from PSMRI/develop
srishtigrp78 Dec 20, 2024
507f830
Merge pull request #9 from PSMRI/develop
srishtigrp78 Jan 8, 2025
21be52e
adding code for schedule for grievance data sync
Jan 9, 2025
0a90728
adding code rabbit code suggestions
Jan 16, 2025
ea9ff9e
adding code rabbit suggestions
Jan 16, 2025
8825473
code rabbit suggested changes to Model classes
Jan 16, 2025
2d639c4
adding sonar quality changes
Jan 16, 2025
b0e039b
adding sonar quality code suggestions
Jan 16, 2025
9831500
adding sonar quality check suggestions
Jan 17, 2025
5cb6886
adding code rabbit suggestions
Jan 17, 2025
9e8e1f2
adding constant instead of duplicate literals
Jan 17, 2025
67b2f86
Merge pull request #10 from PSMRI/develop
srishtigrp78 Jan 19, 2025
7b3b990
adding cod changs to fetch unallocated grievance count
Jan 19, 2025
d834aa9
adding changes suggested by sonar quality check
Jan 20, 2025
734551a
adding code rabbit suggested changes
Jan 20, 2025
47ceb56
fixing config file
Jan 21, 2025
f26b8ff
fixing space
Jan 21, 2025
d3534d9
fixing space issue
Jan 21, 2025
6b58965
adding package for PrimaryDBConfig
Jan 22, 2025
8d97517
Merge pull request #11 from PSMRI/develop
srishtigrp78 Jan 22, 2025
b5798d2
adding code changes for allocate API for allocating grievance to agents
Jan 22, 2025
abe5bd3
removing space
Jan 22, 2025
3c8fbb9
Merge pull request #12 from PSMRI/develop
srishtigrp78 Jan 23, 2025
ef1021e
adding language related changes
Jan 23, 2025
3451ad5
add language related changes
Jan 23, 2025
fa02a49
adding name convention related changes
Jan 24, 2025
822ec19
adding code rabbit changes
Jan 24, 2025
c8e85ab
adding sonar quality check suggested changes
Jan 24, 2025
6557199
removing unused imports
Jan 24, 2025
9c8afce
Merge branch 'PSMRI:develop' into feature/version/upgrade
srishtigrp78 Jan 27, 2025
4c4cce0
Merge pull request #13 from PSMRI/develop
srishtigrp78 Feb 11, 2025
17a159f
Merge pull request #14 from PSMRI/develop
srishtigrp78 Feb 12, 2025
c20c9ab
Merge pull request #16 from PSMRI/develop
srishtigrp78 Feb 19, 2025
b2d99be
adding properties related to Grievance in properties file
Feb 19, 2025
76bf328
placing the placeholder for jwt secret key
Feb 19, 2025
eeaf00d
Update package.yml
srishtigrp78 Feb 19, 2025
b36477c
removing grievanc related properties from application properties file
Feb 20, 2025
48ac080
adding space
Feb 20, 2025
3fe65c4
removing extra space
Feb 20, 2025
b45a6da
Merge branch 'feature/version/upgrade' of https://github.com/srishtig…
Feb 20, 2025
55c469a
adding code for API that fetches grievance outbound worklist
Feb 20, 2025
e6acf34
Merge pull request #17 from PSMRI/develop
srishtigrp78 Feb 20, 2025
584f97e
adding code rabbit suggested changes
Feb 21, 2025
4a4de76
another addition of code rabbit suggested changes
Feb 21, 2025
650e573
fixing row no
Feb 21, 2025
45b088e
adding code for API to save complaint resolution and remarks in the db
Feb 21, 2025
f9ef91b
Merge branch 'feature/version/upgrade' into grievance
srishtigrp78 Feb 21, 2025
0e77f26
Merge pull request #18 from PSMRI/grievance
srishtigrp78 Feb 21, 2025
aaf8db8
adding code rabbit suggested changes
Feb 24, 2025
713867e
removing lastModDate as it will update automatically in db
Feb 24, 2025
42f00ce
changing variable name of assignedUserID to userID
Feb 24, 2025
f2478cd
fixing remarks
Feb 25, 2025
c1cabf6
removing full stop
Feb 25, 2025
d78ac62
Merge pull request #163 from srishtigrp78/feature/version/upgrade
srishtigrp78 Feb 25, 2025
b042b3c
Merge pull request #19 from PSMRI/develop
srishtigrp78 Feb 25, 2025
8b9059a
adding code for API to close call and make reattempts if needed
Feb 27, 2025
2f724d3
adding code changes suggested by code rabbit
Feb 27, 2025
9b83271
adding code rabbit suggested changes
Feb 27, 2025
d7a3c6b
adding code rabbit fixes
Feb 27, 2025
fa2f433
adding code rabbit fixes
Feb 27, 2025
ae716f9
Delete src/main/java/com/iemr/common/data/grievance/.gitignore
srishtigrp78 Feb 27, 2025
84e0139
AMM-1148 | Close call API including reattempt logic based on calltype…
srishtigrp78 Feb 27, 2025
8055769
removing unused literal in repo class
Feb 27, 2025
060b808
Merge branch 'feature/version/upgrade' into develop
srishtigrp78 Feb 27, 2025
9f0fbb0
Beneficiary consent
SauravBizbRolly Mar 10, 2025
01abcbd
Beneficiary consent
SauravBizbRolly Apr 10, 2025
0f0113c
Beneficiary consent
SauravBizbRolly Apr 10, 2025
a5b595e
Beneficiary consent
SauravBizbRolly Apr 10, 2025
a363c33
Beneficiary consent
SauravBizbRolly Apr 10, 2025
ea47470
Beneficiary consent
SauravBizbRolly Jun 13, 2025
dbe771c
Merge branch 'enhancement' into beneficiaries_consent
SauravBizbRolly Jun 13, 2025
23cbcca
Merge branch 'enhancement' into beneficiaries_consent
SauravBizbRolly Jun 19, 2025
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
3 changes: 1 addition & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-cache</artifactId>
Expand Down Expand Up @@ -503,7 +502,7 @@
</dependencies>

<build>
<finalName>commonapi-v3.0.0</finalName>
<finalName>commonapi-v1.0</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
package com.iemr.common.controller.beneficiaryConsent;

import com.iemr.common.data.beneficiaryConsent.BeneficiaryConsentRequest;
import com.iemr.common.data.otp.OTPRequestParsor;
import com.iemr.common.service.beneficiaryOTPHandler.BeneficiaryOTPHandler;
import com.iemr.common.service.otp.OTPHandler;
import com.iemr.common.utils.mapper.InputMapper;
import com.iemr.common.utils.response.OutputResponse;
import io.lettuce.core.dynamic.annotation.Param;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.ws.rs.core.MediaType;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

public class BeneficiaryConsentController {
final Logger logger = LoggerFactory.getLogger(this.getClass().getName());

@Autowired
private BeneficiaryOTPHandler beneficiaryOTPHandler;

@Operation(summary = "Send Consent")
@RequestMapping(value = "/sendConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String sendConsent(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) {
logger.info(requestOBJ.toString());

Check notice

Code scanning / SonarCloud

Logging should not be vulnerable to injection attacks Low

Change this code to not log user-controlled data. See more on SonarQube Cloud

OutputResponse response = new OutputResponse();

try {
BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class);

String success = beneficiaryOTPHandler.sendOTP(obj); // method name unchanged if internal logic still uses 'OTP'
logger.info(success.toString());
if (success.contains("otp"))
response.setResponse(success);
else
response.setError(500, "failure");

} catch (Exception e) {
logger.error("error in sending Consent : " + e);
response.setError(500, "error : " + e);
}
return response.toString();
}

@Operation(summary = "Validate Consent")
@RequestMapping(value = "/validateConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String validateConsent(@Param(value = "{\"mobNo\":\"String\",\"otp\":\"Integer\"}") @RequestBody String requestOBJ) {

OutputResponse response = new OutputResponse();

try {
OTPRequestParsor obj = InputMapper.gson().fromJson(requestOBJ, OTPRequestParsor.class);

JSONObject responseOBJ = beneficiaryOTPHandler.validateOTP(obj);
if (responseOBJ != null)
response.setResponse(responseOBJ.toString());
else
response.setError(500, "failure");

} catch (Exception e) {
logger.error("error in validating Consent : " + e);
response.setError(500, "error : " + e);
}
return response.toString();
}

@Operation(summary = "Resend Consent")
@RequestMapping(value = "/resendConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String resendConsent(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) {
logger.info(requestOBJ.toString());

Check notice

Code scanning / SonarCloud

Logging should not be vulnerable to injection attacks Low

Change this code to not log user-controlled data. See more on SonarQube Cloud

OutputResponse response = new OutputResponse();

try {
OTPRequestParsor obj = InputMapper.gson().fromJson(requestOBJ, OTPRequestParsor.class);

String success = beneficiaryOTPHandler.resendOTP(obj);
logger.info(success.toString());

if (success.contains("otp"))
response.setResponse(success);
else
response.setError(500, "failure");

} catch (Exception e) {
logger.error("error in re-sending Consent : " + e);
response.setError(500, "error : " + e);
}
return response.toString();
}


}


Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public String completeGrievanceCall(
}



@Operation(summary = "Get Grievance Details with Remarks")
@PostMapping(value = "/getCompleteGrievanceDetails", consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String getGrievanceDetailsWithRemarks(@RequestBody String request) {
Expand Down
9 changes: 7 additions & 2 deletions src/main/java/com/iemr/common/controller/otp/OTPGateway.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,16 @@
@Operation(summary = "Send OTP")
@RequestMapping(value = "/sendOTP", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String sendOTP(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) {
logger.info(requestOBJ.toString());

Check notice

Code scanning / SonarCloud

Logging should not be vulnerable to injection attacks Low

Change this code to not log user-controlled data. See more on SonarQube Cloud

OutputResponse response = new OutputResponse();

try {
OTPRequestParsor obj = InputMapper.gson().fromJson(requestOBJ, OTPRequestParsor.class);

String success = otpHandler.sendOTP(obj);
if (success.equalsIgnoreCase("success"))
logger.info(success.toString());
if (success.contains("otp"))
response.setResponse(success);
else
response.setError(5000, "failure");
Expand Down Expand Up @@ -102,14 +104,17 @@
@Operation(summary = "Resend OTP")
@RequestMapping(value = "/resendOTP", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, headers = "Authorization")
public String resendOTP(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) {
logger.info(requestOBJ.toString());

Check notice

Code scanning / SonarCloud

Logging should not be vulnerable to injection attacks Low

Change this code to not log user-controlled data. See more on SonarQube Cloud

OutputResponse response = new OutputResponse();

try {
OTPRequestParsor obj = InputMapper.gson().fromJson(requestOBJ, OTPRequestParsor.class);

String success = otpHandler.resendOTP(obj);
if (success.equalsIgnoreCase("success"))
logger.info(success.toString());

if (success.contains("otp"))
response.setResponse(success);
else
response.setError(5000, "failure");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.iemr.common.data.beneficiaryConsent;

import lombok.Data;

@Data
public class BeneficiaryConsentRequest {
private String mobNo;
private int otp;
private String userName;
private String designation;

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class GrievanceCallRequest {
Long beneficiaryRegID;
Integer callTypeID;
Long benCallID;
Integer providerServiceMapId;

Integer providerServiceMapID;
String createdBy;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ public GrievanceDetails(Long gwid, Long grievanceId, Long beneficiaryRegID, Long
this.severety = severety;
this.level = level;
this.state = state;
this.agentid = agentID;
this.userID = userid;
this.isAllocated = isAllocated;
this.retryNeeded = retryNeeded;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public class CommonIdentityDTO {
private Integer educationId;
private String education;
private Boolean emergencyRegistration = false;
private Boolean isConsent;
private Integer healthCareWorkerId;
private String healthCareWorker;
private String fatherName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ public class BeneficiaryModel implements Comparable<BeneficiaryModel> {
// private List<OutboundCallRequestModel> outboundCallRequests;
// private List<BeneficiaryCallModel> beneficiaryCalls;
// private List<FeedbackDetailsModel> feedbacks;
@Expose
private Boolean isConsent=false;


@Expose
private String beneficiaryID;
@Expose
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,28 @@ List<GrievanceDetails> findGrievancesByUserAndLanguage(@Param("userID") Integer

@Modifying
@Transactional

@Query("UPDATE GrievanceDetails g SET g.userID = NULL WHERE g.grievanceId = :grievanceId AND g.userID = :userID")
int unassignGrievance(@Param("grievanceId") Long grievanceId, @Param("userID") Integer userID);

@Query("UPDATE GrievanceDetails g SET g.userID = :userID WHERE g.gwid = :gwid")
int unassignGrievance(@Param("userID") Integer userID, @Param("gwid") Long gwid);


@Modifying
@Transactional
@Query("UPDATE GrievanceDetails g SET g.isAllocated = :isAllocated WHERE g.gwid = :gwid")
int updateGrievanceAllocationStatus(@Param("gwid") Long gwid,
@Param("isAllocated") Boolean isAllocated);


@Query("Select grievance.preferredLanguage, count(grievance) from GrievanceDetails grievance where grievance.isAllocated=false group by grievance.preferredLanguage")
public Set<Object[]> fetchUnallocatedGrievanceCount();

@Modifying
@Query("UPDATE GrievanceDetails g SET g.complaintResolution = :complaintResolution, g.remarks = :remarks, g.modifiedBy = :modifiedBy "
+ "WHERE g.complaintID = :complaintID AND g.beneficiaryRegID = :beneficiaryRegID AND g.providerServiceMapID = :providerServiceMapID"

@Query("Select grievance.preferredLanguage, count(grievance) from GrievanceDetails grievance where grievance.isAllocated=false "
+ "AND grievance.createdDate BETWEEN :filterStartDate AND :filterEndDate "
+ "group by grievance.preferredLanguage")
Expand All @@ -91,24 +104,31 @@ public Set<Object[]> fetchUnallocatedGrievanceCount(
int updateComplaintResolution(@Param("complaintResolution") String complaintResolution,
@Param("remarks") String remarks,
@Param("modifiedBy") String modifiedBy,

@Param("benCallID") Long benCallID,
@Param("complaintID") String complaintID,
@Param("beneficiaryRegID") Long beneficiaryRegID,
@Param("userID") Integer userID);

@Modifying
@Query("UPDATE GrievanceDetails g SET g.complaintResolution = :complaintResolution, g.modifiedBy = :modifiedBy "
+ "WHERE g.complaintID = :complaintID AND g.beneficiaryRegID = :beneficiaryRegID AND g.providerServiceMapID = :providerServiceMapID"

@Query("UPDATE GrievanceDetails g SET g.complaintResolution = :complaintResolution, g.modifiedBy = :modifiedBy, "
+ "g.benCallID = :benCallID "
+ "WHERE g.complaintID = :complaintID AND g.beneficiaryRegID = :beneficiaryRegID "
+ " AND g.userID = :userID")
@Transactional
int updateComplaintResolution(@Param("complaintResolution") String complaintResolution,
@Param("modifiedBy") String modifiedBy,

@Param("benCallID") Long benCallID,
@Param("complaintID") String complaintID,
@Param("beneficiaryRegID") Long beneficiaryRegID,
@Param("userID") Integer userID);



@Query(" Select grievance.callCounter, grievance.retryNeeded,grievance.complaintResolution FROM GrievanceDetails grievance where grievance.complaintID = :complaintID")
public List<Object[]> getCallCounter(@Param("complaintID") String complaintID);

Expand All @@ -133,6 +153,7 @@ public int updateCallCounter(@Param("callCounter") Integer callCounter,
@Param("complaintID") String complaintID,
@Param("beneficiaryRegID") Long beneficiaryRegID,
@Param("userID") Integer userID);


@Query("SELECT g FROM GrievanceDetails g WHERE "
+ "(g.state = :state OR :state IS NULL) "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
import com.iemr.common.data.beneficiary.Beneficiary;
import com.iemr.common.data.mctshistory.MctsOutboundCallDetail;
Expand Down Expand Up @@ -77,6 +76,8 @@ public class RegisterBenificiaryServiceImpl implements RegisterBenificiaryServic
@Autowired
Validator validator;



@Autowired
OutboundHistoryRepository outboundHistoryRepository;

Expand Down Expand Up @@ -171,6 +172,7 @@ public String save(BeneficiaryModel beneficiaryModel, HttpServletRequest servlet
identityDTO.setIsConsent(beneficiaryModel.getIsConsent());
identityDTO.setFaceEmbedding(beneficiaryModel.getFaceEmbedding());
identityDTO.setEmergencyRegistration(beneficiaryModel.isEmergencyRegistration());
identityDTO.setIsConsent(beneficiaryModel.getIsConsent());
identityDTO
.setBenFamilyDTOs(identityMapper.benPhoneMapListToBenFamilyDTOList(beneficiaryModel.getBenPhoneMaps()));
String request = new Gson().toJson(identityDTO);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.iemr.common.service.beneficiaryOTPHandler;

import com.iemr.common.data.beneficiaryConsent.BeneficiaryConsentRequest;
import com.iemr.common.data.otp.OTPRequestParsor;
import org.json.JSONObject;

public interface BeneficiaryOTPHandler {
public String sendOTP(BeneficiaryConsentRequest obj) throws Exception;

public JSONObject validateOTP(BeneficiaryConsentRequest obj) throws Exception;

public String resendOTP(BeneficiaryConsentRequest obj) throws Exception;

}
Loading