Write to a file: Fees Fines Report
Number of APIs: 5
Overview
This collection creates a Fees/Fines report in CSV format that includes the following columns:
Fee/Fine Amount
Remaining Amount
Fee/Fine Type
Item Title (if applicable)
Fee/Fine Owner
User (Patron) Id
Fee/Fine Id
Patron Barcode
Patron Last Name
Patron First Name
Patron email
Patron Group
Requirements
This collection requires the following:
The Qodex client (not the web version--still free!) using Collection Runner
The Node.js environment: https://nodejs.org/en/download/prebuilt-installer
A local web server running from this Node.js script: https://github.com/sivcan/ResponseToFile-Qodex
- These scripts are looking for a local server running on port 3000.
Documentation
Write Responses to a file using a local webserver: [link]
Use Qodex Collection Runner: [link]
Use Qodex Collection Runner with a data file: [link]
Export the Scripts and Environment
This collection is meant to be run in two steps. The first step gathers all fees and fines that are equal to or greater than the amount you dictate (the defaultsetting is 10.0) and create a CSV file. The second step takes uses the information in that file to find the patron information complete the report.
Export Collection and Environment
Export the entire collection at the Fees Fines Report folder level.
Export one of the sample environment files.
Import the collection and environment file into your personal Qodex workspace
- Duplicate the environment file and modify it for your FOLIO tenant
Step 1
Start your local web server running on port 3000 (or modify the "Write Order Data call to use your web server's port number
Set the desired fee/fine remaining amount threshold the scripts should use in the Set Variables request.
- Use the
Run Collection
option from the Step 1 folder level to run the scripts in order and generate the initial report. The filename is dynamically generated but will be displayed in the Qodex tests report.
Step 2
Use the
Run Collection
option from the Step 2 folder level to run the scripts in order and generate the initial report. This collection also needs the following:- The report generated in Step 1 selected as the data file
- Turn off console logging by selecting the Turn off logs during run checkbox.
NOTE: We recommend selecting the Turn off logs during run
option if your file contains more than 50 lines to avoid any timeouts in the system. Also note that the free version of Collection Runner only allows a certain number of executions per hour before requiring a 30-second break.
-
Step 1 - Get Fees/Fines Info - Get Open Accounts by Remaining Amount GET {{baseUrl}}/accounts?limit=100&offset={{offset}}&query=(status.name = "Open" and remaining >=/number {{minimumRemainingFine}}) sortBy id
-
Step 1 - Get Fees/Fines Info - Write to Temp File GET http://localhost:3000/
-
Step 2 - Get User Info - Get Patron Groups GET {{baseUrl}}/groups?limit=500
-
Step 2 - Get User Info - Get User by Id GET {{baseUrl}}/users/{{userId}}
-
Step 2 - Get User Info - Write to Report GET http://localhost:3000/