Fix student grade registration: set grade_10 as default, add auto-heal for legacy tawjihi_2008, add student grade selector and update-grade API

This commit is contained in:
Hamza-Ayed
2026-09-09 01:06:35 +03:00
parent 8183e53b86
commit 0a2ca71cb4
13 changed files with 440 additions and 41 deletions
+2 -2
View File
@@ -190,7 +190,7 @@ CREATE TABLE IF NOT EXISTS `school_rosters` (
`national_id` TEXT NOT NULL,
`national_id_hash` CHAR(64) NOT NULL,
`student_full_name` VARCHAR(255) NOT NULL,
`grade_level` VARCHAR(50) NOT NULL DEFAULT 'tawjihi_2008',
`grade_level` VARCHAR(50) NOT NULL DEFAULT 'grade_10',
`stream` ENUM('scientific', 'literary', 'vocational', 'general') NOT NULL DEFAULT 'scientific',
`is_claimed` TINYINT(1) NOT NULL DEFAULT 0,
`claimed_student_id` BIGINT UNSIGNED DEFAULT NULL,
@@ -213,7 +213,7 @@ CREATE TABLE IF NOT EXISTS `students` (
`national_id_hash` CHAR(64) NOT NULL UNIQUE,
`full_name` VARCHAR(255) NOT NULL,
`pin_code_hash` VARCHAR(255) DEFAULT NULL,
`grade_level` VARCHAR(50) NOT NULL DEFAULT 'tawjihi_2008',
`grade_level` VARCHAR(50) NOT NULL DEFAULT 'grade_10',
`stream` ENUM('scientific', 'literary', 'vocational', 'general') NOT NULL DEFAULT 'scientific',
`is_school_sponsored` TINYINT(1) NOT NULL DEFAULT 0,
`readiness_score` DECIMAL(5, 2) NOT NULL DEFAULT 0.00,