Files
unsupervised-scheduler/docs/features/student-administration.md
T
thatguygriff 8a3e9b65df
CI / Tests (PHP 8.1) (pull_request) Successful in 43s
CI / Coding Standards (pull_request) Successful in 55s
CI / PHPStan (pull_request) Successful in 1m0s
CI / No Debug Code (pull_request) Successful in 2s
CI / Tests (PHP 8.2) (pull_request) Successful in 43s
CI / Tests (PHP 8.3) (pull_request) Successful in 45s
CI / Build Plugin Zip (pull_request) Has been skipped
Add README and student-administration feature spec
- README.md: plugin overview, package-by-domain architecture, feature/status
  table linking each docs/features spec (implemented vs planned), shortcodes,
  REST namespace, roles, install via composer build, dev commands, and CI.
- docs/features/student-administration.md: spec for the planned studio-admin
  Students list + per-student detail (upcoming/past lessons, group enrolments);
  read-only; manage_students; no new tables. Tracked as #22.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-07 12:08:30 -03:00

47 lines
2.1 KiB
Markdown

# Feature: Student Administration
## Overview
A read-only studio-admin area to browse students and drill into one student's
history and upcoming activity — lessons and group-class enrolments — without
digging through individual records. (Status: planned — issue #22.)
## Data Model
No new tables. The views are composed from existing data:
- Students are WordPress users with the `us_student` role (`get_users`, `get_userdata`).
- Lessons come from `{prefix}us_lessons` (with `{prefix}us_availability` for slot times).
- Group-class enrolments come from `{prefix}us_group_enrollments`.
## Admin Interface
**Students** in wp-admin (`manage_students`, studio admin only):
- **List** — every `us_student` user: display name, email, registered date, and
quick counts (upcoming lessons, active group enrolments). Each row links to the
detail view.
- **Detail** (`?student_id=`):
- **Account** — display name, email, registered date.
- **Upcoming lessons** and **Past lessons** — split by the linked availability
slot's `start_dt`; each shows date/time, offering, instructor, and status.
- **Group-class enrolments** — active/past, with offering title and status.
- *(Later)* policy-acceptance history, intake answers, and payment history once
Payments lands.
Read-only in this iteration; cancel/edit actions are a possible follow-up.
## Capabilities
- `manage_students` — studio admin (administrators inherit it via the
`user_has_cap` filter). No new capabilities or tables.
## Implementation
- Admin controller: `Unsupervised\Schedular\Auth\StudentController` (list + detail)
- Templates: `templates/admin/students.php`, `templates/admin/student-detail.php`
- Reuses `Booking\BookingRepository::findByStudent`,
`Availability\AvailabilityRepository::findById`,
`Offering\OfferingRepository::findById`,
`GroupClass\EnrollmentRepository::findByStudent`
- The upcoming/past split is extracted into a small pure helper so it is
unit-testable (the controller itself follows the repo convention of not being
unit-tested).
## Tests
- `tests/Unit/Auth/StudentScheduleTest.php` (the pure upcoming/past split helper)