[FOLIO-2904] write loan cleanup script for bugfest Created: 08/Dec/20  Updated: 25/Jan/21  Resolved: 07/Jan/21

Status: Closed
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Task Priority: TBD
Reporter: Zak Burke Assignee: Zak Burke
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Attachments: HTML File mkitem    
Issue links:
Blocks
is blocked by MODFEE-151 permissions for DELETE /accounts/{id}... Closed
Sprint: Prokopovych - Sprint 105
Story Points: 5
Development Team: Prokopovych

 Description   

Loan data in bugfest needs to be purged in order for the system to continue to be operational. Write a NodeJS script that performs the following operations:

  1. check in all outstanding loans (this will clear patron blocks due to items aged to lost; it will also generate lots of fee/fines records)
  2. transfer all outstanding fee/fine records (this will close all open fee/fines)
  3. cancel all Page requests with request status Open- Not yet filled
  4. anonymize all closed loans
  5. delete all closed fee/fines

It must take the following parameters in order to be configurable so it can be used to purge data in any environment:

  • --username <u>
  • --password <p>
  • --tenant <t>
  • --okapi <http...>

Interested parties: Anton Emelianov, Holly Mistlebauer



 Comments   
Comment by Zak Burke [ 07/Jan/21 ]

Holly Mistlebauer, Anton Emelianov, the script is complete but cannot delete closed fees/fines due to MODFEE-151 Closed .

How would you like me to proceed? Should I run this script now, should somebody else (who?), should we wait until MODFEE-151 Closed is resolved?

Comment by Zak Burke [ 07/Jan/21 ]

Actually, now that I think about this, MODFEE-151 Closed is a bug in the module, meaning we'll need to update the mod-feesfines version running on bugfest in order for it to work. The alternative is to grant the necessary (not-supposed-to-be-granted-to-a-user) perm directly to the user running the script.

FYI, there is no harm in running the script multiple times, so we could run it now and it'll clean up everything it can until it dies during the last step. And if we update the module later, or change the permissions for the user the script runs as, it'll clean up everything (if new loans, requests, etc., have been created) and then clean up all the closed accounts too.

Anyway, PR is merged, so I'm closing this as done.

Comment by Holly Mistlebauer [ 19/Jan/21 ]

Zak Burke: I have asked Anton about the permission issue, but he needed to check with someone else.

Comment by Anton Emelianov (Inactive) [ 22/Jan/21 ]

Zak Burke and Holly Mistlebauer I asked BugFest devops to help. They will create a copy of Honeysuckle environment and we should be able to tests scripts there. I'll let you know when it is ready for test execution and data verification.

Comment by Zak Burke [ 22/Jan/21 ]

Anton Emelianov: possibly less effort than copying honeysuckle: attached is the script (mkitem) I used to create a few hundred items and loans when I was testing the script myself. The data won't be very diverse, though you could run it a few times with different users I guess. Hardcode the barcode to a patron from a particular group, or use a particular material type, to create a loan policy with a short window to cause overdue fees to accumulate quickly.

This would let us create a bunch of loans in, say, folio-testing-core and folks can test there.

Comment by Holly Mistlebauer [ 25/Jan/21 ]

Anton Emelianov: I am assuming you want to copy Honeysuckle and have us test there first so that we don't make a mess of the real data. That makes sense to me.

Comment by Anton Emelianov (Inactive) [ 25/Jan/21 ]

my plan exactly

Generated at Thu Feb 08 23:24:07 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.