MaterialSubRequests for all accessions
In the initiation of request for material, the UI will inform the user that X of Y accessions can be requested via Genesys
. When the number is 0, the user cannot proceed to complete the request, but they can proceed when at least one can be requested through Genesys.
This change request modifies how UI and API handle requests for accessions that cannot be requested:
- On "Request for material" click, the list of all selected accession
ids
is sent to the API and the API returns a newDRAFT
MaterialRequest
withMaterialSubRequests
for different genebanks.- If the user is logged in, API can also initiate a validation against Easy-SMTA and obtain PID and update the request data.
- When the user is anonymous, this is registered as under
Guest
without Easy-SMTA lookup.
- The UI then displays a list of
MaterialSubRequests
and indicates the number of requested accessions for each genebank. User can expand the list to display the list of accessions in each sub request.- If the genebank does not allow for requests via Genesys, the UI displays a message saying "Sorry, XYZ does not allow for initiating requests for material from Genesys. We cannot relay your request directly."
- Otherwise we indicate "XYZ allows initiating requests for material from Genesys"
- If there is at least one
MaterialSubRequest
that can be relayed, then "Continue..." leads the user to provide additional info (same as now) and submit the request for validation- When there are no such requests, "Continue..." is disabled, same as now.
- Upon validation only the subrequests for "allowed" genebanks are relayed, others remain in
DRAFT
state.
This approach allows us to handle sending sub requests to genebanks using different mechanisms, including a POST to the genebank website where the user can fill out any additional forms. It also allows us to capture which genebanks could receive requests if they allowed it.
UI will need a section in the Dashboard with the list of Requests for material the user has already made.
API changes
MaterialRequest
and MaterialSubRequest
need a new DRAFT
state as are created much earlier in the process. MaterialSubRequest
also needs SENT
state.
@ahrybeniuk Let me know what other information you require before starting implementation.