Skip to content

Merge 3.8.2 code#177

Open
vishwab1 wants to merge 11 commits into
release-3.8.2from
vb/release-3.8.2-merge
Open

Merge 3.8.2 code#177
vishwab1 wants to merge 11 commits into
release-3.8.2from
vb/release-3.8.2-merge

Conversation

@vishwab1

Copy link
Copy Markdown
Member

📋 Description

JIRA ID:

Please provide a summary of the change and the motivation behind it. Include relevant context and details.


✅ Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)
  • New feature (non-breaking change which adds functionality)
  • 🔥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 🛠 Refactor (change that is neither a fix nor a new feature)
  • ⚙️ Config change (configuration file or build script updates)
  • 📚 Documentation (updates to docs or readme)
  • 🧪 Tests (adding new or updating existing tests)
  • 🎨 UI/UX (changes that affect the user interface)
  • 🚀 Performance (improves performance)
  • 🧹 Chore (miscellaneous changes that don't modify src or test files)

ℹ️ Additional Information

Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.

vishwab1 and others added 11 commits July 22, 2026 18:11
…details.otherFields

Mobile sends height/weight/bmi/temperature in beneficiaryDetails payload.
i_beneficiarydetails_rmnch has no these columns so they were lost.
FLW-API getBeneficiaryData reads from otherFields (temperatureValue key).

- RMNCHBeneficiaryDetailsRmnch: @transient height/weight/bmi/temperature
- BenDetailRepo: updateOtherFieldsByBenRegId query
- RmnchDataSyncServiceImpl: merge anthropometry into otherFields after save

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Reads camp:vanID and camp:parkingPlaceID from Redis (written by MMU-API
on van login) and stamps them onto RMNCHBeneficiaryDetailsRmnch,
RMNCHBornBirthDetails, RMNCHCBACdetails, and RMNCHHouseHoldDetails when
the mobile payload carries VanID=null or 0. Also writes anthropometry
(height/weight/bmi/temperature) from mobile beneficiaryDetails payload
into i_beneficiarydetails.otherFields so FLW-API getBeneficiaryData can
return them. Gracefully skips if Redis has no camp configured.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…merge

Hibernate merge() returns new managed instances that do not carry
@transient field values (height/weight/bmi/temperature). Keep a
reference to the original list before saveAll so the anthropometry
loop reads from objects that still have the mobile payload values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getObject("camp:vanID", false, 0) was calling EXPIRE key 0 which
immediately deletes the key in Redis after every sync. Replaced with
getRaw() which reads the value without modifying TTL, so camp:vanID
persists across multiple syncs until MMU logout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The Stop TB mobile app calls this RMNCH sync endpoint directly to save
household details. Same issue as elsewhere: vanID stamping is skipped
silently when Redis has no camp:vanID, so household records end up
with vanID=NULL. When stoptb.enforce.vanid=true, sync now fails with a
clear error instead.
…RMNCH records

Introduces GPS-related fields (gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable, and gpsUnavailableReason) across beneficiary address and RMNCH domain models, including MBeneficiaryaddress, Address DTO, RMNCHBeneficiaryDetailsRmnch, and RMNCHHouseHoldDetails.

Enhances IdentityMapper and IdentityService to map and persist GPS information between incoming DTOs and beneficiary address entities.

Updates RmnchDataSyncServiceImpl to extract and synchronize GPS details from the nested i_bendemographics payload during beneficiary sync, and to parse gpsTimestamp from household details during RMNCH household data processing.
…RMNCH records (#167)

Introduces GPS-related fields (gpsLatitude, gpsLongitude, digipin, gpsTimestamp, isGpsUnavailable, and gpsUnavailableReason) across beneficiary address and RMNCH domain models, including MBeneficiaryaddress, Address DTO, RMNCHBeneficiaryDetailsRmnch, and RMNCHHouseHoldDetails.

Enhances IdentityMapper and IdentityService to map and persist GPS information between incoming DTOs and beneficiary address entities.

Updates RmnchDataSyncServiceImpl to extract and synchronize GPS details from the nested i_bendemographics payload during beneficiary sync, and to parse gpsTimestamp from household details during RMNCH household data processing.

Co-authored-by: Sehjot Singh Pannu <sehjot.singh@unthinkable.co>
…-millis gpsTimestamp

createIdentity() parsed the request body with a bare new Gson(), whose
default Timestamp adapter only accepts ISO8601 date strings. The new
gpsTimestamp field is sent as raw epoch millis, causing
JsonSyntaxException during parsing whenever GPS data is present. That
exception propagated up through JwtUserIdValidationFilter's catch
block and was misreported as a 401 Authorization error.

InputMapper already registers a Timestamp adapter that handles epoch
millis correctly; switch createIdentity() to use it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SQL had 6 placeholders but object array had 7 elements including vanID,
causing parameter index out of bounds error. Added vanID to INSERT columns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
permPinCode was already stored correctly in i_beneficiaryaddress but
was never surfaced in the RMNCH sync response, since the response DTO
had no pinCode field and the address mapping never copied it across.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ed endpoints

The GPS feature (STOP-148) registered a custom Gson TypeAdapter<Timestamp>
globally on InputMapper's GsonBuilder to parse the new gpsTimestamp field.
Because it was global, it also intercepted dob, silently returning null
whenever the incoming date string didn't match one of its four hardcoded
formats.

- Add GpsTimestampAdapter, attached only via @JsonAdapter on the gpsTimestamp
  field (Address, RMNCHBeneficiaryDetailsRmnch, RMNCHHouseHoldDetails), so it
  can't affect any other Timestamp field.
- Remove the global registerTypeAdapter(Timestamp.class, ...) from both
  InputMapper.java copies, restoring Gson's default Timestamp parsing for
  dob and everything else (matching vb/stoptb).
- Revert createIdentity()'s parser back to a bare new Gson(), matching
  Common-API's RegisterBenificiaryServiceImpl, which also serializes the
  outgoing identity payload with a bare new Gson(). InputMapper's
  setDateFormat is incompatible with that wire format (non-zero-padded day),
  which is why dob was nulling specifically for beneficiaries born on the
  1st-9th of a month once createIdentity switched to InputMapper's Gson.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 252c9c00-50d0-400c-9a9e-4ad544d0359e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
9.8% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

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.

3 participants