Purpose: Need a Piece Record in Orders Storage linked to PO Line and Item in Inventory to support receiving and check-in process as well as support receiving history.
- One Piece Record needs to be created in Orders Storage per unit of quantity identified in the order line record (in other words, a corresponding piece record should exist for each item record associated with PO line)
- Item records may or may not be created for electronic resources (boolean on the POL). Piece records need to be created regardless.
- See the results of
MODORDSTOR-30for the details on Piece record schema
- Piece records are created when an order transitions to "open" workflow status, along with Instance, Holding and Item records in Inventory (except ongoing orders which are handle differently)
- The ongoing order edge case will be handled in a separate story.
- the UUID of the po_line should be set in the po_line_id field in the piece record.
- the UUID of the item record should be set in the item_id field in the piece record.
Scenarios to handle:
- Create partial pieces for those pieces which are associated with item ids. Check for existing pieces so we are not duplicating them
- For `P/E Mix` order type, create pieces when item exists in the inventory for the corresponding location. Verify pieces are created for physical and electronic resources.
- For `P/E Mix` order type, check for existing pieces before creating new pieces so we are not duplicating them
- unit tests are updated
- api tests are updated
- piece records are created as described above on order placement
See https://docs.google.com/spreadsheets/d/1se-a2owRfHLG5eaAZglx4vLvRClCKGp2wZCfD39ZJRY/edit#gid=121556715 for complete API listing