Sage-Bionetworks / sagebio-collaboration-portal

Collaboration Portal developed by Sage Bionetworks
1 stars 0 forks source link

Enable to update provenance record for report/memo attachments #553

Closed tschaffter closed 4 years ago

tschaffter commented 4 years ago

Follows #357 and this comment.

Background: The creation of report/memo with attachment is performed as follows:

  1. The client makes a POST request to the server to create a report/memo object. Upon success, the server returns the object created (with _id).
  2. The client makes a POST request to the server to create the attachment objects (EntityAttachment objects), where each EntityAttachment object contains the _id of the report/memo it is attached to.

Issue: The client is currently taking care of the creation of the provenance record for the creation of the report/memo, while ideally we would like the server to take care of it, thus preventing us to spend effort on direct communication between the client and the provenance service, which otherwise would entail:

So we want to move the creation of the provenance record for new report and memo to the server side. However I believe that there is currently no way to create the provenance record in two steps: 1) create the provenance record for the new report/memo while specifying entitiesUsed = [], and 2) update the provenance record to add used entities (attachments).

The above feature will also enable to update provenance record for report and memo that have their attachments updated?

@jaeddy Can we add to provenance the following two endpoints:

  1. To add an object (or batch of objects at once: less REST oriented but more efficient/faster) to the property entitiesUsed of a memo/report
  2. To remove an object from the property entitiesUsed of a memo/report

Thanks!

tschaffter commented 4 years ago

Done in #593