VEuPathDB / service-dataset-access

Apache License 2.0
0 stars 2 forks source link

new endpoint for automatic access request approval after a number of days #62

Closed aurreco-uga closed 11 months ago

aurreco-uga commented 1 year ago

we will have a cron job executing this new endpoint daily.

There is a new prop in edaDB apidbtuning.datasetproperty: "daysForApproval" X for each study, sometimes it will be empty.

  1. In apidbtuning.datasetproperty you will extract all protected studies (dataset_id) based on prop "studyAccess" = protected. . 2.become user eupathdb@gmail.com 1926010 For each protected study check in acctdb studyaccess.end_user for a pending request: a row where approval_status = 1
  2. if today - "start_date" > X => update approval_status 1-> 0
  3. the patch request writes in studyaccess.end_user_history where we keep track of who made the update: HISTORY_CAUSE_USER.. let 's use eupathdb@gmail.com 1926010
  4. we want to send email to user , providers and us when we do an update. The user email is in acctdb useraccounts.accounts. The providers emails (and ours) are in props: "requestEmail" and "requestEmailBcc".