Skip to content
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

fix: use tracker importer in TrackerEventSMSListener DHIS2-17729 #18522

Merged
merged 2 commits into from
Sep 6, 2024

Conversation

teleivo
Copy link
Contributor

@teleivo teleivo commented Sep 4, 2024

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).

  • use the tracker importer
    • EventTrackerConverterService sets completedBy/Date when an event status transitions to COMPLETED
    • no need to look up metadata as this is done by the importer
    • no need to look up whether the event is new/exists as this is done by the importer
  • add a test for creating and for updating an event
  • fix error message OccurredAt should be the field occurredAt
  • fix message formatter: the error No event can transition from status 'ACTIVE' to status 'OVERDUE'. was No event can transition from status '' to status ''. before. Not sure why we defaulted to "" instead of Object.toString() 🤔

Questions

  • The geometry sent via sms is always a point. This is limited by the sms-compression library. The program/programStage can have different FeatureTypes. I assume the sms is rejected if the metadata feature type is misconfigured.
  • The sms-compression does not allow not setting the events uid. I cannot encode such an sms. So I don't get why there is logic regarding getting or not getting a UID 🤷🏻. See this which throws an NPE if I do not provide an id.

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 SMS

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

@teleivo teleivo force-pushed the DHIS2-17729-TrackerEventSMSListener branch from a6ec946 to b998c64 Compare September 4, 2024 13:21
@teleivo teleivo changed the title fix: use tracker importer in EventSavingSMSListener DHIS2-17729 fix: use tracker importer in TrackerEventSMSListener DHIS2-17729 Sep 4, 2024
@teleivo teleivo force-pushed the DHIS2-17729-TrackerEventSMSListener branch 7 times, most recently from 68d5306 to ccfffec Compare September 5, 2024 07:01
@teleivo teleivo marked this pull request as ready for review September 5, 2024 07:04
@teleivo teleivo requested review from enricocolasante and a team September 5, 2024 07:04
@teleivo teleivo force-pushed the DHIS2-17729-TrackerEventSMSListener branch from ccfffec to c57a80f Compare September 5, 2024 09:15
Copy link

sonarcloud bot commented Sep 5, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants