Reorder Item Records

Reorder Item Records

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:

Documentation

Notes on the order field

  • API

    • The order field 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 sequence

    • The order field only supports whole numbers; if a decimal is included, it will be converted to a whole number

    • Via the API, there is currently no deduplication

  • RTAC

    • Value sent in itemDisplayOrder field 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.

image-20250827-125127.png

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

  1. Verify existing items for a holdings record

    1. 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

  2. Create new item

    1. An item can be created via a POST request to the /item-storage/items endpoint

    2. 19a5c0ea-e4d6-4b8f-823b-3793ee9bdc83.png
      Example request
    3. If the order is not included, upon create, the order field will be populated with the next number in the sequence

  3. Update existing sort order

    1. An item can be updated via a PUT request to the /item-storage/items/{itemId} endpoint

    2. image-20250827-124209.png
      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.

image-20250917-122113.png
Example request