...
Response example:
Code Block | ||
---|---|---|
| ||
{ "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 | { |
mod-circulation | publish | ITEM_CHECKCHECKED_OUT | { |
mod-circulation | publish | ITEM_CHECKCHECKED_IN | { |
mod-circulation | publish | ITEM_DECLARED_LOST | { |
mod-circulation | publish | LOAN_DUE_DATE_UPDATEUPDATED | { |
mod-automatedblocks | subscribe | FF_BALANCE_CHANGECHANGED |
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 | ||
---|---|---|
| ||
{ "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 | ||
---|---|---|
| ||
{ "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" } ] } |
...