Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

02 — User Personas (Staff Module)

Personas for the Staff module, derived from the blueprint personas (studylyon-blueprint/01-Product/USER_PERSONAS.md), the default role catalog (role.schema.ts), and the module's permission set (permissions.constants.ts:19-24). (proposed) marks behavioral detail not derivable from source.

P1 — Org Admin (primary actor)

"Configure branches, invite staff, oversee operations." (USER_PERSONAS.md:22-25)

  • Who: tenant owner/principal who runs the institution; has the org_admin role with ALL_PERMISSIONS (role.schema.ts:17-24), so all six staff permissions (permissions.constants.ts:19-24).
  • Goals:
    • Stand up the org structure once: create departments, then designations (department.controller.ts:26-43, designation.controller.ts:26-43).
    • Invite non-teaching staff: create the profile against an existing user (create-staff.dto.ts:5-7), watch the StaffCreated event fan out (event-queue-map.ts:34).
    • Deactivate leavers so they drop out of every query (base.repository.ts:20-30,68-74).
  • Frustrations: duplicate employee numbers causing 409s (staff.service.ts:32-36); forgetting a leaver and having them still appear.
  • Success metric: onboarding a new hire in < 2 minutes; deactivating in < 30 s.

P2 — HR Manager (primary daily actor)

A custom RBAC role is the only way to grant non-admin staff management — the default Staff role has just student.read (role.schema.ts:33-40). The HR manager is a (proposed) concrete persona for "user with staff.* permissions" — the rbac module creates it (rbac.controller.ts), but no default role carries these perms except org_admin.

  • Who: runs employee records day-to-day: onboarding, transfers, status changes.
  • Permissions used: staff.read, staff.create, staff.update, staff.delete, department.manage, designation.manage (permissions.constants.ts:19-24).
  • Goals:
    • Find any employee by employee number or name — search is not server-side for staff lists (staff.service.ts:64-76, OQ-2); HR relies on pagination + client-side filtering.
    • Maintain employment terms: employmentType, joiningDate, salaryGrade, departmentId, designationId (update-staff.dto.ts:6-33).
    • Set status explicitly (active/inactive/on_leave/terminated via update-staff.dto.ts:35-38; enum staff.schema.ts:7-12) — e.g., "on_leave" for sabbaticals without deleting.
    • Keep the department catalog tidy (rename, recode, set headId department.dto.ts:20-39) and the designation catalog ranked (level designation.dto.ts:14-17).
  • Frustrations: no bulk import endpoint for staff (Staff.md:17 lists bulk import as a responsibility — not implemented, OQ-5); client-side-only filtering on big rosters.

P3 — Staff Member (self-service, read-mostly)

  • Who: non-teaching employee with the default staff role — ['student.read'] (role.schema.ts:33-40). Cannot see the Staff module without an RBAC grant (OQ-1) and has no profile-self-edit endpoint: update-staff.dto.ts has no self-scoping; PATCH is by :id (staff.controller.ts:33).
  • Goals (proposed): view own employment record (department, designation, employment type, joining date, salary grade) in a "My profile" read-only view; everything else comes from other modules (students read, notifications, leave).
  • Reality check: the backend offers no self-service staff endpoint. If the product needs self-view, it must be built on GET /staff/:id guarded client-side (any caller with staff.read can read any staff record) — flag to product (OQ-7).

P4 — Accountant / Receptionist as staff types

  • Who: two of the module's actual designated staff: the blueprint seeds Accountant and Receptionist designations (COLLECTIONS.md:1571-1572) and departments Accounts (COLLECTIONS.md:1529). These are staff profiles, not separate roles: their login roles are accountant (role.schema.ts:41-48, permissions fees.collect, student.read) or staff — the designation is data, the role is RBAC.
  • Goals:
    • Accountant: fee desk work (Fees module) while being listed under Accounts department with designation Accountant for the org chart.
    • Receptionist: front-desk support (CRM/leads 05_Global_Information_Architecture.md:38), reachable in the staff directory.
  • Key UX insight: department/designation pickers must offer the seeded catalogs immediately (COLLECTIONS.md:1520-1533,1562-1573) and stay empty-state friendly when an org hasn't configured them yet.

P5 — Designation/Department viewer (cross-module (proposed))

  • Teachers reference the same departments/designations catalogs (teacher.schema.ts:22-26), but the catalogs are owned by this module (Staff.md:59). Any screen that displays a teacher's department (e.g., Teachers module detail) needs department/designation data — the Staff module client serves as the canonical catalog consumer.