Smart Library Docs

Reports Endpoints

API reference for report export operations — CSV downloads for circulation and fines data.

Reports Endpoints

Export library operational data as CSV files. These endpoints generate downloadable reports for administrative analysis.

Base Path: /api/v1/reports

All endpoints require authentication and ROLE_ADMIN or ROLE_LIBRARIAN authorization.


Export Circulation Report

GET /api/v1/reports/circulation

Generates a CSV file containing the latest 1,000 circulation transactions. The response is a downloadable file with Content-Type: text/csv.

Authorization: ROLE_ADMIN, ROLE_LIBRARIAN

CSV Columns

ColumnDescription
Transaction IDMongoDB ObjectId
User NameBorrower's full name
User EmailBorrower's email address
Book TitleTitle of the borrowed book
BarcodePhysical copy barcode
Issued AtISO 8601 timestamp of checkout
Due DateISO 8601 timestamp of due date
Returned AtISO 8601 timestamp or NOT RETURNED

Response

HTTP/1.1 200 OK
Content-Type: text/csv
Content-Disposition: attachment; filename="circulation_report.csv"

Transaction ID,User Name,User Email,Book Title,Barcode,Issued At,Due Date,Returned At
...

Export Fines Report

GET /api/v1/reports/fines

Generates a CSV file containing the latest 1,000 fine records. The response is a downloadable file with Content-Type: text/csv.

Authorization: ROLE_ADMIN, ROLE_LIBRARIAN

CSV Columns

ColumnDescription
Fine IDMongoDB ObjectId
User NameUser's full name
Amount ($)Fine amount in dollars
StatusUNPAID, PAID, or WAIVED
ReasonDescription of the fine
Created AtISO 8601 timestamp
Updated AtISO 8601 timestamp

Response

HTTP/1.1 200 OK
Content-Type: text/csv
Content-Disposition: attachment; filename="fines_report.csv"

Fine ID,User Name,Amount ($),Status,Reason,Created At,Updated At
...

Route Summary

MethodPathAuthDescription
GET/reports/circulationAdmin, LibrarianDownload circulation CSV
GET/reports/finesAdmin, LibrarianDownload fines CSV

On this page