-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add filtering capabilities in events change log [DHIS2-18012] #19268
Conversation
...-tracker/src/main/java/org/hisp/dhis/tracker/export/event/EventChangeLogOperationParams.java
Fixed
Show fixed
Hide fixed
...e-tracker/src/main/java/org/hisp/dhis/tracker/export/event/HibernateEventChangeLogStore.java
Dismissed
Show dismissed
Hide dismissed
@@ -40,20 +42,30 @@ | |||
public class EventChangeLogOperationParams { | |||
|
|||
private Order order; | |||
private Map.Entry<String, QueryFilter> filterEntry; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it makes sense to make this field a Pair
?
Right now I don't understand why we have a Map.Entry
here but in the builder we have a filterMap
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I just didn't want to use an external library, but I agree conceptually probably makes more sense to use Pair
instead of Map.Entry
.
...api/src/main/java/org/hisp/dhis/webapi/controller/tracker/export/RequestParamsValidator.java
Outdated
Show resolved
Hide resolved
...e-tracker/src/main/java/org/hisp/dhis/tracker/export/event/HibernateEventChangeLogStore.java
Outdated
Show resolved
Hide resolved
...-tracker/src/main/java/org/hisp/dhis/tracker/export/event/EventChangeLogOperationParams.java
Fixed
Show fixed
Hide fixed
private EventChangeLogOperationParamsBuilder order(Order order) { | ||
return this; | ||
} | ||
|
||
private EventChangeLogOperationParamsBuilder filterMap(Pair<String, QueryFilter> filterMap) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private EventChangeLogOperationParamsBuilder filterMap(Pair<String, QueryFilter> filterMap) { | |
private EventChangeLogOperationParamsBuilder filter(Pair<String, QueryFilter> filter) { |
Quality Gate passedIssues Measures |
This PR introduces filtering for change logs. These filters differ slightly from the ones we currently use:
Another key difference is that while our current filters are UID based, these new filters are string based.
Although the only supported operator is
eq
, I’ve retained the filter format [field]:[operator]:[filter] used in other endpoints. This way, if we need to support additional operators in the future, it won’t require a breaking change.validateFilter(String, Set<String>)
is used only for event change logs, but it will be used for attributes as soon as we refactor those change logs, that's why I added it toRequestParamsValidator
Note: ACL validation for data elements is not yet implemented. I will address this in a separate ticket once we decide how data sharing validation on data elements should be handled.