From 5275ff0862937beed4cc6888d76e858355023cd9 Mon Sep 17 00:00:00 2001 From: Allan O Date: Wed, 15 Dec 2021 16:44:42 +0300 Subject: [PATCH 1/4] :construction: Add Practitioner server vn & date created+edited --- .../smartregister/domain/Practitioner.java | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/smartregister/domain/Practitioner.java b/src/main/java/org/smartregister/domain/Practitioner.java index 847cffd..6c0f2ce 100644 --- a/src/main/java/org/smartregister/domain/Practitioner.java +++ b/src/main/java/org/smartregister/domain/Practitioner.java @@ -1,6 +1,8 @@ package org.smartregister.domain; +import org.joda.time.DateTime; + import java.io.Serializable; /** @@ -20,6 +22,12 @@ public class Practitioner implements Serializable { private String username; + private DateTime dateCreated; + + private DateTime dateEdited; + + private long serverVersion; + public String getIdentifier() { return identifier; } @@ -60,4 +68,27 @@ public void setUsername(String username) { this.username = username; } -} \ No newline at end of file + public DateTime getDateCreated() { + return dateCreated; + } + + public void setDateCreated(DateTime dateCreated) { + this.dateCreated = dateCreated; + } + + public DateTime getDateEdited() { + return dateEdited; + } + + public void setDateEdited(DateTime dateEdited) { + this.dateEdited = dateEdited; + } + + public long getServerVersion() { + return serverVersion; + } + + public void setServerVersion(long serverVersion) { + this.serverVersion = serverVersion; + } +} From 180435500fb3f77923d63294345d0d4ac06ac2d9 Mon Sep 17 00:00:00 2001 From: Allan O Date: Wed, 15 Dec 2021 16:45:12 +0300 Subject: [PATCH 2/4] :white_check_mark: Update PractitionerTest --- .../domain/PractitionerTest.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/src/test/java/org/smartregister/domain/PractitionerTest.java b/src/test/java/org/smartregister/domain/PractitionerTest.java index 573238e..60a04ed 100644 --- a/src/test/java/org/smartregister/domain/PractitionerTest.java +++ b/src/test/java/org/smartregister/domain/PractitionerTest.java @@ -1,6 +1,7 @@ package org.smartregister.domain; import junit.framework.TestCase; +import org.joda.time.DateTime; import org.junit.Assert; public class PractitionerTest extends TestCase { @@ -83,4 +84,46 @@ public void testSetUsername() { Assert.assertEquals(username, practitioner.getUsername()); } + + public void testSetDateCreated() { + DateTime dateCreated = new DateTime(); + practitioner.setDateCreated(dateCreated); + + Assert.assertEquals(dateCreated, practitioner.getDateCreated()); + } + + public void testGetDateCreated() { + DateTime dateCreated = new DateTime(); + practitioner.setDateCreated(dateCreated); + + Assert.assertEquals(dateCreated, practitioner.getDateCreated()); + } + + public void testSetDateEdited() { + DateTime dateCreated = new DateTime(); + practitioner.setDateEdited(dateCreated); + + Assert.assertEquals(dateCreated, practitioner.getDateEdited()); + } + + public void testGetDateEdited() { + DateTime dateCreated = new DateTime(); + practitioner.setDateEdited(dateCreated); + + Assert.assertEquals(dateCreated, practitioner.getDateEdited()); + } + + public void testSetServerVersion() { + long serverVersion = 1; + practitioner.setServerVersion(serverVersion); + + Assert.assertEquals(serverVersion, practitioner.getServerVersion()); + } + + public void testGetServerVersion() { + long serverVersion = 2; + practitioner.setServerVersion(serverVersion); + + Assert.assertEquals(serverVersion, practitioner.getServerVersion()); + } } From d8fb990d48807c865d5a031b2e728ba6798d4bbc Mon Sep 17 00:00:00 2001 From: Allan O Date: Wed, 15 Dec 2021 16:45:31 +0300 Subject: [PATCH 3/4] :camera_flash: Update snapshot version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9e4da9f..0b48783 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ opensrp-plan-evaluator jar - 1.6.5-SNAPSHOT + 1.6.6-SNAPSHOT OpenSRP Plan Evaluator OpenSRP Plan Evaluator Library https://github.com/OpenSRP/opensrp-plan-evaluator From a928ed2681f20eab60dfc77ed4a0a0c30aa5bbab Mon Sep 17 00:00:00 2001 From: Allan O Date: Fri, 17 Dec 2021 11:47:55 +0300 Subject: [PATCH 4/4] :camera_flash: Update snapshot version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a33a0b5..447eb88 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ opensrp-plan-evaluator jar - 1.6.6-SNAPSHOT + 1.6.7-SNAPSHOT OpenSRP Plan Evaluator OpenSRP Plan Evaluator Library https://github.com/OpenSRP/opensrp-plan-evaluator