# Batch-first enrollment and Student wizard

User revision: 28 October 2026. This supersedes starting enrollment by choosing one Student in the main enrollment-list modal. Implement in the existing application, retaining issued CORs, financial entries, Student identities and grade history.

## Confirmed flow

1. Open an Enrollment Batch for a Branch, configured school level, School Year and semester/full-year period. Only Branch-enabled calendar/settings options are available. Saving opens the batch.
2. Open the batch's view and add a Student: search an existing record or create one, including initial Course/Year and an external-transferee checkbox.
   Existing Student choices match the Branch and academic school level, exclude blacklisted Students and omit Students already active in that batch. The same admission rule runs on submitted IDs, wizard actions and final readiness; the transferee checkbox cannot bypass it. Debt remains a warning. A move to the next school level requires a confirmed final-year record in an ended period, a published plan with final-year requirements, and completion of every requirement through passing official grades or approved completed transfer credits. Course/entry-stage selection remains a staff decision.
3. Student wizard: Assessment → Course (with optional transfer evaluation) → Accounting → Review/Pre-COR → Save.
4. Assessment shows debts as warnings, blocks blacklisted Students and reports academic/prerequisite and scheduling issues. Debt alone must not prevent moving through the wizard.
5. Course defaults to the next configured stage from the Student's last confirmed enrollment. Incoming/transferring Students choose the appropriate Course and entry Year. Course duration and semesters per year belong in setup. A Course lacking a usable curriculum/subject plan cannot be selected for enrollment.
6. Process Transfer supports an internal Course change or an external transferee. Retain all prior subjects, original grades and evaluated credited/noncredited subjects. Registrar can explicitly complete a partially credited subject with a required reason; partial credits alone do not silently imply completion.
7. Accounting shows the current assessment and existing balance and permits skipping. **Confirmed:** skipping saves pending enrollment and a Pre-COR; an official COR still requires Finance clearance. No skip action records a payment or clearance.
8. Review shows the Student, batch, Course/stage, subjects/classes, credits, conflicts/warnings and fee assessment as a Pre-COR. Registrar finalization rechecks all applicable gates and preserves issued document history.

## Academic and pricing setup

- Global Curriculum: school-wide name and description, selectable by several Courses.
- Course Subject Plan: each Course builds its own subjects from first to final Year/semester under the selected global curriculum. **Confirmed:** sharing a global curriculum does not force two Courses to share identical subjects.
- Preserve the existing published Course-plan identities and returning Student assignments rather than rewriting historical curricula or CORs.
- Course setup includes duration and semesters per year for stage suggestions. An automatic suggestion is reviewed before enrollment; it does not itself graduate a Student or erase failed requirements.
- Unit Types are **Lecture** and **Laboratory**, with a nonnegative decimal price and a per-credit or fixed pricing mode. Multiple Unit Types are assigned to a subject inside that Course's curriculum/subject plan. For example a 3-credit subject uses 2 Lecture credits + 1 Laboratory credit. Allocations must total the existing subject academic credits; saved assessments retain their rate/quantity snapshots.
- Fixed prices apply to the selected subject-plan component; per-credit lines multiply the configured rate by their applicable credits. No fees are silently attached to every enrollment merely because a Unit Type exists.

## Implementation boundary

Implementation retains `Enrollment` as the individual Student record under `EnrollmentBatch`. `CurriculumTemplate` is the global Curriculum catalog; the existing `Curriculum` table retains Course Subject Plans and assigned version IDs. Branch calendar settings now govern batch opening and Student admission independently of the legacy global period flag.

Use additive relationships and explicit batch/Student authorization. Retain the service checks for prerequisites, actual rosters, Teacher/Student conflicts, capacity, grade locks and audit history. Preserve separate academic readiness and financial readiness so the wizard can advance with debt while the official-COR gate remains enforced.

School setup contains global Curricula, each Course's versioned Subject Plan and Lecture/Laboratory allocations, plus Unit Type pricing and Branch calendars. Initial migrated prices are zero for school configuration; quotes do not automatically post financial entries. Later academic amendments preserve the initial assessment; Finance continues to review and record any financial adjustments manually.

## Removing unfinished enrollment

Enrollment Staff and Registrar can **Remove from batch** for an unfinished Student enrollment in an open batch, with a recorded reason and confirmation. The application and any prepared draft become cancelled and leave the active roster/counts and Finance clearance queue. Cancelled drafts cannot continue, finalize or issue a Pre-COR. Confirmed enrollments/issued CORs cannot be removed this way. Student identity, prior enrollments, grades, credit decisions, financial entries and audit history remain retained. Adding an eligible Student back restores that application/draft for fresh Assessment and review.

See [ADR 0012](adr/0012-batch-enrollment-course-plans-and-unit-types.md). The migration was applied to the local `school_simulation` database; the original `school` database and its private files are retained separately. No production deployment is implied by local verification.
