-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fetch user practitioner role during login
- Add PractitionerRole and Practitioner models - Fetch practitioners and practitioner roles to map the current user practitioner-role - Save the current user practitioner-role-code in preferences Fixes tasks in opensrp/opensrp-client-goldsmith#80
- Loading branch information
Showing
5 changed files
with
280 additions
and
0 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
opensrp-app/src/main/java/org/smartregister/domain/Practitioner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package org.smartregister.domain; | ||
|
||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* Created by Ephraim Kigamba - [email protected] on 01-03-2021. | ||
*/ | ||
public class Practitioner implements Serializable { | ||
|
||
private static final long serialVersionUID = -8367551045898354954L; | ||
|
||
private String identifier; | ||
|
||
private Boolean active; | ||
|
||
private String name; | ||
|
||
private String userId; | ||
|
||
private String username; | ||
|
||
public String getIdentifier() { | ||
return identifier; | ||
} | ||
|
||
public void setIdentifier(String identifier) { | ||
this.identifier = identifier; | ||
} | ||
|
||
public Boolean getActive() { | ||
return active; | ||
} | ||
|
||
public void setActive(Boolean active) { | ||
this.active = active; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getUserId() { | ||
return userId; | ||
} | ||
|
||
public void setUserId(String userId) { | ||
this.userId = userId; | ||
} | ||
|
||
public String getUsername() { | ||
return username; | ||
} | ||
|
||
public void setUsername(String username) { | ||
this.username = username; | ||
} | ||
|
||
} |
70 changes: 70 additions & 0 deletions
70
opensrp-app/src/main/java/org/smartregister/domain/PractitionerRole.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
package org.smartregister.domain; | ||
|
||
import java.io.Serializable; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* Created by Ephraim Kigamba - [email protected] on 01-03-2021. | ||
*/ | ||
public class PractitionerRole implements Serializable { | ||
|
||
private static final long serialVersionUID = -2472589757270251270L; | ||
@JsonProperty | ||
private String identifier; | ||
|
||
@JsonProperty | ||
private Boolean active; | ||
|
||
@JsonProperty | ||
@SerializedName("organization") | ||
private String organizationIdentifier; | ||
|
||
@JsonProperty | ||
@SerializedName("practitioner") | ||
private String practitionerIdentifier; | ||
|
||
@JsonProperty | ||
private PractitionerRoleCode code; | ||
|
||
public String getIdentifier() { | ||
return identifier; | ||
} | ||
|
||
public void setIdentifier(String identifier) { | ||
this.identifier = identifier; | ||
} | ||
|
||
public Boolean getActive() { | ||
return active; | ||
} | ||
|
||
public void setActive(Boolean active) { | ||
this.active = active; | ||
} | ||
|
||
public String getOrganizationIdentifier() { | ||
return organizationIdentifier; | ||
} | ||
|
||
public void setOrganizationIdentifier(String organizationIdentifier) { | ||
this.organizationIdentifier = organizationIdentifier; | ||
} | ||
|
||
public String getPractitionerIdentifier() { | ||
return practitionerIdentifier; | ||
} | ||
|
||
public void setPractitionerIdentifier(String practitionerIdentifier) { | ||
this.practitionerIdentifier = practitionerIdentifier; | ||
} | ||
|
||
public PractitionerRoleCode getCode() { | ||
return code; | ||
} | ||
|
||
public void setCode(PractitionerRoleCode code) { | ||
this.code = code; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
opensrp-app/src/main/java/org/smartregister/domain/PractitionerRoleCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.smartregister.domain; | ||
|
||
import java.io.Serializable; | ||
|
||
/** | ||
* Created by Ephraim Kigamba - [email protected] on 01-03-2021. | ||
*/ | ||
|
||
public class PractitionerRoleCode implements Serializable { | ||
|
||
private static final long serialVersionUID = 5814439241291810987L; | ||
private String text; | ||
|
||
public String getText() { | ||
return text; | ||
} | ||
|
||
public void setText(String text) { | ||
this.text = text; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters