# Readable school simulation

The local demo at http://127.0.0.1:8097 now runs a clean, fictional school simulation. Automated test fixtures are kept in a different database/server so names such as P1 timestamps, Browser Teacher and Phase 1 browser do not return to the demo.

## Sign in

Choose **Demo role** on the login page. It fills the email and password for School Administrator, Enrollment Staff, Registrar, Finance Staff, Finance Approver, Teacher, Dean, Department Monitor or Student. Click **Sign in** normally. All use the existing `SchoolDemo2026!` local demonstration password.

The feature requires `SCHOOL_DEMO=true` and a local/testing environment. It is disabled by default and never supplies accounts or passwords from a production login page.

## School records

The simulation has 30 Students, four Courses/school levels, 25 subjects, 27 scheduled Subject Classes and 31 enrollment records (26 current confirmed enrollments, four current drafts and one historical enrollment).

| Setup | Examples |
| --- | --- |
| School year | 2026–2027 |
| College semesters | First Semester and Second Semester |
| High school enrollment | Full School Year |
| College Courses | BS Information Technology; BS Business Administration |
| Academic Colleges | College of Computer Studies → BSIT; College of Business Administration → BSBA |
| High school | Junior High School, Grade 7; Senior High School, Grade 11 STEM |
| Sections | BSIT 1-A; BSBA 1-A; Grade 7 — Sampaguita; STEM 11-A |
| Subjects | Understanding the Self, Purposive Communication, Computer Programming 1, Fundamentals of Management, Mathematics 7, General Biology 1 |
| Teachers | Maria Santos, Carlo Mendoza, Liza Cruz, Roberto Reyes, Anna Flores and other named subject Teachers |

School Year, Semester, Year/Grade and curriculum are displayed separately. Schedules and enrollment drafts choose a School Year before a semester/full-year period. School setup adds a school year and coverage in one form and automatically names the period, without requiring an extra arbitrary period name or a duplicate cycle choice.

Enrollment now begins with an open Branch/school-level/School Year batch. Add a Student inside the batch, then complete Assessment → Course/transfer evaluation → Accounting → Review. College filters Courses or fills from a Course choice. The Course subject plan is automatic and preserves returning Students' assigned versions. Skipping Accounting saves a pending enrollment and Pre-COR; Finance clearance and Registrar confirmation still precede the official COR.

Manage global Curricula, each Course's own Subject Plan and Lecture/Laboratory credit allocations under **School setup → Courses & curricula**. Configure Unit Type prices there; migrated rates start at zero so historical tuition is not invented. A 3-credit subject can use 2 Lecture credits and 1 Laboratory credit. Published plans remain locked; prepare a new plan version for structural changes. Enable each Branch's school-level cycle and available periods under **School years & grades** before opening a new enrollment batch.

Weekly meetings have been checked for Teacher conflicts. College general-education classes are shared by the IT and Business sections, while each Course retains its own major subjects. The curriculum's Major/Minor classification remains separate from subject units.

## Students to try

| Student | Scenario |
| --- | --- |
| Miguel Santos | Enrolled in BSIT 1-A, 1st Year, First Semester 2026–2027; six subjects, paid/cleared and a COR ready to view |
| Jamie Cruz | Student login; historical passing and failing results, plus a current enrollment that retakes Computer Programming 1 |
| Joshua Dela Cruz | Enrollment draft On Hold with a PHP 3,500 previous balance; try Finance Approver arrangement approval and Finance Staff clearance |
| Patricia Ramos | BSIT draft awaiting payment/clearance review |
| Mark Villanueva | BSBA draft already cleared by Finance, ready for the Registrar to review/finalize |
| Gabriel Reyes | Grade 7 — Sampaguita, yearly enrollment with six named subjects |
| Francis Bautista | Grade 11 STEM, yearly enrollment with four named subjects |

Search enrollment by a full name, such as **Miguel Santos**. The Registrar can review the record and its six classes; the Teacher login opens Maria Santos's own classes and actual rosters. To try Carlo Mendoza's programming classes, use `carlo.mendoza@school.test` with the same demo password.

Ending a Section membership remains separate from enrollment. An ended membership no longer raises a stale-draft warning on an already-finalized enrollment; pending drafts still require explicit review before they can restore a Section.

## Data boundaries and verification

The app's local `.env` now points to `school_simulation`. The prior `school` database is preserved. Its original 110 checked rows and 21 private files were verified, with only normal remember-me token rotation on a User differing from the older strict hash. User identities/passwords and academic fields match the original baseline after accounting for that volatile authentication token. No token or baseline was edited to force the check to pass.

`SchoolSimulationSeeder` accepts only an empty isolated local simulation database (or the isolated automated test databases). It creates records through the existing enrollment, finance and grading services and retains their database audit history. It never resets an existing school database.

`npm run test:e2e` uses `school_browser_test` and an automatically managed port-8098 server; the fixture writer refuses the simulation database. `npm run test:simulation` uses port 8097 for role autofill, real-name enrollment views, School Year/semester filters, school-year form behavior and desktop/phone layout checks. It does not submit academic changes to the simulation.

Screenshots are `design/implementation/simulation-demo-login-*`, `simulation-enrollment-*`, `simulation-schedule-*` and `simulation-school-years-*`.

Verified locally on 28 October 2026: the production build passed; the isolated browser regression suite passed 21 checks with one duplicate mobile account-creation case skipped; all six read-only simulation/role-selector checks passed at desktop and phone sizes. The PostgreSQL feature suite passed 33 tests/664 assertions before the login selector addition, then the selector/production-boundary and simulation/full-name tests passed separately on PostgreSQL (2 tests/106 assertions). The final SQLite suite result is recorded in `design/implementation/simulation-verification.json`.
