Naalya Handbook
School features

Library

How a student reserves a book, how the desk lends it and takes it back, and what each refusal means.

Each campus runs its own library. Every route needs Feature.LIBRARY and starts with /api/v1/library/campuses/:campusId.

WhoPermissionUses
Students and staff borrowinglist or read on library_catalogueThe borrow routes
Library staffread, list, create, update or delete on library_managementCatalogue, desk, labels, loans, settings, report
A paired phoneIts device session, no sign-inScanning and photographing books

assertLibraryAccess and assertManages pin the permission to the campus in the path.

Borrowing a book

The student screen is /student/library (LibraryFilesBrowser). A book page shows one button:

ButtonWhenDoesSuccess says
ReserveA copy is on the shelfHolds it as ready until the same time tomorrow. Students get today plus the campus loan days; staff pick a return day"Held for you. Collect it from the library."
Want it nextNone on the shelf, some out, and the queue isn't longer than the copies outA waiting hold"You are next for this book."
Keep longerYou have itAsks the librarian for a later day (one request at a time)"Asked the librarian to keep it longer."

My books lists open loans and live holds.

Reserve and want-next lock the title and rebalance holds. Library notifications (LIBRARY_HOLD_READY, _HOLD_LAPSED, _DUE_SOON, _OVERDUE, _RENEWAL_DECIDED) open /student/library for students and the campus library for staff.

At the desk

Scan (scanLibraryCode). A label or accession number on this campus is a copy; a valid ISBN is an isbn; anything else is unknown.

Check (checkLibraryLend). Warns about an overdue loan, or that the free copies are held for others, and suggests a due day. It doesn't lend.

Lend (lendLibraryCopy). The copy must be on the shelf and the due day today or later. Writes the loan, marks the copy on_loan, and marks the borrower's hold collected. An overdue loan is a warning, not a refusal.

Take back (returnLibraryCopy). Closes the loan as returned and puts the copy on the shelf, or marks it damaged. Rebalancing then offers it to the next person waiting.

Keep longer at the desk sets a new due day after today and clears the request and reminders. Mark lost closes the loan as lost and the copy as lost.

The OpenAPI 400 sentences on desk routes are shorter than what the service throws, and several real refusals are 404 or 409. Trust the service messages.

Phone at the desk. POST .../desk/device (startLibraryDevice) starts the paired phone as a desk scanner (LIBRARY_DESK) or to add books (LIBRARY_CAPTURE) for a 12-hour workday. No paired phone gives 409 Pair a phone first. See Device pairing.

The catalogue

ActionRule
Edit a bookNeeds a title; a valid, unused ISBN
Delete a bookOnly with no copies left. Lapses its holds
Add copiesNumbered from the next free accession number (deleted copies count), under a campus lock
DamagedOnly from the shelf
Lost, delete a copyNot while on loan
Back on shelfRebalances holds
Cover photoUpload, take with the paired phone, or restore the original

Labels, loans and settings

AreaWhat to know
LabelslistLibraryLabels shows unprinted copies (or printed=true to reprint). Printing makes library-labels.pdf, up to 420 at a time: a QR, the accession number and the title
Loans tabsOut (soonest due first), Overdue (most late first, Kampala days), Renewals (a requested day). counts returns overdue plus renewals; a loan can be in both
HoldsReady ones first. Cancelling lapses it and offers the next person
Renewal answerAccept, change (needs a later day) or refuse. If someone else answered first: This request was already decided.
Loan daysstudentLoanDays, 1 to 60, default 4. Staff pick their own day
CategoriesTen defaults are added on first read and can't be renamed or deleted. A category or shelf with books can't be deleted

Term report

getLibraryReport and downloadLibraryReportPdf need read on library_management and a termId or campusAcademicYearId. Loans, books added, late returns, lost and damaged are counted on Kampala days in the period; overdue and stock are as of today. Lists stop at 10. The PDF waits up to 35 seconds for its render.

Routes

Every library route, generated from apps/server/src/app/library/controllers at API fbb63d51. Except for the paired phone, every controller requires the library feature and staff, and the borrower controller also allows students. Who is the extra check on each route. Prefix every path with /api/v1.

On this page