Versions Compared

Key

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

...

Response example:

Code Block
languagetextjs
{
  "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"
    }
  ]
}

...

Module

Publish/subscribe

Event type

Payload

mod-feesfines

publish

FF_BALANCE_CHANGECHANGED

{
"accountId": string,
  "userId": string,
  "balance": numeric,
"feeFineId": string
}

Example:
{
"accountId": "82d804b9-8a73-4d9d-bf9b-78f751758420",
  "userId": "4f0e711c-d583-41e0-9555-b62f1725023f",
  "balance": 15,
"feeFineId": "95df458a-5a01-4f9a-99e1-64d5657d8379"
}
mod-circulationpublish

ITEM_CHECKCHECKED_OUT

{
  "userId": string,
  "loanId": string,
  "dueDate": string
}
mod-circulationpublishITEM_CHECKCHECKED_IN
{
  "userId": string,
"loanId": string,
"returnDate": string
}
mod-circulationpublishITEM_DECLARED_LOST
{
  "userId": string,
"loanId": string
}
mod-circulationpublishLOAN_DUE_DATE_UPDATEUPDATED
{
  "userId": string,
  "loanId": string,
  "dueDate": string,
"recall": boolean
}
mod-automatedblockssubscribe

FF_BALANCE_CHANGECHANGED
ITEM_CHECKCHECKED_OUT
ITEM_CHECKCHECKED_IN
ITEM_DECLARED_LOST
LOAN_DUE_DATE_UPDATEUPDATED


DB

Using the info from events mod-automated-blocks is subscribed to, we need to maintain one object per patron in the DB:

Code Block
languagetextjs
{
  "id": string,
  "outstandingFeeFineBalance": numeric,
  "numberOfOpenFeesFinesForLostItems": numeric,
  "numberOfLostItems": numeric,
  "openLoans": [
    {
      "loanId": string,
      "dueDate": string,
      "returnedDate": string,
      "recall": boolean
    }
  ],
  "openAccounts": [
    {
      "accountId": string,
      "balance": numeric,
      "feeFineId": string
    }
  ]
}

...

Response example:

Code Block
languagetextjs
{
  "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"
    }
  ]
}

...