-
Notifications
You must be signed in to change notification settings - Fork 354
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
chore: Clean up tracker domain objects [DHIS2-18222] #18857
Conversation
maybe to clarify: our view models are fairly new and are used as the types for import/export. The view models originated from the domain models. We likely forgot to delete those domain model fields when we created the view models. |
@@ -96,10 +86,6 @@ public class Event implements TrackerDto, Serializable { | |||
|
|||
@JsonProperty private User assignedUser; |
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.
Can users set completedBy/At
?
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.
I asked this myself and then forgot to go forward with that.
The completedBy
in my head shouldn't be set by the user, you shouldn't be able to do stuff on behalf of others.
The createdAt
could be something that the user needs to set. I asked @vgarciabnz how it is expected to work when Android is synching.
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.
I had a chat with Victor another with Ameen and Joakim. completedAt
could be set by the user so I will put it back for Enrollment
and leave it as it is for Event
.
I am going to do it in next PR though
@@ -174,7 +174,7 @@ void testGetJobRunErrors_ListIncludeInput() throws InterruptedException { | |||
// language=JSON | |||
String expected = | |||
""" | |||
{"trackedEntities":[{"trackedEntity":"sHH8mh1Fn0z","trackedEntityType":{"idScheme":"UID","identifier":"nEenWmSyUEp"},"orgUnit":{"idScheme":"UID","identifier":"DiszpKrYNg7"},"inactive":false,"deleted":false,"potentialDuplicate":false,"relationships":[],"attributes":[],"enrollments":[]}],"enrollments":[],"events":[],"relationships":[]}"""; |
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.
Does this change affect jobs? If so should we add a migration to remove unnecessary data? Or would such jobs be removed after a while anyway
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.
I never know 😬
@jbee Can you help us here?
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.
Tracker import jobs are removed a day after they have been running. I am not quite sure what changed with regards to the job but I think you removed something which should be fine. If the job was stored with more parameter data than it later executes this still works.
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.
Thanks @jbee .
Quality Gate passedIssues Measures |
This PR is removing all fields that are not used in tracker importer. Most of them they were there because our view model, that in the web layer is mapped to tracker model, is used for input and output and contains read-only fields that are not necessary in tracker importer.
In particular:
deleted
flag cannot be modified and importer is only dealing with not deleted objects.Next steps
DataValue
fields are going to be removed in https://dhis2.atlassian.net/browse/DHIS2-18223