Viability: Prepare for testing
Add a menu "Prepare order" at /viability/order that displays a Table of inventories that have a pending VIABILITYTEST
action.
The table also includes details from inventory.accession
: taxonomySpecies
, improvementStatusCode
, lifeFormCode
, initialReceivedDate
, statusCode
. (API call listScheduledInventories
at /viability/scheduled)
The user selects items in the table and clicks "Prepare order" action. This opens (a dialog?) a list of selected items where the user can select InventoryViabilityRule
from a dropdown for each Inventory
.
User also selects a recipient Cooperator
and clicks the Create order button. This makes an API call orderViabilityTest
at /viability/order to the server with:
{
"inventories": { "10": 3, "11", 3 },
"site": { "id": site.id },
"cooperator": { "id": viabilityCooperator.id }
}
inventories
is a Map<number, number>
where the key is inventory.id
and value is inventoryViabilityRule.id
.
The Server:
- Creates a new
OrderRequest
withGR
for Germination test and the selectedrecipientCooperator
. - For each selected
Inventory
and itsInventoryViabilityRule
:- a new
InventoryViability
record is registered - a new
OrderRequestItem
with quantity fromInventoryViabilityRule
is registered with theOrderRequest
- a new