feat: teacher section scoping, session expiry fix, and notification timeline sorting

Backend:
- studentController: scope teacher student list/count by timeline-latest enrollment
  (ORDER BY ay.year_range DESC, e.grade_level DESC, e.id DESC) instead of MAX(id)
- documentController: same timeline-based scoping for teacher document access
- folderController: same timeline-based scoping for teacher folder access
- dashboardController: same timeline-based scoping for teacher dashboard stats
- archiveController: same timeline-based scoping for teacher archive view
- notificationController: replace MAX(id) enrollment subqueries with timeline sort;
  add broadcast notification support (entity_type IS NULL, category IN (student/document/system))
- schema, routes, reports, requirements, users: various supporting updates

Frontend:
- auth_repository: restore FlutterSecureStorage for JWT token storage
  (was broken: migrated to SharedPreferences while all other repos read from FlutterSecureStorage,
  causing all API calls to send null token silently)
- student_model: add latestEnrollment getter computed dynamically from enrollments list;
  expose latestGradeLevel/latestSection as getters with fallback to server-supplied values
- student_provider: invalidate studentDetailProvider on update/bulkEnroll/bulkGraduate
- inactivity_wrapper: fix timeout 3000s -> 300s (5 min); improve _handleInactivity guard
- dashboard, documents, settings, students, users screens: various UI updates

Chore:
- .gitignore: add .env, *.db, student uploads, debug/scratch scripts, flutter build artifacts
- remove tis_rms.db from git tracking (runtime data, should never be committed)
This commit is contained in:
ssbg04 committed 2026-06-23 01:13:00 +08:00
1 parent a7460fa14b
commit d983c0d2d8
28 files changed
+1314 -521

No files matched your search

Binary file not shown.