# Phase 7: Course, Curriculum, and Registration

## Completed work

- Tenant-scoped course catalogue with units, hours, type, assessment weights, pass
  marks, learning outcomes, and departmental ownership.
- Prerequisite and corequisite relationships with optional minimum scores.
- Draft, published, and archived curriculum versions by programme and effective session.
- Immutable published versions; publishing a successor archives the prior version.
- Course offerings by session and semester with capacity and lecturer allocations.
- Configurable registration periods, unit limits, financial-clearance switches, and
  adviser/department approval requirements.
- Curriculum- and level-filtered student registration with add/drop while in draft.
- Server-side deadline, duplicate, eligibility, compulsory-course, credit-limit,
  capacity, prerequisite/corequisite, student-status, and optional finance checks.
- Adviser and department decisions with append-only approval records.
- Explicit rule overrides requiring authorized staff and a documented reason.
- Print-friendly course registration forms.
- Twenty demo courses, published curricula for ten programmes, current offerings,
  lecturer allocations, and an open registration period.

## Database changes

Migration `2026_07_30_140000_create_curriculum_registration_tables.php` adds:

- `courses`
- `course_prerequisites`
- `curricula`
- `curriculum_courses`
- `course_offerings`
- `course_allocations`
- `registration_periods`
- `student_course_completions`
- `course_registrations`
- `course_registration_items`
- `course_registration_approvals`
- `course_registration_overrides`

Unique constraints prevent duplicate course codes, curriculum membership, offerings,
student registrations, registration items, and allocations. Queue and eligibility
queries have tenant/session/semester/status indexes.

## Security and integrity

- Policies combine tenant ownership with registration permissions.
- Student writes are restricted to the owning student and draft/rejected records.
- Client-supplied offering identifiers are revalidated for tenant, session, semester,
  curriculum, and availability.
- Submission and approval mutations use transactions and row locks.
- Published curricula cannot be edited.
- Overrides record rule, offering where applicable, authorizer, reason, and timestamp.
- Finance checks consume verified student financial status without pretending to
  perform payment processing.

## Manual testing

1. Sign in as `admin@ecstu.test` and open **Academics**.
2. Create a course, add a prerequisite, create a curriculum version, add courses, and
   publish it.
3. Create session offerings, allocate lecturers, and configure a registration period.
4. Sign in as `student1@ecstu.test`, open **Course Registration**, select courses,
   save, submit, and print the form.
5. Sign back in as the administrator, open **Registration Queue**, and record adviser
   and department approvals.

## Honest limitations

- The completion ledger is ready for prerequisite checks, but Phase 10 will make
  approved results its authoritative automated source.
- Financial eligibility uses the Phase 6 status field until Phase 11 provides the
  student ledger and clearance service.
- Timetable clash detection awaits timetable scheduling, and LMS classroom creation
  belongs to Phase 8.
- Bulk curriculum import/copy UI and spreadsheet exports remain future enhancements;
  the persisted versioning and copy-safe model are complete.

## Phase boundary

Phase 8 will build virtual classrooms, materials, assignments, discussions, online
lectures, and progress tracking. It has not been started.
