Skip to content

Conversation

@emathew5
Copy link
Collaborator

@emathew5 emathew5 commented Jan 27, 2026

Closes Issue 1606, 1609

New Endpoints

  • GET /review/org/:identifier/reviews — Paginated review history for an org; supports optional query params: include_conversations and page
  • PUT /review/org/:uuid/reject — Reject a review object (sets status to rejected)

Modified Endpoints

  • GET /review/orgs — Added pagination, supports optional query params: status (I did not validate the incoming options for this var but it is expecting "pending, "approved", or "rejected") and page
  • GET /review/org/:identifier — Now explicitly returns only PENDING review objects (error message clarified)
  • PUT /review/org/:uuid/approve — Saves the review object as 'approved' instead of deleting the review object

Logic Changes

  • Review objects are now persisted — Approved/rejected reviews keep status field instead of being deleted
  • Queries filter by status: 'pending' — getOrgReviewObjectByOrgShortname/ByOrgUUID only return pending reviews
  • Secretariat "stomp" handling — When secretariat updates an org directly, pending review is auto-approved (if changes match) or auto-rejected (if different)
  • Joint approval field check — Review objects only created when joint approval fields actually change (not on every update)
  • Review objects now have a Many to One relationship between ReviewUUIDs and target_object_uuids. (Since review objects can have the same target_object_uuid, we now sort by the last created review when querying the reviews)

Additional change:

  • Before: Repository method approveReviewOrgObject internally called updateOrgFull and deleted the review object
  • After: Controller calls approveReviewOrgObject (sets status='approved') and updateOrgFull separately within a transaction
    This allows reuse of approveReviewOrgObject in other contexts (e.g., secretariat stomp) without triggering org updates. (OR else, I would need to modify updateOrgFull's parameters to restrict circular logic)

Questions:

  • Are the new query parameters okay?
  • And does pagination work as expected
  • Are the changes to the GET endpoints (ex: returning only pending) acceptable

To-do: add unit and integration tests

…ionality; update review object queries to get PENDING objects
…or pending reviews, add more query parameters, add pagination support for review object retrieval, and improve error handling in middleware.
…bject exists with other values, reject the review object
@emathew5 emathew5 marked this pull request as draft January 27, 2026 17:43
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