-
Notifications
You must be signed in to change notification settings - Fork 45
adding code changes for grievance issues #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adding code changes for grievance issues #168
Conversation
WalkthroughThis pull request updates multiple layers of the grievance processing feature. The changes expand the parameters for fetching unallocated grievance counts across the controller, service, and repository layers. Data models have been modified through field renames and the removal of an obsolete field. Method signatures and query annotations are updated in the repository and service implementations to incorporate additional filters and identifiers. Internal logic in the handling service methods has also been revised to align with the new parameter requirements, while error handling remains unchanged. Changes
Sequence Diagram(s)sequenceDiagram
participant C as GrievanceController
participant DS as GrievanceDataSync / GrievanceDataSyncImpl
participant R as GrievanceDataRepo
C->>DS: fetchUnallocatedGrievanceCount(preferredLanguage, filterStartDate, filterEndDate, providerServiceMapID)
DS->>R: fetchUnallocatedGrievanceCount(filterStartDate, filterEndDate)
R-->>DS: return grievance count data
DS-->>C: return formatted count result
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/java/com/iemr/common/repository/grievance/GrievanceDataRepo.java (1)
72-77
: Enhanced fetchUnallocatedGrievanceCount with date filtering.The
fetchUnallocatedGrievanceCount
method has been enhanced to include date range filtering withfilterStartDate
andfilterEndDate
parameters. This provides more granular control over fetching unallocated grievances based on when they were created.Consider adding a check for null date parameters to make this method more robust, possibly by adding an optional fallback for when date filters aren't provided.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
src/main/java/com/iemr/common/controller/grievance/GrievanceController.java
(1 hunks)src/main/java/com/iemr/common/data/grievance/GrievanceAllocationRequest.java
(1 hunks)src/main/java/com/iemr/common/data/grievance/GrievanceDetails.java
(1 hunks)src/main/java/com/iemr/common/repository/grievance/GrievanceDataRepo.java
(1 hunks)src/main/java/com/iemr/common/service/grievance/GrievanceDataSync.java
(2 hunks)src/main/java/com/iemr/common/service/grievance/GrievanceDataSyncImpl.java
(1 hunks)src/main/java/com/iemr/common/service/grievance/GrievanceHandlingServiceImpl.java
(5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: style-check / checkstyle
- GitHub Check: Build
- GitHub Check: Analyze (java)
- GitHub Check: Package-test
🔇 Additional comments (19)
src/main/java/com/iemr/common/controller/grievance/GrievanceController.java (1)
51-51
: Method call updated to include additional filtering parameters.The method call has been updated to include start date, end date, and provider service map ID, which aligns with the interface changes. This enhancement allows for more granular filtering of unallocated grievances.
src/main/java/com/iemr/common/service/grievance/GrievanceDataSync.java (2)
3-3
: Import added for the new parameter types.Added import for Timestamp to support the date filtering functionality.
14-15
: Method signature updated with additional filtering parameters.The interface method signature has been expanded to include start date, end date, and provider service map ID parameters, enhancing the filtering capabilities.
src/main/java/com/iemr/common/data/grievance/GrievanceAllocationRequest.java (3)
13-13
: Variable renamed for clarity.The variable
userID
has been renamed totouserID
to better indicate that these are the target users for allocation.
15-15
: Variable renamed for consistency.Variable renamed from
preferredLanguage
tolanguage
for better consistency across the codebase.
19-20
: Updated toString() method to reflect variable name changes.The toString() method has been properly updated to use the new variable names.
src/main/java/com/iemr/common/service/grievance/GrievanceDataSyncImpl.java (1)
414-415
: Method signature updated to match interface changes.The implementation now accepts additional filtering parameters to align with the interface definition.
src/main/java/com/iemr/common/data/grievance/GrievanceDetails.java (1)
168-168
:✅ Verification successful
Constructor signature updated to remove agentID parameter.
The constructor signature has been updated to remove the
agentID
parameter, which aligns with the removal of theagentid
field from the class. This change maintains consistency in the data model.
🏁 Script executed:
#!/bin/bash # Check for any remaining references to agentid in the codebase # that might be affected by this removal echo "Checking for remaining references to agentid field..." rg -i "\.agentid|\.getAgentid\(\)|setAgentid" --type javaLength of output: 20549
Constructor Signature Change in GrievanceDetails Verified
The constructor in
GrievanceDetails.java
has been correctly updated to remove theagentID
parameter, which now aligns with the removal of the corresponding field from the class. This change is self-contained; while our search shows that many other classes and methods still referenceagentID
, those usages appear intentional and are unrelated to the refactoring in this file.
- File Affected:
src/main/java/com/iemr/common/data/grievance/GrievanceDetails.java
at line 168- Change Validated: The removal of
agentID
in the constructor signature is consistent with the updated data model.src/main/java/com/iemr/common/service/grievance/GrievanceHandlingServiceImpl.java (6)
76-76
: Method parameter updated to use language instead of preferredLanguage.The parameter has been updated from
preferredLanguage
tolanguage
, which aligns with renaming in theGrievanceAllocationRequest
class. This maintains consistency across the codebase.
88-88
: User ID retrieval method updated.The method to retrieve user IDs has been changed from
getUserID()
togetTouserID()
, which aligns with changes in theGrievanceAllocationRequest
class. This ensures proper allocation of grievances to users.
233-238
: Updated unassign grievance logic to use gwid instead of grievanceId.The grievance unassignment logic has been updated to:
- Set the user ID to null before unassigning
- Use
gwid
instead ofgrievanceId
for identifying the grievance- Update the allocation status based on
gwid
These changes align with the repository layer modifications and provide more accurate grievance identification.
241-242
: Updated log messages to reference gwid instead of grievanceId.The log messages have been updated to reference
gwid
instead ofgrievanceId
, maintaining consistency with the updated identification approach in the codebase.Also applies to: 244-245, 248-249
371-373
: Added validation for benCallID.New validation has been added to check if
benCallID
is not null, which is a good practice to ensure data integrity before processing the complaint resolution.
382-382
: Added benCallID parameter in complaint resolution update.The
benCallID
parameter has been extracted from the request and included in the repository method calls for updating complaint resolution. This enhances the identification of grievances and aligns with the repository layer changes.Also applies to: 387-388, 392-393
src/main/java/com/iemr/common/repository/grievance/GrievanceDataRepo.java (5)
63-64
: Updated unassignGrievance query to use gwid instead of grievanceId.The query has been updated to identify grievances by
gwid
instead ofgrievanceId
, which provides a more accurate way to identify specific grievance records. This change aligns with the service layer modifications.
68-70
: Updated updateGrievanceAllocationStatus query to use gwid.The query has been updated to use
gwid
instead ofgrievanceId
for identifying grievances when updating their allocation status. This maintains consistency with other repository methods.
80-92
: Added benCallID parameter to updateComplaintResolution query.The query has been updated to include the
benCallID
parameter when updating complaint resolution details. This enhances grievance identification and aligns with the service layer modifications.
95-106
: Added benCallID parameter to overloaded updateComplaintResolution query.The overloaded version of the
updateComplaintResolution
method has also been updated to include thebenCallID
parameter, maintaining consistency with the other implementation.
108-108
: Fixed query condition in getCallCounter method.The query condition has been updated to properly reference
grievance.complaintID
instead of justcomplaintID
, which ensures correct comparison in the SQL query.
|
||
// Fetch all unallocated grievances count from the database | ||
Set<Object[]> resultSet = grievanceDataRepo.fetchUnallocatedGrievanceCount(); | ||
Set<Object[]> resultSet = grievanceDataRepo.fetchUnallocatedGrievanceCount(filterStartDate, filterEndDate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The providerServiceMapID parameter is not used in the repository call.
The method accepts providerServiceMapID as a parameter, but it's not passed to the repository method. This inconsistency may lead to bugs or confusion.
Consider updating the repository call to use the providerServiceMapID parameter:
-Set<Object[]> resultSet = grievanceDataRepo.fetchUnallocatedGrievanceCount(filterStartDate, filterEndDate);
+Set<Object[]> resultSet = grievanceDataRepo.fetchUnallocatedGrievanceCount(filterStartDate, filterEndDate, providerServiceMapID);
Also ensure that the corresponding repository method accepts this parameter.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
Set<Object[]> resultSet = grievanceDataRepo.fetchUnallocatedGrievanceCount(filterStartDate, filterEndDate); | |
Set<Object[]> resultSet = grievanceDataRepo.fetchUnallocatedGrievanceCount(filterStartDate, filterEndDate, providerServiceMapID); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine
* adding changes related to encryption and decryption * making final field static * making enclosing method static * adding beneficiaryConsent param to createFeedback API * Update src/main/java/com/iemr/common/data/feedback/FeedbackDetails.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * adding beneficiary consent param feedbacklist response * adding space * adding code for schedule for grievance data sync * adding code rabbit code suggestions * adding code rabbit suggestions * code rabbit suggested changes to Model classes * adding sonar quality changes * adding sonar quality code suggestions * adding sonar quality check suggestions * adding code rabbit suggestions * adding constant instead of duplicate literals * adding cod changs to fetch unallocated grievance count * adding changes suggested by sonar quality check * adding code rabbit suggested changes * fixing config file * fixing space * fixing space issue * adding package for PrimaryDBConfig * adding code changes for allocate API for allocating grievance to agents * removing space * adding language related changes * add language related changes * adding name convention related changes * adding code rabbit changes * adding sonar quality check suggested changes * removing unused imports * adding properties related to Grievance in properties file * placing the placeholder for jwt secret key * Update package.yml updating upload artifact version to v4 * removing grievanc related properties from application properties file * adding space * removing extra space * adding code for API that fetches grievance outbound worklist * adding code rabbit suggested changes * another addition of code rabbit suggested changes * fixing row no * adding code for API to save complaint resolution and remarks in the db * adding code rabbit suggested changes * removing lastModDate as it will update automatically in db * changing variable name of assignedUserID to userID * fixing remarks * removing full stop * adding code for API to close call and make reattempts if needed * adding code changes suggested by code rabbit * adding code rabbit suggested changes * adding code rabbit fixes * adding code rabbit fixes * Delete src/main/java/com/iemr/common/data/grievance/.gitignore * AMM-1148 | Close call API including reattempt logic based on calltype (#164) * adding code for API to close call and make reattempts if needed * adding code changes suggested by code rabbit * adding code rabbit suggested changes * adding code rabbit fixes * adding code rabbit fixes * Delete src/main/java/com/iemr/common/data/grievance/.gitignore --------- Co-authored-by: SR20290919 <SR20290919@APL-PG02PW8B> * removing unused literal in repo class * changing logic of Close call after discussion * adding changes related to invalid and wrong number call type * adding code for API to push back grievance data to GR team * removed unnecessary conditions * adding code rabbit changes * adding code rabbit suggestions * adding required null checks * adding code rabbit suggested changes * removing unnecessary Exception * AMM-1149 | API to push back Grievance data to the GR team (#166) * adding code for API to push back grievance data to GR team * removed unnecessary conditions * adding code rabbit changes * adding code rabbit suggestions * adding required null checks * adding code rabbit suggested changes * removing unnecessary Exception --------- Co-authored-by: SR20290919 <SR20290919@APL-PG02PW8B> * adding code changes for variable name change of lang * adding code changes for grievance issues * adding code changes for grievance issues (#168) Co-authored-by: SR20290919 <SR20290919@APL-PG02PW8B> * adding fixes related to grievance related APIs * fixing code rabbit issues * adding code fixes related to scheduler --------- Co-authored-by: SR20290919 <SR20290919@APL-PG02PW8B> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: SR20290919 <SR20290919@192.168.1.34> Co-authored-by: SR20290919 <SR20290919@APL-PG02PW8B.wipro.com>
…tion (#190) * adding changes related to encryption and decryption * making final field static * making enclosing method static * adding beneficiaryConsent param to createFeedback API * Update src/main/java/com/iemr/common/data/feedback/FeedbackDetails.java Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * adding beneficiary consent param feedbacklist response * adding space * adding code for schedule for grievance data sync * adding code rabbit code suggestions * adding code rabbit suggestions * code rabbit suggested changes to Model classes * adding sonar quality changes * adding sonar quality code suggestions * adding sonar quality check suggestions * adding code rabbit suggestions * adding constant instead of duplicate literals * adding cod changs to fetch unallocated grievance count * adding changes suggested by sonar quality check * adding code rabbit suggested changes * fixing config file * fixing space * fixing space issue * adding package for PrimaryDBConfig * adding code changes for allocate API for allocating grievance to agents * removing space * adding language related changes * add language related changes * adding name convention related changes * adding code rabbit changes * adding sonar quality check suggested changes * removing unused imports * adding properties related to Grievance in properties file * placing the placeholder for jwt secret key * Update package.yml updating upload artifact version to v4 * removing grievanc related properties from application properties file * adding space * removing extra space * adding code for API that fetches grievance outbound worklist * adding code rabbit suggested changes * another addition of code rabbit suggested changes * fixing row no * adding code for API to save complaint resolution and remarks in the db * adding code rabbit suggested changes * removing lastModDate as it will update automatically in db * changing variable name of assignedUserID to userID * fixing remarks * removing full stop * adding code for API to close call and make reattempts if needed * adding code changes suggested by code rabbit * adding code rabbit suggested changes * adding code rabbit fixes * adding code rabbit fixes * Delete src/main/java/com/iemr/common/data/grievance/.gitignore * AMM-1148 | Close call API including reattempt logic based on calltype (#164) * adding code for API to close call and make reattempts if needed * adding code changes suggested by code rabbit * adding code rabbit suggested changes * adding code rabbit fixes * adding code rabbit fixes * Delete src/main/java/com/iemr/common/data/grievance/.gitignore --------- Co-authored-by: SR20290919 <SR20290919@APL-PG02PW8B> * removing unused literal in repo class * changing logic of Close call after discussion * adding changes related to invalid and wrong number call type * adding code for API to push back grievance data to GR team * removed unnecessary conditions * adding code rabbit changes * adding code rabbit suggestions * adding required null checks * adding code rabbit suggested changes * removing unnecessary Exception * AMM-1149 | API to push back Grievance data to the GR team (#166) * adding code for API to push back grievance data to GR team * removed unnecessary conditions * adding code rabbit changes * adding code rabbit suggestions * adding required null checks * adding code rabbit suggested changes * removing unnecessary Exception --------- Co-authored-by: SR20290919 <SR20290919@APL-PG02PW8B> * adding code changes for variable name change of lang * adding code changes for grievance issues * adding code changes for grievance issues (#168) Co-authored-by: SR20290919 <SR20290919@APL-PG02PW8B> * adding fixes related to grievance related APIs * fixing code rabbit issues * adding code fixes related to scheduler * Scheduler changes * adding import * adding grievance sms template changes * removing space --------- Co-authored-by: SR20290919 <SR20290919@APL-PG02PW8B> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: SR20290919 <SR20290919@192.168.1.34> Co-authored-by: SR20290919 <SR20290919@APL-PG02PW8B.wipro.com> Co-authored-by: Ravi Shanigarapu <ravi.shanigarapu@wipro.com>
📋 Description
JIRA ID:
Please provide a summary of the change and the motivation behind it. Include relevant context and details.
✅ Type of Change
ℹ️ Additional Information
Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.
Summary by CodeRabbit
New Features
Refactor