Naalya Handbook
School features

Files

How staff keep a file, attach one to a lesson week, and how storage differs from the archive scaffold.

Prefix every path with /api/v1. These handlers were not called, and no file was uploaded. The lesson panel’s button path is on Timetable. This page is the permission and the refusal.

Keeping a staff file

StaffFilesController is staff-files, bearer auth, user type staff. It declares no feature. List, rename, move, and delete act on the caller’s own kept files. Another owner’s file is not found on the URL routes. The operation text says that. The service bodies of rename, move, and delete were not opened, so this page does not add a second refusal sentence for a name clash.

JobRouteWhat happens
List one folderGET /staff-files (listStaffFiles)The caller’s kept files in that folder, newest first. A chat keep lands in personal. The rover folder is what Rover learns from, and that list includes each file’s details
RenamePATCH /staff-files/:id (renameStaffFile)A new name. The file stays in its folder
MovePOST /staff-files/:id/move (moveStaffFile)To the top of Personal, or into one of the caller’s folders
DeleteDELETE /staff-files/:id (deleteStaffFile)Removes the kept file and its object. The response is { "message": "File deleted" }. A chat that still showed it loses it
Finish an uploadPOST /staff-files/:id/confirm (confirmStaffFileUpload)Checks the object landed and makes it part of My Files. The operation text says it fails when the upload never finished

GET /staff-files/usage (getStaffStorageUsage) is the caller’s bytes against the school’s per-staff limit. Chat files, their PDF copies, and kept files all count.

The Rover folder

This folder holds files the teacher gave Rover to learn from. Keeping a chat file does not put it here. POST /ai-thread-file/:id/keep calls keep with no folder, and that service defaults to personal.

JobHowWhat happens
Teach from a chat fileRover tool save_rover_fileKeeps the newest chat file of that name into rover, then stores the details. No chat file of that name is No chat file named plus the name. A file that changed during the move is 409 This file changed, try again
Change what Rover is toldPATCH /staff-files/:id/details (updateStaffFileDetails), or Rover tool update_rover_fileOnly the fields sent change. A file outside rover is Only a file in the Rover folder has details. The tool uses the newest rover file of that name, or No Rover folder file named plus the name
Upload straight inPOST /staff-files/upload-url with folder set to roverOptional details on the same body. Confirm still makes the file part of My Files. An unconfirmed upload is purged within the hour

The tool text tells Rover to save only when the person asks. The handler does not check that they asked.

Details are use, up to 20 subject ids, up to 20 class ids, and a note of at most 200 characters. use is facts (draw on what the file says) or format (copy how it is laid out). A file with nothing stored is treated as facts, with empty lists and a null note. Sending a subject or class list replaces that list. An id that is not in the school is Pick subjects from your school or Pick classes from your school. An empty or null note clears it. A subject or class deleted later drops out of the names that come back. A changed use sends the file to be read again. Other detail edits do not.

search_lesson_files needs the lesson planning feature. With only set to formats it searches the caller’s rover files whose use is format. A hit from that folder adds a path under /my-files/, the use, the subject and class names, and the note when there is one.

In the Hub the folder says "Rover learns from everything in here." An empty folder says "Nothing here yet" and "Use Add files to put in what you want Rover to learn from." Add files opens How should Rover use this? with two choices, Use what it says and Copy how it looks, then subject and class chips from the teacher's classrooms, plus any already on the file, and a note of at most 200 characters. A file that already has details gets a Details action. While Rover saves one, the activity line is "Keeping it in your Rover folder..." and then "Kept in your Rover folder." A detail change says "Changing the file details..." and then "Changed the file details." Read in Hub commit 1c7f501f05, which 40067f22 contains. The screen was not clicked.

Folders inside Personal

StaffFoldersController is staff-files/folders, bearer auth, user type staff. It declares no feature. Folders are one level, made by the caller, inside Personal.

List (listStaffFolders) returns those folders by name. Each has a file count and the newest four files, name and size only.

Create (createStaffFolder) trims the name. An empty name throws Give the folder a name. A name that keys to only dots, underscores, or hyphens throws Use letters or numbers in the name. A name that keys the same as one the caller already has throws You already have a folder called ${name}, using the existing folder’s name. The new folder is empty.

Rename (renameStaffFolder) uses the same name rules, ignoring the folder being renamed. When the storage key changes, each file inside is moved. A file that cannot be moved throws A file in this folder changed, try again, and the files already moved are put back. A put-back that fails is logged as Folder rename rolled back, but a file stayed under the new name. The files then sit under the new name while the folder row may still have the old one.

Delete (deleteStaffFolder) removes the objects first, then soft-deletes the folder. No files answers { "message": "Folder deleted" }. Otherwise the message is Folder and ${count} files deleted. The count is how many objects were removed. No folder was created.

Adding a file to a lesson week

The Hub and the API check different things, in this order.

  1. The panel shows Add files to this week only when the lesson was opened as the viewer’s own (mine), a scheme id came back, and the day has a week number. A class view sets mine when one lesson in the slot is the signed-in teacher’s, so the button can show for their own lesson. Someone else’s lesson stays without it.
  2. Before any request, the Hub refuses an empty file with “The file is empty.” and a file over 100 MB with “Files can be up to 100 MB.” Those two sentences are not the API.
  3. POST /lesson-planning/files/upload-url (createLessonPlanningFileUploadUrl) requires Feature.LESSON_PLANNING and user type staff. A missing scheme is Scheme of work not found. A missing staff profile is Staff profile not found. Someone who does not teach the subject in that stream, including a group scheme where they teach none of the accepted streams, gets You do not teach this subject in this stream. That is assertCanAuthorDoc. A later slot pick on a group scheme can still throw You do not teach any class on this scheme if no member stream matches. The year check is assertNotLocked, which throws Academic year is locked with no full stop. The billing decorator adds one. See Request scoping.
  4. assertHasRoom then checks the school’s per-staff byte limit. When used bytes are already above the limit it throws Your storage is full. Delete something you no longer need. That sentence is not the Hub’s 100 MB check, which runs first and never reaches the API.
  5. The returned PUT URL lasts one hour. The browser PUTs the bytes. A failed PUT says Upload failed (HTTP ...) or Upload failed. Confirm is the staff-files route above. An unconfirmed upload is purged within the hour. The confirm service’s exception text was not copied.

Storage and the archive controller

RouteoperationIdWhoWhat it does
POST /storage/uploaduploadFileSigned inTakes one multipart file: PNG, JPEG, WebP, or PDF, up to 10 MB. Bursary evidence uses it
POST /storage/upload-urlcreateUploadUrlSigned inReserves a row and returns a presigned PUT
GET /storage/:idgetStorageRecordAnyone who can see the rowReturns the row
GET /storage/:id/urlgetStorageUrlAnyone who can see the rowReturns a presigned URL for the stored object
GET /storagelistStorageRecordsPlatform adminLists the rows
DELETE /storage/:iddeleteStorageRecordPlatform adminSoft-deletes the row only. The stored object stays

Both GET /storage/:id routes answer Storage record not found when the row does not exist or the caller cannot see it. A row is visible to a platform admin, to staff of the row's school, or to the user named in metadata.recipientUserId (not referenceId).

/archive is not a file store. ArchiveController (Super Admin only, no feature flag) has the five CRUD routes (createArchive, listArchives, getArchive, updateArchive, deleteArchive), but ArchiveService is the unedited Nest scaffold: each returns a placeholder sentence such as This action adds a new archive and writes nothing. Payment-receipt archives are separate; see Payment item and transaction operations.

On this page