Skip to content

Subject creation requests

Bengfort requested to merge 2117-subject-draft-api into main

Based on !1973 (closed)

This adds the new SubjectCreationRequest model which can either be converted into a "real" subject or discarded. In accordance with the database split, contact data is stored in a separate ContactCreationRequest model.

Besides "convert to subject" and "discard" you could also imagine a "merge into existing subject" action. I did not add that because it is not clear what would be the "right" way to do it. Right now users cannot even see the recruitment attributes included with the SubjectCreationRequest. Dynamic attributes don't make this any easier.

There is an API to create SubjectCreationRequests:

curl -v 'http://localhost:8000/subjects/draft/create/' -H 'Authorization: token CHANGEME' --data '{"attributes": {"not": "empty"}, "first_name": "foo", "last_name": "bar", "email": "foo@example.com"}'

So far I did not do any special handling for dynamic attributes: The API consumer needs to know about the available attributes. The attribute data is not validated in the API.

Edited by Hayat

Merge request reports