BE: (3-APB-A) Create Patron Blocks Conditions API

Description

To see how this JIRA issue integrates with the other automated patron blocks JIRA issues please see the diagram at https://drive.google.com/file/d/1D9tZE-EgTZYRV28Wc2ghpfHIdnqBwpr2/view?usp=sharing

Purpose: Provide API to retrieve and update patron blocks conditions on the backend.

The list of available conditions is predefined and cannot be changed by user via UI:

  • Maximum outstanding fee/fine balance

  • Maximum number of items charged out

  • Maximum number of lost items

  • Maximum number of overdue items

  • Maximum number of overdue recalls

  • Recall overdue by maximum number of days

Each condition contains fields:

  • id

  • name

  • block borrowing flag

  • block renewals flag

  • block requests flag

  • message to be displayed, when the limit is reached

Conditions data should be exposed via two new API endpoints:

  • /patron-blocks/conditions (GET, POST)

  • /patron-blocks/conditions/[id] (GET, PUT, DELETE)

Validation

  • If Borrowing and/or Renewals and/or Requests flag is set to true, then Message to be displayed is required. Return an error with this message if it is not present: Message to be displayed is a required field if one or more Blocked actions selected

  • If Message to be displayed is present, then Borrowing and/or Renewals and/or Requests must be set to true. Return an error with this message if no action flag is set to true: One or more Blocked actions must be selected for Message to be displayed to be used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DESCRIPTION

The purpose of this user story is to allow an institution to set conditions to be blocked, if any, for six initial conditions and to set a custom message to be displayed.

The first step in this task to to change the design of the Settings ==> Users section of FOLIO to add a Patron Blocks section with two new sub-sections: Conditions and Limits (as shown in the attached screen mock-up Patron-blocks-conditions.jpg) This user story covers the "Conditions" option and UIU-1167 covers the "Limits" option.

There are six hard-coded situations that the institution may select to set up patron blocks for (also shown in attached screen mock-up Patron-blocks-conditions.jpg):

  • Maximum outstanding fee/fine balance

  • Maximum number of items charged out

  • Maximum number of lost items

  • Maximum number of overdue items

  • Maximum number of overdue recalls

  • Recall overdue by maximum number of days

The fields for each situation are defaulted as follows (also shown in attached screen mock-up Patron-blocks-conditions.jpg):

  • Borrowing is set to no check mark

  • Renewals is set to no check mark

  • Requests is set to no check mark

  • Message to be displayed is set to blank

The field validation is as follows:

  • If Borrowing and/or Renewals and/or Requests is selected, then Message to be displayed is required; Display this error message if it is not present: Message to be displayed is a required field if one or more Blocked actions selected

  • If Message to be displayed is entered, then Borrowing and/or Renewals and/or Requests must be selected; Display this error message no block is selected: One or more Blocked actions must be selected for Message to be displayed to be used

After updating the record, a "success toast" should be displayed, as shown in attached screen mock-up Patron-blocks-conditions-success.jpg.

Please see Holly with any questions or comments. Thanks!

Environment

None

Potential Workaround

None

Attachments

10

Checklist

hide

TestRail: Results

Activity

Show:

Roman Barannyk February 17, 2020 at 10:36 AM

I have tested the changes on snapshot environment. It works as expected:

Get response with all predefined conditions:

Update "Maximum outstanding fee/fine balance" condition:

Delete "Maximum outstanding fee/fine balance" condition:

Validation testing:

Error message is empty, two flags are "true":


Error message is present, but all flags are "false":

Oleksandr Vidinieiev February 13, 2020 at 4:28 PM

Hi , I created the description for this story, and yes, it is a typo. It should say "Block borrowing". Thank you for noticing that.

Julian Ladisch February 13, 2020 at 4:20 PM

: Is "block borrowings flag" a typo and should be changed to "block borrowing flag"? The ux design in the png files shows "block borrowing" (singular).

Done

Details

Assignee

Reporter

Tester Assignee

Priority

Story Points

Sprint

Development Team

Vega

Fix versions

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created January 23, 2020 at 8:39 AM
Updated June 4, 2020 at 10:45 AM
Resolved February 20, 2020 at 9:32 AM
TestRail: Cases
TestRail: Runs