hmpf / easydmp

MIT License
7 stars 2 forks source link

Partially update an RDA DCS-compatible plan via API #278

Open hmpf opened 1 year ago

hmpf commented 1 year ago

Does not depend on any of the other issues sorting under #273, but the solution will have to be updated to work with multiple RDA DCS-compatible templates if it is finished before the rest of #273.

MVP is to PUT an entire json-blob, storing the values in the existing plan instead of creating a new plan.

It would be better to PATCH a partial RDA DCS to an existing plan in order to update it. If the plan is locked, make a new version, otherwise, update the plan.

The main problem is that RDA DCS depends solely on order for identifying certain subparts, for instance costs.

For any of the subtrees that includes an identifier-subtree, the PATCH must include the identifier.

Another problem is how to remove subtrees.

The ideal solution is probably to expose any subtree as its own endpoint but this would take a lot of work since it goes against the nature of django-rest-framework.