-
Notifications
You must be signed in to change notification settings - Fork 353
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
feat: Create note endpoints in tracker [DHIS2-17579] #19430
base: master
Are you sure you want to change the base?
Conversation
4b15329
to
ef136c7
Compare
...his-service-tracker/src/main/java/org/hisp/dhis/tracker/imports/note/DefaultNoteService.java
Fixed
Show fixed
Hide fixed
...his-service-tracker/src/main/java/org/hisp/dhis/tracker/imports/note/DefaultNoteService.java
Fixed
Show fixed
Hide fixed
ef136c7
to
916e9ab
Compare
c5f710d
to
8906a9f
Compare
8906a9f
to
14ddac9
Compare
...dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/note/hibernate/Note.hbm.xml
Show resolved
Hide resolved
...ces/dhis-service-tracker/src/main/java/org/hisp/dhis/tracker/imports/note/JdbcNoteStore.java
Outdated
Show resolved
Hide resolved
@enricocolasante, just for me to understand, why don't we use the importer to create notes as we do for other tracker objects? |
We agreed with frontend that would make sense to have an easier way for them to create a single note. |
@@ -132,7 +132,6 @@ class JdbcEventStore { | |||
n.created as note_created,\ | |||
n.creator as note_creator,\ | |||
n.uid as note_uid,\ | |||
n.lastupdated as note_lastupdated,\ |
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.
Are notes immutable? Is that why this is done?
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.
Yes, they are immutable
.../main/resources/org/hisp/dhis/db/migration/2.42/V2_42_34__Create_sequence_for_note_table.sql
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
Added endpoint to create a
note
forenrollments
andevents
:POST tracker/enrollments/{uid}/note
POST tracker/events/{uid}/note
A new service and a new store using JDBC are created.
The validation applied are:
value
for thenote
is not emptynote
with the sameuid
does not already existInconsistency between the 2 endpoints
To check that the event/enrollment exists and that the user has all the right permissions we are using services (
EnrollmentService.getEnrollment(uid)
andEventService.getEvent(uid)
) but they do behave differently when an entity without the right permission is accessed:EnrollmentService
throws a 403EventService
throws a 404This is part of a biggest discussion and it will not be fixed here