chore: remove dhis-api EventService.createEvent DHIS2-17677 #17916
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.
follow up after #17873
Big picture
Tracker has multiple services for each entity like tracked entity, enrollment and event. One is in dhis-api and one in dhis-service-tracker. Our goal is to provide one API (service) per entity that is part of the tracker domain/team.
Trackers architecture splits read/write into exporter services and an importer. So if you want to get data you use an exporter. If you want to insert, update or delete you have to go through the importer. Only then can we ensure integrity of tracker data.
Another goal is that code that provides tracker functionality and is thus owned by the tracker team lives in ideally one maven module (We can settle on a name later on maybe
dhis-service-tracker
ordhis-tracker
).This is a big task that we are going to implement in many small steps.
This PR
EventService.createEvent
was only used in tests and thus belongs in a test helper.DhisConvenienceTest
base class already has acreateEvent
that fulfilled most of what the tests relied on.The
programStage.getGeneratedByEnrollmentDate()
was always
false
so the paramenrollmentDate
was never used.Set the default category option combo in the
DhisConvenienceTest
. Storethe event via the
IdentifiableObjectManager
as we do for many other testfixtures created via the
DhisConvenienceTest
methods.