Trường Số QA/08 Inventory (P2 smoke)
Trường Số · QA test suite · Phase 1 · 10/09/2026
08 · Inventory (P2 smoke)
Test cases for PRD 08. Every case names the fixture data it needs (see the dashboard fixtures table), numbered steps, and one observable expected result. Trace points to the user story or rule in the PRD.
Key facts, origin and limits
Drafted by an AI assistant in a single session on 10/09/2026 as part of the Trường Số QA suite, under the request quoted verbatim on the dashboard. A proposal for team review, not a sign-off.
Sources
- The Trường Số PRD set (Draft v1, 10/09/2026): user stories, screen tables, business rules and permission matrices, plus the Cloud theme reference.
Limits
- Phase 1 (authoring) only. Cases are executed in Phase 2 against the local build; results are recorded in
testcases.jsonandruns/run-1/, and every result field is stillnot_run. - Cases inherit any open question or inconsistency in the PRDs they trace to.
1Summary
P0
4
P1
8
P2
2
P3
0
| Type | functional | ui-ux | edge | negative | regression | flow | a11y | perf | security | i18n |
|---|---|---|---|---|---|---|---|---|---|---|
| Count | 9 | 1 | 1 | 2 | 0 | 0 | 0 | 0 | 1 | 0 |
2Test cases
| ID | Title | Type | Priority | Phase | Preconditions | Steps | Expected result | PRD trace | Data needed | Run 1 |
|---|---|---|---|---|---|---|---|---|---|---|
| TS-INV-001 | Create a catalog item; duplicate SKU rejected | functional | P0 | P2 | As U-ACC on /inventory tab Danh mục. |
| First saved active; second shows inline "Mã hàng đã tồn tại"; SKU forced uppercase A–Z0–9-; delete not offered (deactivate only). | INV-01 | Fixtures below | Not run |
| TS-INV-002 | Stock-in document increases on-hand and becomes read-only | functional | P0 | P2 | Item FF2. |
| Document code NK-YYYYMM-####; on-hand 40 at A (0 at B); document immutable after posting; movement type Nhập. | INV-02 | Fixtures below | Not run |
| TS-INV-003 | Issue to a student creates a finance line | functional | P0 | P2 | S1 active; on-hand 40. |
| Toast "Đã phát 1 cuốn Family and Friends 2 cho Nguyễn An" with link to the finance line; on-hand 39; Materials tab lists the item with payment status; tuition line type material 180,000 exists. | INV-03 | Fixtures below | Not run |
| TS-INV-004 | Insufficient stock blocks the issue | negative | P0 | P2 | On-hand 1. |
| Form blocks with "Không đủ tồn kho (còn 1)"; API 409 INSUFFICIENT_STOCK; no movement. | INV-03 | Fixtures below | Not run |
| TS-INV-005 | Withdrawn student cannot receive items | negative | P1 | P2 | S5. |
| Blocked with a status message; event inventory_issue_blocked reason student_status. | 08 §5 | Fixtures below | Not run |
| TS-INV-006 | Class hand-out with shortfall offers partial issue | functional | P1 | P2 | C1 12 students; on-hand 10. |
| Dialog shows shortfall 2; option to issue to the first 10 by display name or cancel; one movement per student in one transaction; toast lists the shortfall. | INV-04 | Fixtures below | Not run |
| TS-INV-007 | Transfer between branches is atomic; same-branch refused | functional | P1 | P2 | As U-OWNER. |
| Paired transfer_out/transfer_in with the same document_id; A 34, B 5; same-branch rejected client- and server-side. | INV-05 | Fixtures below | Not run |
| TS-INV-008 | Count adjustment above threshold needs approval | functional | P1 | P2 | On-hand 34; count 20. |
| Adjust −14 pending (> 10 units); U-BM-A approves; on-hand 20. | INV-06 | Fixtures below | Not run |
| TS-INV-009 | Low-stock tab and daily notification | functional | P1 | P2 | Reorder 5; on-hand 4 after issues. |
| FF2 listed with chip Sắp hết; in-app notification to users with inventory.manage. | INV-07 | Fixtures below | Not run |
| TS-INV-010 | Return in new and damaged condition | functional | P1 | P2 | An issue movement. |
| New: on-hand +1; used: damaged +1 (Hỏng column shows); chargeable line flagged for credit, not deleted. | INV-08 | Fixtures below | Not run |
| TS-INV-011 | Concurrent issue of the last copy | edge | P1 | P2 | On-hand 1; two admins. |
| One succeeds; the other gets 409. | 08 §10 | Fixtures below | Not run |
| TS-INV-012 | Cost price visible only to owner and accountant | security | P1 | P2 | U-ACAD-A. |
| Giá vốn and Giá trị tồn hidden; API omits cost fields. | 08 §8 inventory.view_cost | Fixtures below | Not run |
| TS-INV-013 | Stock table formatting and empty state | ui-ux | P2 | P2 | /inventory. |
| SKU monospace; Tồn right-aligned red when ≤ reorder; Hỏng hidden when 0; VND with thousands separator; empty text "Chưa có hàng hoá. Tạo danh mục trước, sau đó nhập kho." with button Tạo mặt hàng; pagination 50. | 08 §4 | Fixtures below | Not run |
| TS-INV-014 | Movements export CSV | functional | P2 | P2 | As U-ACC. |
| CSV downloads with the movement columns; teacher gets 403. | 08 §7 export | Fixtures below | Not run |
Trường Số (truongso.net) · FLYER internal