Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

14 — QA Checklist (Teachers Module)

Module-specific additions to 00-shared/10. Items marked [backend] are bugs or gaps derivable from source and should be raised with the API team, not papered over in the UI.


1. Assignment conflict & duplicate matrix

#ScenarioExpectedServer reality
QA-1Same (teacher, subject, class, year) assigned twiceClient blocks + inline errorNo server guard (subject-assignment.service.ts:13-17; non-unique indexes subject-assignment.schema.ts:24-25) — [backend] add unique index or 409
QA-2Same teacher, same subject, two classes (same year)Allowed (two rows)Allowed — expected
QA-3Two admins assign same triple concurrentlyClient can't prevent (server race)Both succeed — [backend]; client shows both rows, dedup display
QA-4Assign teacher to subject not in class curriculumClient warns (no server model of curriculum)No check — accept (no curriculum entity)
QA-5Timetable conflict for teacher (two periods same time)Handled by Timetable module, not this onetimetable.service.ts:16-30 409 — cross-module QA
QA-6by-teacher / by-class without academicYearIdClient never sends; if API called bare → expect []Returns [] (subject-assignment.service.ts:26-31) — verify client picker always set

2. Duplicate teacher rules

#ScenarioExpected
QA-7POST /teachers with userId already profiled409 DUPLICATE_RESOURCE (teacher.service.ts:27-31) — UI banner
QA-8POST /teachers with existing employeeNumber409 (teacher.service.ts:32-38) — banner
QA-9PATCH to existing employeeNumberNo 409 (teacher.service.ts:80-93 only checks record exists) — [backend]; client pre-check + accept race
QA-10userId change via PATCHBlocked by DTO absence (update-teacher.dto.ts) — verify immutability in UI

3. Deactivate rules

#ScenarioExpected
QA-11DELETE /teachers/:idSoft-delete; all subsequent list/detail queries exclude (base.repository.ts:20-30,68-74)
QA-12Deactivate teacher with active assignments/timetableAllowed server-side (no guard) — dialog warns; [backend] consider BUSINESS_RULE_VIOLATION guard (OQ-5)
QA-13Re-activationNo endpoint — not offered in UI
QA-14Deactivate already-deleted id404 → snackbar "already removed" → back
QA-15Audit trailTeacherDeletedaudit-write job (event-queue-map.ts:33) — verify audit UI shows it

4. Pagination & list integrity

#ScenarioExpected
QA-16page=1,limit=20meta mathtotalPages = max(1, ceil(total/limit)), hasNext/hasPrevious (pagination-query.dto.ts:41-55)
QA-17limit > 100400 VALIDATION_ERROR (pagination-query.dto.ts:13-19) — client clamps
QA-18sort/q paramsIgnored by service (teacher.service.ts:66-78) — UI must not claim server search; local filter only; [backend] (OQ-3)
QA-19Soft-deleted rows in middle pageNever returned (scope) — no ghost rows
QA-20Page race on pull-to-refresh + load-moreRequest generation token; no duplicate items
QA-21Subject-assignments/by-* non-paginatedFull array; verify memory on large schools; server pagination (planned)

5. Tenant isolation & security

#ScenarioExpected
QA-22Cross-tenant GET /teachers/:id404 (scope tenantId injected, base.repository.ts:20-30) — never leak existence (00-shared/07 §3)
QA-23No tenantId in bodiesClient never sends it (07 §6)
QA-24Unauthenticated call401 → refresh flow

6. Event/side-effect correctness [backend]

#ItemEvidence
QA-25TeacherCreated routed to in-app, not emailsPLAN.md:36 promises welcome emailevent-queue-map.ts:31 vs PLAN.md:36 — confirm email intent
QA-26In-app notification type='TeacherCreated' vs NotificationType enum (email_verified|password_reset|verification_resent|welcome)inapp.worker.ts:46-53 + notification.schema.ts:7-12 — likely enum validation failure → job retries → DLQ
QA-27Search index title for TeacherCreated payload {teacherId, employeeNumber} — no name → not indexedsearch-indexer.service.ts:62-88 + teacher.service.ts:47-49

7. Client QA (per 00-shared/10)

#Item
QA-28A11y: status chips label+icon (color-blind), focus order S1→S2, dialog focus trap
QA-29Text scale 2×: long designation names + status chips don't clip
QA-30Dark mode parity: all status token pairs verified
QA-31Offline: list from cache + banner; forms blocked
QA-32Perf: S1 skeleton ≤ 200 ms; no duplicate parallel requests (10 §1)
QA-33Analytics (proposed): teachers.list.search, teachers.create.submit, teachers.assignments.add, teachers.deactivate.confirm (10 §8 naming)
QA-34Golden tests: StatusChip ×4 ×2 modes, TeacherListTile, AssignmentCard, TeacherCard ×3 sizes

8. Release gates (module)

  • Server gaps QA-1/9/12/18/25/26/27 triaged with API team (none block v1 UI if client compensates: dedup, pre-check, warning copy)
  • All envelope error codes map to i18n keys (no raw 5xx text)
  • E2E: create → assign → edit → deactivate journey on device cloud
  • Cross-tenant 404 verified in E2E