Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,18 @@ public class RMNCHBeneficiaryDetailsRmnch {
private String phoneNo;
@Expose
@Transient
private String economicStatus;
@Expose
@Transient
private Integer economicStatusId;
@Expose
@Transient
private String residentialArea;
@Expose
@Transient
private Integer residentialAreaId;
@Expose
@Transient
private String contact_number;
@Expose
@Transient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,24 @@ public class RMNCHMBeneficiarydetail {
@Column(length = 45)
private String occupation;

// STOP-444 followup fix: column exists (economicStatus/economicStatusId on
// i_beneficiarydetails) and is 100% NULL across every row, including freshly
// created ones β€” confirmed no code path, create or edit, has ever written to it.
// The app sends this value (inside i_bendemographics) every time.
private Integer economicStatusId;

@Column(length = 45)
private String economicStatus;

// STOP-444 followup fix: same situation as economicStatus above β€” real column,
// never written. Originally (wrongly) placed on the address entity in an earlier
// pass; corrected here to match where FLW-API's own RMNCHMBeneficiarydetail already
// declares it, confirming this is the real table.
private Integer residentialAreaId;

@Column(name = "residentialArea")
private String residentialArea;

private Integer phcId;

@Column(length = 30)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,7 @@
if (demog.has("isGpsUnavailable") && !demog.get("isGpsUnavailable").isJsonNull())
obj.setIsGpsUnavailable(demog.get("isGpsUnavailable").getAsBoolean());
// STOP-444 followup fix: same source object, previously never read for
// anything but GPS. economicStatus deliberately NOT extracted here β€” its
// correct persisted home is unconfirmed (looks like it belongs on the
// household record, i_householddetails.type_bpl_apl, not the beneficiary).
// anything but GPS.
if (demog.has("occupation") && !demog.get("occupation").isJsonNull())
obj.setOccupation(demog.get("occupation").getAsString());
if (demog.has("communityName") && !demog.get("communityName").isJsonNull())
Expand All @@ -236,6 +234,18 @@
obj.setPinCode(demog.get("pinCode").getAsString());
if (demog.has("blockID") && !demog.get("blockID").isJsonNull())
obj.setBlockId(demog.get("blockID").getAsInt());
// STOP-444 followup fix: economicStatus previously skipped here β€” turned
// out i_beneficiarydetails.economicStatus/economicStatusId genuinely exist
// (confirmed via schema, not just source code β€” 100% NULL across every row
// including fresh ones), so this is the correct persisted home after all.
if (demog.has("economicStatus") && !demog.get("economicStatus").isJsonNull())

Check failure on line 241 in src/main/java/com/iemr/common/identity/service/rmnch/RmnchDataSyncServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "economicStatus" 3 times.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Identity-API&issues=AaCPp8aJ4LrnM-3CvjBD&open=AaCPp8aJ4LrnM-3CvjBD&pullRequest=196
obj.setEconomicStatus(demog.get("economicStatus").getAsString());
if (demog.has("economicStatusId") && !demog.get("economicStatusId").isJsonNull())

Check failure on line 243 in src/main/java/com/iemr/common/identity/service/rmnch/RmnchDataSyncServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "economicStatusId" 3 times.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Identity-API&issues=AaCPp8aJ4LrnM-3CvjBF&open=AaCPp8aJ4LrnM-3CvjBF&pullRequest=196
obj.setEconomicStatusId(demog.get("economicStatusId").getAsInt());
if (demog.has("residentialArea") && !demog.get("residentialArea").isJsonNull())

Check failure on line 245 in src/main/java/com/iemr/common/identity/service/rmnch/RmnchDataSyncServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "residentialArea" 3 times.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Identity-API&issues=AaCPp8aJ4LrnM-3CvjA8&open=AaCPp8aJ4LrnM-3CvjA8&pullRequest=196
obj.setResidentialArea(demog.get("residentialArea").getAsString());
if (demog.has("residentialAreaId") && !demog.get("residentialAreaId").isJsonNull())

Check failure on line 247 in src/main/java/com/iemr/common/identity/service/rmnch/RmnchDataSyncServiceImpl.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "residentialAreaId" 3 times.

See more on https://sonarcloud.io/project/issues?id=PSMRI_Identity-API&issues=AaCPp8aJ4LrnM-3CvjBI&open=AaCPp8aJ4LrnM-3CvjBI&pullRequest=196
obj.setResidentialAreaId(demog.get("residentialAreaId").getAsInt());
}
// STOP-444 followup fix: phone number is sent as benPhoneMaps[0].phoneNo, not
// a flat field β€” same lowercase-key mismatch problem as village/block below.
Expand Down Expand Up @@ -342,6 +352,22 @@
if (obj.getReligionID() != null) {
rmnchmBeneficiarydetail.setReligionID(obj.getReligionID());
}
if (obj.getEconomicStatus() != null) {
rmnchmBeneficiarydetail.setEconomicStatus(obj.getEconomicStatus());
}
if (obj.getEconomicStatusId() != null) {
rmnchmBeneficiarydetail.setEconomicStatusId(obj.getEconomicStatusId());
}
// STOP-444 followup fix: residentialArea/residentialAreaId β€” corrected here
// from an earlier (wrong) placement on the address entity; confirmed against
// FLW-API's own RMNCHMBeneficiarydetail, which already declares these fields
// on this same table.
if (obj.getResidentialArea() != null) {
rmnchmBeneficiarydetail.setResidentialArea(obj.getResidentialArea());
}
if (obj.getResidentialAreaId() != null) {
rmnchmBeneficiarydetail.setResidentialAreaId(obj.getResidentialAreaId());
}
if(obj.getFamilyId()!=null && !obj.getFamilyId().isEmpty()){
rmnchmBeneficiarydetail.setFamilyId(obj.getFamilyId());

Expand Down
Loading