cr-connect-workflow/crc/models
Dan Funk cd7f67ab48 A major refactor of how we search and store files, as there was a lot of confusing bits in here.
From an API point of view you can do the following (and only the following)

/files?workflow_spec_id=x
* You can find all files associated with a workflow_spec_id, and add a file with a workflow_spec_id
/files?workflow_id=x
* You can find all files associated with a workflow_id, and add a file that is directly associated with the workflow
/files?workflow_id=x&form_field_key=y
* You can find all files associated with a form element on a running workflow, and add a new file.
   Note: you can add multiple files to the same form_field_key, IF they have different file names. If the same name, the original file is archived,
   and the new file takes its place.

The study endpoints always return a list of the file metadata associated with the study.  Removed /studies-files, but there is an
endpoint called

/studies/all  - that returns all the studies in the system, and does include their files.

On a deeper level:
 The File model no longer contains:
  - study_id,
  - task_id,
  - form_field_key

Instead, if the file is associated with workflow - then that is the one way it is connected to the study, and we use this relationship to find files for a study.
A file is never associated with a task_id, as these change when the workflow is reloaded.
The form_field_key must match the irb_doc_code, so when requesting files for a form field, we just look up the irb_doc_code.
2020-05-28 08:27:26 -04:00
..
__init__.py Refactor models into seperate directories 2019-12-31 16:32:47 -05:00
api_models.py ldap lookup. 2020-05-19 16:11:43 -04:00
approval.py Merge branch 'feature/support_ui_dashboard' into dev 2020-05-25 21:31:16 -04:00
file.py A major refactor of how we search and store files, as there was a lot of confusing bits in here. 2020-05-28 08:27:26 -04:00
protocol_builder.py Updated the study status to use a different enumeration. Migration correctly handles modifying the enum. 2020-04-21 17:13:30 -04:00
stats.py Refactor the stats models, and assure they are very correct across all tests with the workflow api. 2020-05-04 10:57:09 -04:00
study.py A major refactor of how we search and store files, as there was a lot of confusing bits in here. 2020-05-28 08:27:26 -04:00
user.py Building out the boilerplate code to make pushing forward on this a little friendlier. 2020-05-22 18:25:00 -04:00
workflow.py Made some modifications to the Approval so that it knows exactly what versions of every file are being sent for approval 2020-05-23 15:08:17 -04:00