ROCKVIEW UNIVERSITY SLPS — UNIT MANAGEMENT UPDATE

WHAT THIS UPDATE ADDS
- Students have a My Unit link in the student sidebar. It displays the unit they belong to, the Unit Manager and the other student members.
- Unit Managers have a My Unit workspace where they can view their roster, add eligible students from their campus and remove members from their own unit.
- Staff and Top Management can create units, create Unit Manager accounts and assign a Manager to a unit.
- Manager accounts use the existing internal HOD authentication role for compatibility with the current login and dashboard routing. The visible interface labels these accounts as Unit Managers.
- A student can belong to only one active project unit at a time. A Manager can lead one unit at a time. Unit membership is campus-scoped.

DEPLOYMENT — IMPORTANT
1. Back up the live SLPS files and MySQL database before applying this update.
2. Upload/replace only the files contained in this patch ZIP, preserving the slps/ folder structure.
3. Open phpMyAdmin, select the SLPS database and import:
   slps/database/migrations/20261101_project_units.sql
   This creates the project_units, project_unit_managers and project_unit_members tables.
4. Confirm the required campus records already exist in the campuses table.
5. Sign in using a staff or Top Management account and open Manage Units.
6. Create each unit for the appropriate campus.
7. Create a Manager account and optionally select the unit during account creation. The initial password is emailed to the Manager. If email delivery fails, the one-time password is shown to the authorised staff member in the confirmation notice and must be shared securely.
8. The Manager signs in with the email address and initial password, opens My Unit, and adds students from the same campus. Students who are already assigned to another unit are not offered for selection.
9. Students sign in and select My Unit from the left navigation to see their Unit Manager and fellow members.

ACCESS CONTROL
- Only admin/staff accounts can create units and Manager accounts.
- Only the Manager assigned to a unit can add or remove members of that unit.
- Students can only view their own unit directory.
- The API validates role, campus, membership and CSRF token; it does not trust unit IDs supplied by the browser alone.

NOTE ABOUT EXISTING HOD ACCOUNTS
Existing accounts with the internal role `hod` continue to sign in. The user-facing dashboard and navigation now identify the role as Unit Manager. An existing Manager account can be assigned to a project unit from the Manage Units page if its staff profile has a campus matching the unit.
