Change dueDate to 2020-04-10 for open loans where dueDate < 2020-04-10
Description
Environment
Potential Workaround
Checklist
hideTestRail: Results
Activity
Lisa Sjögren March 18, 2020 at 3:57 PM
Exec decision. We treat recalled and non-recalled loans the same way. We change the dueDate to 2020-04-10 for open loans where dueDate < 2020-04-10. We do not touch the status element when updating the loan.
Theodor Tolstoy (One-Group.se) March 18, 2020 at 3:09 PM
So, I should change the action in the objects as well then?
Lisa Sjögren March 18, 2020 at 3:09 PM
So, I guess the "action" seems to be whatever you PUT in. The question is if anything breaks (in relation to some other module) when the "action" doesn't reflect the actual latest action.
Lisa Sjögren March 18, 2020 at 3:05 PM
So the short answer would be, it depends.
Latest action is a recall:
"loanDate": "2020-03-13T08:55:29Z",
"dueDate": "2020-04-01T21:59:59.000+0000",
"action": "recallrequested",
"loanPolicyId": "b0b04888-7e78-49ee-b910-58bb5ab977e1",
"checkoutServicePointId": "bd353ac4-73f9-4431-b0cc-088e564691db",
"dueDateChangedByRecall": true,
Update the record via API... Now the latest actual action is a due date change, but....
"loanDate": "2020-03-13T08:55:29Z",
"dueDate": "2020-06-01T21:59:59.000+0000",
"action": "recallrequested",
"loanPolicyId": "b0b04888-7e78-49ee-b910-58bb5ab977e1",
"checkoutServicePointId": "bd353ac4-73f9-4431-b0cc-088e564691db",
"dueDateChangedByRecall": true,
I then change the due date once more, but in the UI, et voilà...
"loanDate": "2020-03-13T08:55:29Z",
"dueDate": "2020-07-29T21:59:00.000+0000",
"action": "dueDateChanged",
"loanPolicyId": "b0b04888-7e78-49ee-b910-58bb5ab977e1",
"checkoutServicePointId": "bd353ac4-73f9-4431-b0cc-088e564691db",
"dueDateChangedByRecall": true,
Theodor Tolstoy (One-Group.se) March 18, 2020 at 2:43 PM
I realized I can do both 1) and 2), so that is all fine. Could you check what happens to the action?
The task
Make sure no patrons have to return their loaned items until 2020-04-02. This includes loans that have already expired, loans expiring between now and 2020-04-10, loans without recalls and loans with recalls.
Suggested method
From /circulation/loans, get all loans that have status Open and a due date prior to 2020-04-10.
/circulation/loans?query=(status.name="Open" AND dueDate < "2020-04-10*")&limit=0
For these records, change the value of the dueDate element to:
"dueDate": "2020-04-10T22:59:59.000+0000",
PUT updated records to /circulation/loans.
Things to consider/find out
Recalled loans - are there any obstacles to updating these through the BL API?
Notice records generated and scheduled upon checkout - will these be automatically changed when we update the loans through the BL API?
-The new due date - should it be set to when the library opens, or sometime in summer? Should we do the same for all loans, or different things for loans with/without recalls? (Eg. recalled loans 2020-04-02, other loans 2020-07-08.)- We ultimately decided against this, see discussion.