fix: use tracker importer in TrackerEventSMSListener DHIS2-17729 #18522
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As a reference this is the event saving logic before we made our changes to sms processing. You can see that users were able to create and update an event.
This is how the TrackerEventSmsSubmission sms is encoded. If you navigate further down you can find out which fields are mandatory. Mandatory are (meaning you'll get an NPE if you don't provide them): ids and eventStatus. For data values we also have to provide a category option combo 🤷🏻 (that only affects our tests).
completedBy/Date
when an event status transitions toCOMPLETED
OccurredAt
should be the fieldoccurredAt
No event can transition from status 'ACTIVE' to status 'OVERDUE'.
wasNo event can transition from status '' to status ''.
before. Not sure why we defaulted to""
instead ofObject.toString()
🤔Questions
Next
These are the tracker related compression based SMS we need to adapt so they use the importer:
SubmissionType
=>Listener
class processing these types of SMSDELETE
=>DeleteEventListener
✅ (fix: processing sms and test tracker event deletion DHIS2-17729 #18473)ENROLLMENT
=>EnrollmentSMSListener
RELATIONSHIP
=>RelationshipSMSListener
✅ (fix: use tracker importer in RelationshipSMSListener DHIS2-17729 #18509)SIMPLE_EVENT
=>SimpleEventSMSListener
TRACKER_EVENT
=>TrackerEventSMSListener
✅ (this PR)The above can be used used by Android when users are offline.
Then there are command based SMS listeners we need to adapt so they use the importer:
TRACKED_ENTITY_REGISTRATION_PARSER
=>TrackedEntityRegistrationSMSListener
PROGRAM_STAGE_DATAENTRY_PARSER
=>ProgramStageDataEntrySMSListener
EVENT_REGISTRATION_PARSER
=>SingleEventListener