Page tree
Skip to end of metadata
Go to start of metadata

CIRC-436 - Getting issue details... STATUS

The goal of the spike is to define the necessary steps to introduce Request Preferences per User in mod-circulation.

Spike results:

1. Storing request preferences in mod-circulation-storage:

We will add table user_request_preferences to mod-circulation-storage. user_request_preferences will store user preference fields in json format. 

Table definition in mod-circulation-storage:


user_request_preferences
{
  "tableName": "user_request_preferences",
  "withMetadata": true,
  "withAuditing": false,
  "uniqueIndex": [
    {
      "fieldName": "userId",
      "tOps": "ADD",
      "caseSensitive": false
    }
  ]
}

2. API for request preferences:

API endpoint will follow standard format for endpoints in folio:

1) GET /request-preference-storage/request-preference -  endpoint for searching, UI will get preferences related to user by sending request "GET /request-preference-storage/request-preference?query=userId==1e425b93-501e-44b0-a4c7-b3e66a25c42e"

2) POST /request-preference-storage/request-preference - create request preference

3) GET /request-preference-storage/request-preference/{id} - get request preference by id ("id" field is not the same as "userId")

4) DELETE /request-preference-storage/request-preference/{id} - delete request preference

5) PUT /request-preference-storage/request-preference/{id} - update request preference

3. Attributes of user request preference:

id - Unique request preference ID
userId - UUID of user associated with this request preference
holdShelf - Whether 'Hold shelf' option is available to the user.
delivery - Whether 'Delivery' option is available to the user.
defaultServicePointId - UUID of default service point for 'Hold shelf' option
defaultDeliveryAddressTypeId - UUID of user's address type
fulfillment - Preferred fulfillment type. Possible values are 'Delivery', 'Hold shelf'

Example of request preference:

Request preference
{
  "userId": "1e425b93-501e-44b0-a4c7-b3e66a25c42e",
  "holdShelf" : true,
  "delivery": true,
  "defaultServicePointId": "22beccec-8d77-4a97-906a-37cc26b070e5",
  "defaultDeliveryAddressTypeId": "27a1b086-20ac-4b1d-b6ac-3be353383f3d",
  "fulfillment": "Delivery"
}

4. POC: 

Created a draft pull request with simple implementation of request-preference-storage endpoints
https://github.com/folio-org/mod-circulation-storage/pull/200

  • No labels

3 Comments

  1. Couple of questions/comments Andrii Paias

    1.  request-preference-storage will be an interface provided by mod-circulation-storage, correct?
    2.  In the request preference example above, can we have both holdShelf and delivery set to true? I thought once the user selects delivery, then "holdShelf" should be set to false automatically?
  2. Sobha Duvvuri ,

    1. Yes it is in mod-circulation-storage. mod-circulation module seems to contain complex business logic, so since we only need CRUD operations we can use just mod-circulation-storage.
    2. According to presentation from Cate Boerema (https://ebscomeetings.webex.com/recordingservice/sites/ebscomeetings/recording/32088adf23554a9abb2afacd4cc2fe69),
      "holdShelf" and "delivery" specifies whether or not those options are available, and "fulfillment" specifies which option will be selected by default. Updated this page to reflect that.
Write a comment…