Purpose: Implement endpoint that provides capability of checking-in items
Implement POST /orders/check-in endpoint that provides functionality for checking-in items spanning one or more po_lines in the order according to the attached document. For each piece being checked-in:
Create the item record... if applicable[CAM] For now we're working under the assumption that we won't be creating item records on the backend. The current plan is to try and handle this in the UI via a plugin that uses the ui-inventory item creation form. Whether or not that is feasible will need to be investigated in a spike ( UIOR-156). The contingency plan is to elicit the mandatory information from the user in our own form, supply it to the backend via this check-in endpoint, and create the items in mod-orders.
- Update the item status and barcode.
- Update the piece record: status to "Received", received date to new Date()
Note: in case item status of the record is "On order" in the request, the check-in state should be rolled back i.e.
- the receivingStatus of the piece is changed to "Expected" and receivedDate set to null/removed
- if there is associated item, its status is changed back to "On order"
- Update the PO Line's receipt status. There are only 2 status possible:
- Partially Received: if at least one piece has been checked-in (i.e. with "Received" status)
- Awaiting Receipt: for roll-back case if there is none of the pieces checked-in
- if the calculated status is the same as current one, no update is made.
- acq-models: checkinCollection.json needs to be updated to include for each piece record:
- item Status (required)
- the caption should become optional
- check-in flow is implemented (not including item creation)
- 80%+ test coverage on new code
- API Tests are updated
See API Listing for complete API listing