Skip to content

Commit

Permalink
#182: Added field: locality to location fragment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Flava177 committed Nov 22, 2024
1 parent dc0d143 commit 2e82d1b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {

// public static final int DATABASE_VERSION = 307;
//public static final int DATABASE_VERSION = 343;
public static final int DATABASE_VERSION = 404;
public static final int DATABASE_VERSION = 405;

private static DatabaseHelper instance = null;

Expand Down Expand Up @@ -3965,6 +3965,10 @@ public void onUpgrade(SQLiteDatabase db, ConnectionSource connectionSource, int
getDao(PathogenTest.class).executeRaw("ALTER TABLE pathogentest ADD COLUMN laboratoryFinalClassification VARCHAR(255);");
getDao(PathogenTest.class).executeRaw("ALTER TABLE pathogentest ADD COLUMN dateSampleSentRegLab DATE;");

case 404:
currentVersion = 404;
getDao(Location.class).executeRaw("ALTER TABLE location ADD COLUMN locality varchar(255);");


// ATTENTION: break should only be done after last version
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ public class Location extends PseudonymizableAdo {
@Column(length = CHARACTER_LIMIT_DEFAULT)
private String houseNumber;
@Column(length = CHARACTER_LIMIT_DEFAULT)
private String locality;
@Column(length = CHARACTER_LIMIT_DEFAULT)
private String additionalInformation;
@Column
private PersonAddressType addressType;
Expand Down Expand Up @@ -250,6 +252,14 @@ public void setHouseNumber(String houseNumber) {
this.houseNumber = houseNumber;
}

public String getLocality() {
return locality;
}

public void setLocality(String locality) {
this.locality = locality;
}

@Bindable
public String getAdditionalInformation() {
return additionalInformation;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public void fillInnerFromDto(Location target, LocationDto source) {
target.setPseudonymized(source.isPseudonymized());
target.setStreet(source.getStreet());
target.setHouseNumber(source.getHouseNumber());
target.setLocality(source.getLocality());
target.setAdditionalInformation(source.getAdditionalInformation());
target.setAddressType(source.getAddressType());
target.setAddressTypeDetails(source.getAddressTypeDetails());
Expand Down Expand Up @@ -147,6 +148,7 @@ public void fillInnerFromAdo(LocationDto target, Location source) {
target.setPseudonymized(source.isPseudonymized());
target.setStreet(source.getStreet());
target.setHouseNumber(source.getHouseNumber());
target.setLocality(source.getLocality());
target.setAdditionalInformation(source.getAdditionalInformation());
target.setAddressType(source.getAddressType());
target.setAddressTypeDetails(source.getAddressTypeDetails());
Expand Down
5 changes: 5 additions & 0 deletions sormas-app/app/src/main/res/layout/dialog_location_layout.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@
style="@style/ControlSingleColumnStyle"
app:value="@={data.houseNumber}" />

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/location_locality"
style="@style/ControlSingleColumnStyle"
app:value="@={data.locality}" />

<de.symeda.sormas.app.component.controls.ControlTextEditField
android:id="@+id/location_additionalInformation"
style="@style/ControlSingleColumnStyle"
Expand Down

0 comments on commit 2e82d1b

Please sign in to comment.