Trường Số PRD/Test plan seed
Trường Số · Product Requirements · 09/2026

Test plan seed

Seed for the QA agent: per PRD, the user flows that must be covered end to end, the high-risk areas that need negative and concurrency tests, and the cross-module reconciliations that prove the numbers agree. Test ids reference the user stories in each PRD.

Key facts, origin and limits
Status
Draft v1
Owner
QA
Environments
staging-api.flyer.us · seeded tenant Big Center
Tooling
Playwright (web + mobile viewport) · API tests against /v3

Drafted by an AI assistant together with the PRD set (10/09/2026, with PRDs 13 to 19 added on 16/09/2026), under the original request quoted verbatim on the hub page. A proposal for team discussion, not a decision of the product team.

Sources

  • User stories, business rules and edge cases in PRDs 00 to 19.

Limits

  • Draft v1, written before a build existed to test against; the detailed case suite lives at /qa/.

1Test data and environments

2Flows and high-risk areas per PRD

PRDEnd-to-end flowsHigh-risk areas (negative, concurrency, permissions)
00 / 10 Tenancy and rolesOnboarding creates center and first owner; add branch; invite user with role and branch; accept invitation; switch branch; clone and edit role; deactivate user.Cross-tenant id access returns 404 for every new endpoint; branch scope enforced on lists (user with branch A never sees B rows); last owner cannot be removed; permission change effective without re-login; stub PermissionGate removed (kanban actions respect real permissions).
01 AdmissionsCreate lead with prospect learner; duplicate phone warning; log call with callback; callback queue; DNC mark and forced call; book trial; teacher marks trial attendance; consultant notified; placement test create and result; conversion wizard 4 steps with new learner, guardian consent, class, fee plan, invoice; transfer lead to branch; sources and channels settings persisted via API.Conversion atomicity (fail step 3 leaves nothing); convert twice blocked per prospect; discount above limit creates approval and does not create sessions; trial seats exhausted; placement status labels match API enum; import dedupe strategies; kanban move with stale cursor.
02 StudentsCreate walk-in student; add second guardian shared with sibling; enroll; pause and resume with expiry extension; withdraw with refund estimate; transfer branch; upload document; flagged note visible to teacher; learning tab with and without FLYER data; anonymise.Status derivation vs manual transitions (INVALID_TRANSITION); guardian phone uniqueness and merge; teacher sees only own-class students; anonymise keeps finance rows; search with accents and guardian phone.
03 ClassesCourse with fee plans; create class with pattern and holidays, preview sessions; room and teacher conflict shown and overridden; edit one session vs following; cancel late with make-up appended; substitute; enroll to capacity then waiting list; transfer class; make-up booking; timetable views and print; close class.Regeneration never touches held sessions; conflict check across branches for teachers; STALE on concurrent session edit; capacity counts trials and make-ups; timezone at month boundary; iCal link is signed and revocable.
04 AttendanceTeacher mobile: open sheet, mark exceptions, save; offline queue then sync; excused pre-marked; admin correction with reason; unmarked chase and reminder; absence follow-up task; trial and make-up rows; reports and export; parent receives absent ZNS.Version conflict between main and substitute; package consumption rules per status and policy; edit window enforcement by role; notification skipped without consent with reason; quiet hours behaviour for evening absent; delete sheet blocked for non-admin; idempotent PUT by client_saved_at.
05 FinanceFee plans; invoice with lines, discount, voucher, instalments; QR shown; cash payment with receipt PDF; SePay matched transfer; partial payment; unmatched transfer split across two invoices; bulk monthly billing with proration preview; debt list, reminder, payment plan; package low and exhausted; credit note and refund with approval; expense and cash close with difference; void payment; e-invoice success and failure; finance report reconciles with cash book.Money rounding and totals; overpayment refused; duplicate SePay webhook deduped; receipt numbering sequential under concurrency (two cashiers); void after cash close; discount limit by role; credit note bounds; VAT defaults per line type; audit entry on every money write; parent sees only own invoices.
06 StaffCreate staff with account; link existing teacher; contract with pay rule; generate timesheet; teacher flags a line; manager resolves and approves; export payroll; evaluation shared; off-board with future sessions reassigned.Overlapping contracts refused; rate snapshot survives rule edit; substitute paid not main; regenerate after approval refused; late-cancelled session paid per rule; permissions on cost fields; terminated staff hidden from pickers.
07 ParentsConnect Zalo (stub); template statuses; transactional messages on attendance, invoice, receipt, cancel; announcement to class with preview and reach; teacher class note; progress report batch, comments, publish, PDF; parent OTP login; children switcher; timetable; excuse and make-up requests; consent revoke; portal QR payment updates on webhook.Consent routing and fallback order; quiet hours; ZNS cap pause; template rejected mid-flight; OTP rate limits and lockout; portal session revocation; message log content masking in logs; unreachable guardians listed; audience resolved at send time.
08 InventoryCatalog item; stock-in; issue to student chargeable creating finance line; class hand-out with shortfall; transfer between branches; count adjustment with approval; low-stock list and daily notification; return in new and damaged condition; export.Negative stock refused under concurrency; immutable posted documents; cost visibility by role; inactive item in draft; finance line deletion blocked while movement exists.
09 ReportsExecutive dashboard with period and branch; drill-down from every tile lands on the matching filtered list; role home pages; each report in the library with filters, totals, export job; weekly digest.Reconciliation: dashboard money tiles equal cash book and invoice list totals; student counts equal list counts; period boundaries in tenant timezone; void recomputes aggregates; export above 5,000 rows as job; viewer role read-only.
11 Data and importsTemplates per entity; mapping; validation preview with errors and warnings; commit as job; detail with failed rows; rollback within 24 h; full order staff to attendance on Empty Center; opening balances create packages and opening tuition.Phone normalisation; Excel serial dates; dedupe merge semantics for students and guardians; capacity warnings not blocking; rollback refused after modification; branch code missing offers create for owner only.
12 Non-functionalPerformance run on Big Center for lists, dashboard, attendance save, import 5,000 rows, timetable generation; restore drill; tenant export; i18n key parity check; axe on main screens; keyboard walkthrough.Rate limits (OTP, login, writes); signed URL expiry; secrets masked after save; CSP headers; audit append-only (no UPDATE grants); logs contain no phone numbers; anonymise flow; consent capture on every guardian entry point.
13 Exam scoresCreate a class assessment with skill components and weights; class-wide grid entry (keyboard, paste from Excel); per-student entry with comment and attachments; pull scores from a FLYER exam; submit, academic staff returns then publishes; parents notified and see results on the portal; post-publish re-grade with reason; export report card xlsx and PDF.Out-of-scale scores blocked in the cell and at the API; weights not summing to 100 % block save; publishing twice sends no duplicate notification; post-publish edits require a reason and are logged; teachers enter only assigned classes; parents never see drafts; other-branch assessments hidden.
14 CurriculumCreate curriculum, units, lessons with HTML, YouTube and file blocks; publish a version; bind to a course; create a class and check session ↔ lesson mapping; teacher logs the lesson on mobile after attendance (taught, partial, other); shift lessons down after a cancelled session; class progress view; upload to the library and set folder permissions.Published version not editable in place; deleting a mapped lesson blocked; teaching log older than 7 days needs a reason; files over 200 MB or wrong type rejected; 100 % quota blocks upload; script tags stripped from HTML; teacher-only material never shown on the parent portal.
15 TargetsCreate a monthly target period; cascade centre → branch → individual; publish; actuals refresh from dashboard and tuition data; progress board with forecast; behind-pace alerts; consultant ranking; consultant views own targets on mobile; mid-period revision with reason; copy previous period.Branch totals not matching the centre blocked unless overridden with reason; no manual actuals via API; 23:30 snapshot never runs twice; alerts not repeated within 7 days; staff moving branch mid-period; ranking hidden when visibility is branch-only; period closes after the 5-day grace.
16 Tasks and leaveAssign a task linked to a customer and student; daily routine creates exactly one task; system task on 3 absences with dedupe; reminders before due and the 08:00 digest; teacher submits leave on mobile, manager approves, affected sessions flagged for substitutes; incident report with photos, severity, routed to the branch manager.Same dedupe key within 7 days is not recreated; overlapping leave blocked; escalation to the owner after 48 hours; critical incidents bypass quiet hours; tasks of departed staff fall back to the manager; only assigner, assignee and branch manager can see a task.
17 MobileInstall the PWA and open from the icon; offline attendance then background sync; push opens the right screen via deep link; manager approves a discount on mobile; consultant calls from the shell and logs the call; parent views materials and results; biometric re-auth; device registration and revocation.Sync conflict when two people edit one sheet (409); offline queue survives app kill; push content carries no amounts or full names; quiet hours; over 5 devices; revocation signs the session out immediately; 3G performance budget (cold start ≤ 4 s).
18 Online learningLink the student to a FLYER learner at conversion; map the class to a FLYER class and sync the roster; assign homework bound to a lesson with a due date; submission reminders; results sync every 15 minutes into the learning tab and assessments; sell a test-prep package, grant on payment, revoke on expiry; single sign-on from the parent portal.A mapped FLYER class cannot take a second centre class; paused students get paused entitlements; partial payment grants nothing; SSO code single-use and expires in 60 s; repeated webhooks write no duplicate results; revoking homework keeps synced results.
19 Service plansNew tenant enters a 30-day trial; 90 % student-limit warning; the 101st student blocked with an upgrade quote; upgrade prorated by the formula; subscription invoice matched by SePay; 14 days past due switches to read-only; trial extension and credit from the internal console; downgrade at term end.Read-only state returns 423 on every write; limits count active students only; downgrade blocked while usage exceeds the new plan; credit never negative; internal actions audited; data kept 90 days after termination then purged (conflict with PRD 12 to settle).

