Skip to content

Revert "[MOSIP-44617] Fixed "Mandatory fields are missing" error in sendNotifications API"#1034

Merged
mayuradesh merged 1 commit intomosip:developfrom
GOKULRAJ136:revert-1032-notify-draft-dev
Mar 20, 2026
Merged

Revert "[MOSIP-44617] Fixed "Mandatory fields are missing" error in sendNotifications API"#1034
mayuradesh merged 1 commit intomosip:developfrom
GOKULRAJ136:revert-1032-notify-draft-dev

Conversation

@GOKULRAJ136
Copy link
Copy Markdown
Contributor

@GOKULRAJ136 GOKULRAJ136 commented Mar 18, 2026

Reverts #1032

Summary by CodeRabbit

  • Refactor
    • Optimized internal notification data transformation logic for improved efficiency.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 18, 2026

Walkthrough

The NotificationServiceUtil class refactors internal data transformation logic in the createNotificationDetails method. When isLatest is true, the code now parses data as HashMap<String, String> instead of Map<String, Object>, directly converting values to NotificationDTO and building key-value pair entries. This change removes the TypeReference import and simplifies the deserialization path while maintaining the public method signature.

Changes

Cohort / File(s) Summary
Notification Data Transformation
pre-registration/pre-registration-application-service/src/main/java/io/mosip/preregistration/application/service/util/NotificationServiceUtil.java
Refactored the isLatest branch logic to parse HashMap<String, String> instead of Map<String, Object>. Removed TypeReference import and simplified the loop to use a single KeyValuePairDto instance per iteration, updating it with the key and converted NotificationDTO.name before adding to the list.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Hop! Data flows cleaner now,
From Object maps to Strings so bright,
KeyValuePairs dance just right,
A refactor gentle, trim, and lean,
The simplest path is best, I've seen! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the pull request as a revert of a previous fix, directly corresponding to the changeset that removes the logic changes from PR 1032.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

…endNotif…"

This reverts commit 4bb882a.

Signed-off-by: GOKULRAJ136 <110164849+GOKULRAJ136@users.noreply.github.com>
@GOKULRAJ136 GOKULRAJ136 force-pushed the revert-1032-notify-draft-dev branch from fd12d3b to 2bcb756 Compare March 18, 2026 14:33
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a 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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@pre-registration/pre-registration-application-service/src/main/java/io/mosip/preregistration/application/service/util/NotificationServiceUtil.java`:
- Around line 138-145: The deserialization currently uses HashMap.class and
assigns to Map<String, String>, which fails when notificationDtoData contains
nested objects; change the objectMapper.readValue call to deserialize into a
Map<String, Object> (use TypeReference<Map<String,Object>> with objectMapper) so
nested structures are preserved, then continue converting each entry's value to
NotificationDTO via objectMapper.convertValue(notificationDtoDataEntryValue,
NotificationDTO.class) before populating KeyValuePairDto (langaueNamePair) and
adding to langaueNamePairs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e6583397-0f8a-4ec6-8dce-992839c873c4

📥 Commits

Reviewing files that changed from the base of the PR and between ae49914 and 2bcb756.

📒 Files selected for processing (1)
  • pre-registration/pre-registration-application-service/src/main/java/io/mosip/preregistration/application/service/util/NotificationServiceUtil.java

@mayuradesh mayuradesh merged commit 98573c3 into mosip:develop Mar 20, 2026
21 checks passed
GOKULRAJ136 added a commit to GOKULRAJ136/pre-registration that referenced this pull request Apr 16, 2026
…endNotif…" (mosip#1034)

This reverts commit 4bb882a.

Signed-off-by: GOKULRAJ136 <110164849+GOKULRAJ136@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants