Populating OrderRequestItem with Inventory
An OrderRequestItem
usually starts with a system inventory (i.e. accession). It is then up to the user to decide which physical Inventory
of the same accession
will be used as the actual source inventory to fulfill the request for material. In 80% of the cases, the inventory with isDistributable == true
will be used.
Please implement a new endpoint that will automatically assign the first inventory that matches the criteria below to selected OrderRequestItems
:
isDistributable == true
quantityOnHand >= distributionCriticalAmount
In case that there is no matching inventory, then set the orderRequestItem.inventory
to the system inventory.
Note: The endpoint must only inspect OrderRequestItems
with status == NEW
!
API endpoint signature: /api/v1/order/items/{id}/use-default
as List<OrderRequestItem> OrderRequestItemsController#useDefault(@PathVariable("id") final Long orderId, @RequestBody(required = true) final Long[] orderRequestItemIds)
.