Support selecting dataset sets on dataset processes
https://redmine.teklia.com/issues/5766
A new sets
attribute should be added to the ProcessDataset
M2M to allow users to specify one or more sets within a dataset that should be used in a dataset process. This should be an array, just like Dataset.sets
.
A data migration should make all the existing ProcessDataset
instances use all of the sets of the datasets, since we currently use all of the sets all of the time.
ListProcessDatasets
must be updated to no longer just return the Dataset
but the ProcessDataset
: {"dataset": { ... }, "sets": [...]}
. This will affect the frontend and base-worker, but Yoann told me not to care about it.
CreateProcessDataset
must accept an optional sets
attribute. When it isn't set, it defaults to all of the dataset's sets. It must validate that the sets belong to Dataset.sets
.
Two new endpoints must be added, UpdateProcessDataset
and PartialUpdateProcessDataset
, to allow editing only the sets
attribute. The same validation should also apply.
Nice to have: [Partial]UpdateDataset
should either prevent renaming or removing a set when there are ProcessDataset
rows that use that set, or automatically update the ProcessDataset
to match the changes.