-
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
chore: use EnrollmentService in TE service to get enrollements/events DHIS2-18541 #19723
base: master
Are you sure you want to change the base?
Conversation
eaf76a3
to
c69131d
Compare
to get enrollments on /trackedEntities/{uid}?fields=enrollment chore: wire ids and uids through chore: use enrollment service in TE aggregate
as these are fetched by the EN service
a300de2
to
6aa9c8a
Compare
...rvices/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/EnrollmentMapper.java
Fixed
Show fixed
Hide fixed
...is-services/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/EventMapper.java
Fixed
Show fixed
Hide fixed
...ces/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/export/TrackedEntityMapper.java
Fixed
Show fixed
Hide fixed
Quality Gate failedFailed conditions See analysis details on SonarQube Cloud Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE |
@Mapping(target = "createdByUserInfo") | ||
@Mapping(target = "lastUpdatedByUserInfo") | ||
@Mapping(target = "status") | ||
Enrollment map(Enrollment enrollment); |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
PreheatMapper.map
@Mapping(target = "createdByUserInfo") | ||
@Mapping(target = "lastUpdatedByUserInfo") | ||
@Mapping(target = "geometry") | ||
Event map(Event event); |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
PreheatMapper.map
@Mapping(target = "deleted") | ||
@Mapping(target = "createdByUserInfo") | ||
@Mapping(target = "lastUpdatedByUserInfo") | ||
TrackedEntity map(TrackedEntity trackedEntity); |
Check notice
Code scanning / CodeQL
Missing Override annotation Note
EnrollmentService
in TE aggregate to fetch enrollments and events as well as to serve/trackedEntities/uid
.JdbcEventStore
. This is needed anyway but here its used to eagerly fetch the entities we need later on when there is no hibernate session available. SeeArchitecture challenges
for more.TrackedEntityIdentifiers
pair from the TE store. This is needed for now so we can pass the TE uids to the enrollment service in the enrollment aggregate. All other aggregate code uses the primary key id. We might be able to untangle the TE aggregate later on.Next
Architecture challenges
Our goal was that every service of an entity depends on its childs service to fetch such nested entities. This assumes an acyclic graph TE -> EN -> EV. This neglects the fact that relationships can add cycles. This is an example graph where relationships add edges causing cycles
We cannot have cycles in our code as Spring would not know how to resolve them unless we resort to some hacks.
This was already true. Up to now it was solved by hibernate fetching relationships. Even in services/stores that use JDBC like hibernate was ultimately responsible for getting relationships
We are going to stick with hibernate being responsible for fetching relationships. The target architecture will be
This will mean that there is one place that is also responsible for ACL of relationships
(trackerAccessManager.canRead(user, relationship)
. Note that this underneath checks the ACL of TE, EN, EV.