Ticket #138 (assigned task)
Implement study quality criteria for publication
|Reported by:||business@…||Owned by:||business@…|
Description (last modified by business@…) (diff)
A study should only be published if it meets certain criteria:
- It should have no orphan samples (all samples should have a parent subject and parent sampling event)
- It should have at least 1 event?
- Further requirements, TODO now for Jildau to define these
Implement tests for this functionality (such as SampleTests?.testStudyPublish for the first criterium), and then implement this functionality in Study.constraints as a custom validator for the 'published' field. If validation fails, a clear error message should be returned stating which criteria were not met and for how many entities that was the case.