feat: Add District-Level Set (Batch) Management featureure - #58
Open
kudimirohith-bit wants to merge 23 commits into
Open
feat: Add District-Level Set (Batch) Management featureure#58kudimirohith-bit wants to merge 23 commits into
kudimirohith-bit wants to merge 23 commits into
Conversation
- Update collection count from 11 to 12 in overview
- Add entry to the numbered collections overview list
- Append full interface and enum as schema section 12
* SetStatus covers all 9 forward-only lifecycle stages from Created
through Evaluation Completed
* Set interface fields: id, name, assessmentName, schoolId,
classGroup, studentIds (ordered), status, createdAt, createdByEmail
- Export SetStatus union type (9 forward-only lifecycle stages)
- Export Set interface matching schema_design.md spec
- Export generateSetId() following STD_/WS_ Math.random convention
('SET_' + Math.floor(10000 + Math.random() * 90000))
- Add sets: Set[] to DatabaseSchema
- Register sets in COLLECTION_NAMES map
- Add getSets(), addSet(), updateSet() helpers mirroring worksheets pattern
- Seed with empty sets: [] array in getSeedData() return
…district/block scoping
…e select dropdown filters
…and restore backend auth constraints
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds District-Level Set (Batch) Management: District/Block Organizers can group
students into Sets, bulk-generate personalized question papers for every student
in a Set, merge them into one printable package (cover page + papers in student
order), and track each Set through its status lifecycle (Created → ... →
Evaluation Completed).
Why
Printing/generating papers one student at a time doesn't scale for district-wide
assessments (thousands of students). This lets an organizer manage generation,
printing, and tracking at the Set level while each student still gets their own
personalized paper — personalization logic is untouched.
New endpoints
Access control
All /api/sets* routes are restricted to DISTRICT_ADMIN, BLOCK_ADMIN, SUPERADMIN,
and force-scoped by the caller's districtCode/blockCode — a District Admin can
only see/act on Sets belonging to schools in their own district, regardless of
query params.
Known limitations (by design, not oversight)
/api/diagnostic/bulk jobs) and are lost on server restart.
header, since the frontend triggers download via a plain link click (browsers
don't attach custom headers to navigation). This matches the app's existing
token scheme (a plain identifier, not a signed/expiring credential), so this
isn't a new class of exposure — but it does mean the token can appear in
browser history/server logs. Flagging for awareness.
Testing done
download → status transitions (valid + rejected invalid transitions).
cannot see or act on another district's Sets.
tsc --noEmitclean on both backend and frontend.