3Cross-module scenarios

  1. Lead to first payment: lead created by import; call; trial; placement; conversion with invoice; QR transfer matched; receipt to guardian; student Active; roster shows student; first attendance consumes a session; balance and dashboard tiles update.
  2. Pause and return: student paused for 30 days; sessions in window hidden from roster; package expiry extended; resume into a new class; timesheets unaffected.
  3. Withdrawal with refund: withdraw; refund estimate; credit note; refund paid from cash drawer; cash close shows it; churn report lists the reason; parent portal shows the credit.
  4. Teacher substitution: main teacher on leave; substitute assigned; substitute marks attendance; timesheet pays substitute; main teacher's timesheet excludes it.
  5. Branch transfer: student moves A to B with package balance; A and B reports show transfer lines; guardian portal shows both histories.
  6. Month close: bulk billing; reminders; payments; cash close on each branch; timesheets approved and exported; executive dashboard equals sum of branch rows.

4Priority order for automation

  1. Tenant isolation and permission checks on every new endpoint (API tests, generated from the OpenAPI additions).
  2. Money paths: invoice, payment, matching, receipt numbering, void, refund, cash close, reconciliation with reports.
  3. Attendance save on mobile including offline and version conflicts, and package consumption.
  4. Conversion wizard atomicity.
  5. Session generation, conflicts and regeneration.
  6. Messaging routing and fallback with stubs.
  7. Imports in full order on an empty tenant.
  8. Dashboards and reports reconciliation.

Trường Số (truongso.net) · FLYER internal