-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into DHIS2-16246_2.41
- Loading branch information
Showing
58 changed files
with
1,166 additions
and
1,063 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,15 +25,15 @@ | |
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*/ | ||
package org.hisp.dhis.audit.payloads; | ||
package org.hisp.dhis.trackedentity; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; | ||
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement; | ||
import java.io.Serializable; | ||
import java.util.Date; | ||
import java.util.Objects; | ||
import org.hisp.dhis.common.AuditType; | ||
import org.hisp.dhis.changelog.ChangeLogType; | ||
import org.hisp.dhis.common.DxfNamespaces; | ||
|
||
/** | ||
|
@@ -42,7 +42,7 @@ | |
* @author Abyot Asalefew Gizaw [email protected] | ||
*/ | ||
@JacksonXmlRootElement(localName = "trackedEntityInstanceAudit", namespace = DxfNamespaces.DXF_2_0) | ||
public class TrackedEntityAudit implements Serializable { | ||
public class TrackedEntityChangeLog implements Serializable { | ||
private static final long serialVersionUID = 4260110537887403524L; | ||
|
||
private long id; | ||
|
@@ -55,24 +55,28 @@ public class TrackedEntityAudit implements Serializable { | |
|
||
private String accessedBy; | ||
|
||
private AuditType auditType; | ||
private ChangeLogType auditType; | ||
|
||
// ------------------------------------------------------------------------- | ||
// Constructors | ||
// ------------------------------------------------------------------------- | ||
|
||
public TrackedEntityAudit() {} | ||
public TrackedEntityChangeLog() {} | ||
|
||
public TrackedEntityAudit(String trackedEntity, String accessedBy, AuditType auditType) { | ||
public TrackedEntityChangeLog(String trackedEntity, String accessedBy, ChangeLogType auditType) { | ||
this.trackedEntity = trackedEntity; | ||
this.accessedBy = accessedBy; | ||
this.created = new Date(); | ||
this.auditType = auditType; | ||
} | ||
|
||
public TrackedEntityAudit( | ||
String trackedEntity, String comment, Date created, String accessedBy, AuditType auditType) { | ||
this(trackedEntity, accessedBy, auditType); | ||
public TrackedEntityChangeLog( | ||
String trackedEntity, | ||
String comment, | ||
Date created, | ||
String accessedBy, | ||
ChangeLogType changeLogType) { | ||
this(trackedEntity, accessedBy, changeLogType); | ||
this.comment = comment; | ||
this.created = created; | ||
} | ||
|
@@ -92,7 +96,7 @@ public boolean equals(Object obj) { | |
return false; | ||
} | ||
|
||
final TrackedEntityAudit other = (TrackedEntityAudit) obj; | ||
final TrackedEntityChangeLog other = (TrackedEntityChangeLog) obj; | ||
|
||
return Objects.equals(this.trackedEntity, other.trackedEntity) | ||
&& Objects.equals(this.comment, other.comment) | ||
|
@@ -155,11 +159,11 @@ public void setAccessedBy(String accessedBy) { | |
|
||
@JsonProperty | ||
@JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0) | ||
public AuditType getAuditType() { | ||
public ChangeLogType getAuditType() { | ||
return auditType; | ||
} | ||
|
||
public void setAuditType(AuditType auditType) { | ||
public void setAuditType(ChangeLogType auditType) { | ||
this.auditType = auditType; | ||
} | ||
} |
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 |
---|---|---|
|
@@ -32,20 +32,20 @@ | |
import java.util.List; | ||
import lombok.Data; | ||
import lombok.experimental.Accessors; | ||
import org.hisp.dhis.common.AuditType; | ||
import org.hisp.dhis.changelog.ChangeLogType; | ||
import org.hisp.dhis.common.Pager; | ||
|
||
/** | ||
* @author Abyot Asalefew Gizaw [email protected] | ||
*/ | ||
@Data | ||
@Accessors(chain = true) | ||
public class TrackedEntityAuditQueryParams { | ||
public class TrackedEntityChangeLogQueryParams { | ||
private List<String> trackedEntities = new ArrayList<>(); | ||
|
||
private List<String> users = new ArrayList<>(); | ||
|
||
private List<AuditType> auditTypes = new ArrayList<>(); | ||
private List<ChangeLogType> auditTypes = new ArrayList<>(); | ||
|
||
private Date startDate = null; | ||
|
||
|
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 |
---|---|---|
|
@@ -28,45 +28,37 @@ | |
package org.hisp.dhis.trackedentity; | ||
|
||
import java.util.List; | ||
import org.hisp.dhis.audit.payloads.TrackedEntityAudit; | ||
|
||
/** | ||
* @author Abyot Asalefew Gizaw [email protected] | ||
*/ | ||
public interface TrackedEntityAuditService { | ||
public interface TrackedEntityChangeLogService { | ||
|
||
String ID = TrackedEntityAuditService.class.getName(); | ||
String ID = TrackedEntityChangeLogService.class.getName(); | ||
|
||
/** | ||
* Adds tracked entity audit | ||
* | ||
* @param trackedEntityAudit the audit to add | ||
* @param trackedEntityChangeLog the audit to add | ||
*/ | ||
void addTrackedEntityAudit(TrackedEntityAudit trackedEntityAudit); | ||
void addTrackedEntityChangeLog(TrackedEntityChangeLog trackedEntityChangeLog); | ||
|
||
/** Adds multiple tracked entity audit */ | ||
void addTrackedEntityAudit(List<TrackedEntityAudit> trackedEntityAudits); | ||
|
||
/** | ||
* Deletes tracked entity audit for the given tracked entity | ||
* | ||
* @param trackedEntity the tracked entity | ||
*/ | ||
void deleteTrackedEntityAudit(TrackedEntity trackedEntity); | ||
void addTrackedEntityChangeLog(List<TrackedEntityChangeLog> trackedEntityChangeLogs); | ||
|
||
/** | ||
* Returns tracked entity audits matching query params | ||
* | ||
* @param params tracked entity audit query params | ||
* @return matching TrackedEntityAudits | ||
*/ | ||
List<TrackedEntityAudit> getTrackedEntityAudits(TrackedEntityAuditQueryParams params); | ||
List<TrackedEntityChangeLog> getTrackedEntityChangeLogs(TrackedEntityChangeLogQueryParams params); | ||
|
||
/** | ||
* Returns count of tracked entity audits matching query params | ||
* | ||
* @param params tracked entity audit query params | ||
* @return count of TrackedEntityAudits | ||
*/ | ||
int getTrackedEntityAuditsCount(TrackedEntityAuditQueryParams params); | ||
int getTrackedEntityChangeLogsCount(TrackedEntityChangeLogQueryParams params); | ||
} |
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 |
---|---|---|
|
@@ -28,48 +28,40 @@ | |
package org.hisp.dhis.trackedentity; | ||
|
||
import java.util.List; | ||
import org.hisp.dhis.audit.payloads.TrackedEntityAudit; | ||
|
||
/** | ||
* @author Abyot Asalefew Gizaw [email protected] | ||
*/ | ||
public interface TrackedEntityAuditStore { | ||
String ID = TrackedEntityAuditStore.class.getName(); | ||
public interface TrackedEntityChangeLogStore { | ||
String ID = TrackedEntityChangeLogStore.class.getName(); | ||
|
||
/** | ||
* Adds the given tracked entity audit. | ||
* | ||
* @param trackedEntityAudit the {@link TrackedEntityAudit} to add. | ||
* @param trackedEntityChangeLog the {@link TrackedEntityChangeLog} to add. | ||
*/ | ||
void addTrackedEntityAudit(TrackedEntityAudit trackedEntityAudit); | ||
void addTrackedEntityChangeLog(TrackedEntityChangeLog trackedEntityChangeLog); | ||
|
||
/** | ||
* Adds the given {@link TrackedEntityAudit}s. | ||
* Adds the given {@link TrackedEntityChangeLog}s. | ||
* | ||
* @param trackedEntityAudit the list of {@link TrackedEntityAudit}. | ||
* @param trackedEntityChangeLog the list of {@link TrackedEntityChangeLog}. | ||
*/ | ||
void addTrackedEntityAudit(List<TrackedEntityAudit> trackedEntityAudit); | ||
|
||
/** | ||
* Deletes tracked entity audit for the given tracked entity. | ||
* | ||
* @param trackedEntity the {@link TrackedEntity}. | ||
*/ | ||
void deleteTrackedEntityAudit(TrackedEntity trackedEntity); | ||
void addTrackedEntityChangeLog(List<TrackedEntityChangeLog> trackedEntityChangeLog); | ||
|
||
/** | ||
* Returns tracked entity audits matching query params | ||
* | ||
* @param params tracked entity audit query params | ||
* @return a list of {@link TrackedEntityAudit}. | ||
* @return a list of {@link TrackedEntityChangeLog}. | ||
*/ | ||
List<TrackedEntityAudit> getTrackedEntityAudits(TrackedEntityAuditQueryParams params); | ||
List<TrackedEntityChangeLog> getTrackedEntityChangeLogs(TrackedEntityChangeLogQueryParams params); | ||
|
||
/** | ||
* Returns count of tracked entity audits matching query params | ||
* | ||
* @param params tracked entity audit query params | ||
* @return count of audits. | ||
*/ | ||
int getTrackedEntityAuditsCount(TrackedEntityAuditQueryParams params); | ||
int getTrackedEntityChangeLogsCount(TrackedEntityChangeLogQueryParams params); | ||
} |
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
Oops, something went wrong.