diff --git a/pom.xml b/pom.xml
index 454fd02a..190b3438 100644
--- a/pom.xml
+++ b/pom.xml
@@ -171,7 +171,6 @@
hibernate-jpa-2.0-api
1.0.1.Final
-
org.springframework.boot
spring-boot-starter-cache
@@ -503,7 +502,7 @@
- commonapi-v3.0.0
+ commonapi-v1.0
org.apache.maven.plugins
diff --git a/src/main/java/com/iemr/common/controller/beneficiaryConsent/BeneficiaryConsentController.java b/src/main/java/com/iemr/common/controller/beneficiaryConsent/BeneficiaryConsentController.java
new file mode 100644
index 00000000..60c7bdee
--- /dev/null
+++ b/src/main/java/com/iemr/common/controller/beneficiaryConsent/BeneficiaryConsentController.java
@@ -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());
+
+ 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());
+
+ 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();
+ }
+
+
+}
+
+
diff --git a/src/main/java/com/iemr/common/controller/grievance/GrievanceController.java b/src/main/java/com/iemr/common/controller/grievance/GrievanceController.java
index bf243f69..802dcd39 100644
--- a/src/main/java/com/iemr/common/controller/grievance/GrievanceController.java
+++ b/src/main/java/com/iemr/common/controller/grievance/GrievanceController.java
@@ -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) {
diff --git a/src/main/java/com/iemr/common/controller/otp/OTPGateway.java b/src/main/java/com/iemr/common/controller/otp/OTPGateway.java
index 42371a88..f74caa63 100644
--- a/src/main/java/com/iemr/common/controller/otp/OTPGateway.java
+++ b/src/main/java/com/iemr/common/controller/otp/OTPGateway.java
@@ -55,6 +55,7 @@ public class OTPGateway {
@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());
OutputResponse response = new OutputResponse();
@@ -62,7 +63,8 @@ public String sendOTP(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody Stri
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");
@@ -102,6 +104,7 @@ public String validateOTP(
@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());
OutputResponse response = new OutputResponse();
@@ -109,7 +112,9 @@ public String resendOTP(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody St
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");
diff --git a/src/main/java/com/iemr/common/data/beneficiaryConsent/BeneficiaryConsentRequest.java b/src/main/java/com/iemr/common/data/beneficiaryConsent/BeneficiaryConsentRequest.java
new file mode 100644
index 00000000..ac629a3c
--- /dev/null
+++ b/src/main/java/com/iemr/common/data/beneficiaryConsent/BeneficiaryConsentRequest.java
@@ -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;
+
+}
diff --git a/src/main/java/com/iemr/common/data/grievance/GrievanceCallRequest.java b/src/main/java/com/iemr/common/data/grievance/GrievanceCallRequest.java
index 17178003..f6595f16 100644
--- a/src/main/java/com/iemr/common/data/grievance/GrievanceCallRequest.java
+++ b/src/main/java/com/iemr/common/data/grievance/GrievanceCallRequest.java
@@ -11,6 +11,8 @@ public class GrievanceCallRequest {
Long beneficiaryRegID;
Integer callTypeID;
Long benCallID;
+ Integer providerServiceMapId;
+
Integer providerServiceMapID;
String createdBy;
diff --git a/src/main/java/com/iemr/common/data/grievance/GrievanceDetails.java b/src/main/java/com/iemr/common/data/grievance/GrievanceDetails.java
index 17019b54..8108def4 100644
--- a/src/main/java/com/iemr/common/data/grievance/GrievanceDetails.java
+++ b/src/main/java/com/iemr/common/data/grievance/GrievanceDetails.java
@@ -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;
diff --git a/src/main/java/com/iemr/common/dto/identity/CommonIdentityDTO.java b/src/main/java/com/iemr/common/dto/identity/CommonIdentityDTO.java
index 8e364eb3..c057b58d 100644
--- a/src/main/java/com/iemr/common/dto/identity/CommonIdentityDTO.java
+++ b/src/main/java/com/iemr/common/dto/identity/CommonIdentityDTO.java
@@ -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;
diff --git a/src/main/java/com/iemr/common/model/beneficiary/BeneficiaryModel.java b/src/main/java/com/iemr/common/model/beneficiary/BeneficiaryModel.java
index 209472ef..8b00263a 100644
--- a/src/main/java/com/iemr/common/model/beneficiary/BeneficiaryModel.java
+++ b/src/main/java/com/iemr/common/model/beneficiary/BeneficiaryModel.java
@@ -77,6 +77,10 @@ public class BeneficiaryModel implements Comparable {
// private List outboundCallRequests;
// private List beneficiaryCalls;
// private List feedbacks;
+ @Expose
+ private Boolean isConsent=false;
+
+
@Expose
private String beneficiaryID;
@Expose
diff --git a/src/main/java/com/iemr/common/repository/callhandling/IEMRCalltypeRepositoryImplCustom.java b/src/main/java/com/iemr/common/repository/callhandling/IEMRCalltypeRepositoryImplCustom.java
index 0e98bf1d..544ffd7f 100644
--- a/src/main/java/com/iemr/common/repository/callhandling/IEMRCalltypeRepositoryImplCustom.java
+++ b/src/main/java/com/iemr/common/repository/callhandling/IEMRCalltypeRepositoryImplCustom.java
@@ -88,6 +88,8 @@ Set