Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This object allows to check each of the required block conditions for a patron:

ConditionCheck against

Maximum outstanding fee/fine balance

.outstandingFeeFineBalance

Maximum number of items charged out

number of .openLoans objects

Maximum number of lost items

.numberOfOpenFeesFinesForLostItems

Maximum number of overdue items

number of .openLoans[dueDate < returnedDate]

Maximum number of overdue recalled items

number of .openLoans[dueDate < returnedDate AND recall == true]

Maximum number of overdue days for recalled item

max of .openLoans[dueDate < returnedDate AND recall == true].(returnedDate - dueDate)

API

mod-automated-blocks will provide one endpoint that other modules will use to determine if patron should be blocked from borrowing, renewing and/or requesting items and why:

...

Code Block
languagetext
{
  "automatedPatronBlocks": [
    {
      "blockBorrowing": true,
      "blockRenewal": false,
      "blockRequest": false,
      "message": "Patron has reached maximum allowed number of items charged out"
    },
    {
      "blockBorrowing": false,
      "blockRenewal": false,
      "blockRequest": true,
      "message": "Patron has reached maximum allowed outstanding fee/fine balance for his/her patron group"
    }
  ]
}

Dependencies

ModuleEndpointPurpose

mod-automated-blocks → mod-users

GET /patron-block-condition
GET /patron-block-limits?query=(patronGroupId=={patronGroupId})

Get conditions and limits to be checked.

mod-circulation → mod-automated-blocks
GET /automated-patron-blocks/{patronId}
Check if action is allowed before borrowing, renewing and/or requesting items.