Reorder Item Records
Feature(s) | |
|---|---|
Release | Trillium |
Document status | in progress |
Contents
Overview
As of the Trillium release, the ability to reorder item records by both API as well as the UI will be supported. This item sort order is supported by a new numeric field, order, in the Item schema which will also be passed via RTAC in the itemDisplayOrder.
There are three potential workflows to populate the item order field:
For initial module upgrade for existing FOLIO items, there will be a migration script to populate the order value based on existing order (barcode) - see https://folio-org.atlassian.net/wiki/spaces/FOLIOtips/pages/edit-v2/1179746307#Initial-module-upgrade
Mapping to the new field:
For those migrating to FOLIO for the first time, mapping can take place to migrate order values from previous systems
For existing FOLIO workflows, values from existing FOLIO fields can be mapped to the new order field
Documentation
UI-specific user documentation: https://folio-org.atlassian.net/wiki/x/QIA-VQ
Solution design: https://folio-org.atlassian.net/wiki/spaces/SPITFIRE/pages/938082365
API documentation: https://dev.folio.org/reference/api/#mod-inventory-storage
Initial module upgrade documentation: In progress, to be added
Notes on the order field
API
The
orderfield is not required in the API request, though it is required in the item schema. If it is not included in the API call, it will be populated by assigning the next numeric value in the sequenceThe
orderfield only supports whole numbers; if a decimal is included, it will be converted to a whole numberVia the API, there is currently no deduplication
RTAC
Value sent in
itemDisplayOrderfield in mod-rtac and edge-rtac response
UI
Permissions
Those with permissions/capabilities to create/edit item records have the ability to update the item sort order. For ECS, permissions are required for the tenant in which the item exists.
Additional capability needed to utilize the PATCH endpoint: data - Inventory-Storage Items Collection - edit
Initial module upgrade
Upon module upgrade, an async migration script must be run to populate the “order” field in the item schema of the existing item records. This process will populate the field by assigning the numeric value of the existing sort order, which by default would be the barcode.
Update item sort order via API
Previously existing endpoints
Verify existing items for a holdings record
The current sorting for items within a holdings record can be verified sending a GET request to the /inventory/items-by-holdings-id endpoint with query holdingsRecordId==<holdings UUID> sortby order/number/sort.ascending
Create new item
An item can be created via a POST request to the /item-storage/items endpoint
- Example request
If the
orderis not included, upon create, theorderfield will be populated with the next number in the sequence
Update existing sort order
An item can be updated via a PUT request to the /item-storage/items/{itemId} endpoint
- Example request
New batch API
New as of this implementation, multiple items can be updated in a single PATCH request to the /item-storage/items endpoint.