Skip to content

Commit

Permalink
[Rahul] | BAH-3558 | Add. Support for postalCode
Browse files Browse the repository at this point in the history
  • Loading branch information
rahu1ramesh committed Feb 12, 2024
1 parent 21aa428 commit a38a4a1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ public class OpenMRSPersonAddress implements Jsonify {
private String countyDistrict;
private String stateProvince;
private String country;
private String postalCode;

public OpenMRSPersonAddress() {
}

public OpenMRSPersonAddress(String address1, String address2, String address3, String cityVillage, String countyDistrict, String stateProvince, String country) {
public OpenMRSPersonAddress(String address1, String address2, String address3, String cityVillage, String countyDistrict, String stateProvince, String country, String postalCode) {
this.address1 = address1;
this.address2 = address2;
this.address3 = address3;
this.cityVillage = cityVillage;
this.countyDistrict = countyDistrict;
this.stateProvince = stateProvince;
this.country = country;
this.postalCode = postalCode;
}

public String getCountry() {
Expand Down Expand Up @@ -88,6 +90,10 @@ public void setStateProvince(String stateProvince) {
this.stateProvince = stateProvince;
}

public String getPostalCode() { return postalCode; }

public void setPostalCode(String postalCode) { this.postalCode = postalCode; }

@Override
public String toJsonString() {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private OpenERPRequest createOpenERPRequest(Event event) {
addToParametersIfNotEmpty(parameters,"attributes", "{\"healthCenter\":\"2\",\"givenNameLocal\":\"राम बाई\",\"class\":\"ST\"}");
addToParametersIfNotEmpty(parameters,"preferredAddress", "{\"address1\":\"address1\",\"address2\":\"address2\"," +
"\"address3\":\"address3\",\"cityVillage\":\"cityVillage\",\"countyDistrict\":\"countyDistrict\"," +
"\"stateProvince\":\"stateProvince\",\"country\":\"country\"}");
"\"stateProvince\":\"stateProvince\",\"country\":\"country\",\"postalCode\":\"postalCode\"}");

addToParametersIfNotEmpty(parameters,"category", "create.customer");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void setUp() throws Exception {
openMRSPersonAttributes.add(attr2);
openMRSPersonAttributes.add(attr3);
openMRSPersonAddress = new OpenMRSPersonAddress("address1", "address2", "address3", "cityVillage",
"countyDistrict", "stateProvince", "country");
"countyDistrict", "stateProvince", "country", "postalCode");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"cityVillage": "cityVillage",
"stateProvince": "stateProvince",
"country": "country",
"postalCode": null,
"postalCode": "postalCode",
"countyDistrict": "countyDistrict",
"address3": "address3",
"address4": null,
Expand Down

0 comments on commit a38a4a1

Please sign in to comment.