@educa-corp/sdd-framework 0.2.4 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/commands/generate-architecture.md +706 -0
  2. package/commands/generate-architecture.tmpl +194 -0
  3. package/commands/generate-code.md +35 -9
  4. package/commands/generate-code.tmpl +35 -9
  5. package/commands/generate-tech-docs.md +259 -246
  6. package/commands/generate-tech-docs.tmpl +21 -0
  7. package/core/FRAMEWORK_VERSION +1 -1
  8. package/core/commands/generate-architecture.md +706 -0
  9. package/core/commands/generate-code.md +35 -9
  10. package/core/commands/generate-tech-docs.md +259 -246
  11. package/core/skills/setup-ai-first/SKILL.md +12 -4
  12. package/core/templates/architecture.template.md +392 -111
  13. package/core/templates/tech-design.template.md +238 -246
  14. package/docs/01-getting-started/installation.md +47 -112
  15. package/docs/01-getting-started/quickstart.md +58 -72
  16. package/docs/01-getting-started/what-is-sdd.md +75 -0
  17. package/docs/02-concepts/architecture.md +109 -0
  18. package/docs/02-concepts/glossary.md +87 -0
  19. package/docs/02-concepts/overview.md +93 -0
  20. package/docs/02-concepts/pipeline-steps/00-setup.md +102 -0
  21. package/docs/02-concepts/pipeline-steps/01-discovery.md +129 -0
  22. package/docs/02-concepts/pipeline-steps/02-specification.md +130 -0
  23. package/docs/02-concepts/pipeline-steps/03-design-spec.md +90 -0
  24. package/docs/02-concepts/pipeline-steps/04-bdd.md +120 -0
  25. package/docs/02-concepts/pipeline-steps/05-tech-docs.md +101 -0
  26. package/docs/02-concepts/pipeline-steps/06-code.md +119 -0
  27. package/docs/02-concepts/pipeline-steps/07-dev-selftest.md +92 -0
  28. package/docs/02-concepts/pipeline-steps/08-qc-automation.md +102 -0
  29. package/docs/02-concepts/pipeline-steps/09-validate-traces.md +104 -0
  30. package/docs/02-concepts/pipeline-steps/10-feedback-loop.md +105 -0
  31. package/docs/02-concepts/pipeline-steps/README.md +92 -0
  32. package/docs/02-concepts/roles-and-hitl.md +73 -0
  33. package/docs/02-concepts/traceability.md +94 -0
  34. package/docs/03-guides/architect.md +98 -0
  35. package/docs/03-guides/developer.md +76 -0
  36. package/docs/03-guides/product-owner.md +68 -0
  37. package/docs/03-guides/tester-qa.md +70 -0
  38. package/docs/04-reference/commands.md +105 -0
  39. package/docs/04-reference/configuration.md +94 -0
  40. package/docs/04-reference/model-selection.md +68 -0
  41. package/docs/04-reference/modules.md +74 -0
  42. package/docs/04-reference/trace-schema.md +93 -0
  43. package/docs/README.md +29 -40
  44. package/docs/explain/00-setup-ai-first.md +77 -0
  45. package/docs/explain/00b-generate-architecture.md +76 -0
  46. package/docs/explain/01-define-product.md +79 -0
  47. package/docs/explain/02-generate-prd.md +78 -0
  48. package/docs/explain/03-refine-prd.md +86 -0
  49. package/docs/explain/04-review-context.md +100 -0
  50. package/docs/explain/05-generate-design-spec.md +73 -0
  51. package/docs/explain/06-generate-bdd.md +77 -0
  52. package/docs/explain/07-generate-tech-docs.md +71 -0
  53. package/docs/explain/08-review-tech-docs.md +79 -0
  54. package/docs/explain/09-generate-code.md +78 -0
  55. package/docs/explain/10-review-code.md +70 -0
  56. package/docs/explain/11-map-testids.md +69 -0
  57. package/docs/explain/12-dev-gen-test.md +66 -0
  58. package/docs/explain/13-dev-run-test.md +69 -0
  59. package/docs/explain/14-dev-smoke-test.md +67 -0
  60. package/docs/explain/15-qc-analyze.md +68 -0
  61. package/docs/explain/16-qc-plan.md +61 -0
  62. package/docs/explain/17-qc-design-test.md +61 -0
  63. package/docs/explain/18-qc-review.md +59 -0
  64. package/docs/explain/19-qc-run-test.md +67 -0
  65. package/docs/explain/20-qc-report.md +61 -0
  66. package/docs/explain/21-validate-traces.md +68 -0
  67. package/docs/explain/22-generate-spec-manifest.md +60 -0
  68. package/docs/explain/23-fix-bug.md +69 -0
  69. package/docs/explain/24-debug.md +61 -0
  70. package/docs/explain/25-report-bug.md +65 -0
  71. package/docs/explain/26-propose-scenario.md +63 -0
  72. package/docs/explain/27-learn.md +65 -0
  73. package/docs/explain/28-sync.md +70 -0
  74. package/docs/explain/29-update-framework.md +65 -0
  75. package/docs/explain/README.md +134 -0
  76. package/package.json +1 -1
  77. package/skills/setup-ai-first/SKILL.md +12 -4
  78. package/skills/setup-ai-first/SKILL.tmpl +12 -4
  79. package/templates/architecture.template.md +392 -111
  80. package/templates/tech-design.template.md +238 -246
  81. package/docs/01-getting-started/README.md +0 -19
  82. package/docs/01-getting-started/core-concepts.md +0 -102
  83. package/docs/02-guides/README.md +0 -26
  84. package/docs/02-guides/bdd-input-checklist.md +0 -68
  85. package/docs/02-guides/developer/README.md +0 -49
  86. package/docs/02-guides/developer/bdd-and-trace.md +0 -126
  87. package/docs/02-guides/developer/commands.md +0 -76
  88. package/docs/02-guides/developer/pr-checklist.md +0 -16
  89. package/docs/02-guides/developer/scenarios.md +0 -460
  90. package/docs/02-guides/developer/workflow.md +0 -121
  91. package/docs/02-guides/prd-input-checklist.md +0 -94
  92. package/docs/02-guides/product-owner/README.md +0 -81
  93. package/docs/02-guides/product-owner/commands.md +0 -30
  94. package/docs/02-guides/product-owner/handoff-checklist.md +0 -42
  95. package/docs/02-guides/product-owner/prd-writing-rules.md +0 -45
  96. package/docs/02-guides/product-owner/scenarios.md +0 -438
  97. package/docs/02-guides/tech-docs-input-checklist.md +0 -109
  98. package/docs/02-guides/tester/README.md +0 -75
  99. package/docs/02-guides/tester/bug-reporting.md +0 -117
  100. package/docs/02-guides/tester/qc-automation.md +0 -165
  101. package/docs/02-guides/tester/reading-specs.md +0 -79
  102. package/docs/02-guides/tester/scenarios.md +0 -186
  103. package/docs/02-guides/tester/spec-manifest.md +0 -130
  104. package/docs/02-guides/tester/test-checklist.md +0 -31
  105. package/docs/02-guides/tester/workflow.md +0 -77
  106. package/docs/03-concepts/README.md +0 -20
  107. package/docs/03-concepts/architecture.md +0 -248
  108. package/docs/03-concepts/mechanisms-explained.md +0 -124
  109. package/docs/03-concepts/pipeline.md +0 -278
  110. package/docs/03-concepts/traceability.md +0 -152
  111. package/docs/04-operations/README.md +0 -33
  112. package/docs/04-operations/bug-flow.md +0 -364
  113. package/docs/04-operations/publishing.md +0 -154
  114. package/docs/04-operations/sync-and-update.md +0 -522
  115. package/docs/05-reference/README.md +0 -34
  116. package/docs/05-reference/command-cheatsheet.md +0 -147
  117. package/docs/05-reference/commands.md +0 -234
  118. package/docs/05-reference/model-selection.md +0 -74
  119. package/docs/05-reference/modules.md +0 -110
  120. package/docs/05-reference/trace-schema.md +0 -154
  121. package/docs/06-commands/README.md +0 -75
  122. package/docs/06-commands/explain-debug.md +0 -32
  123. package/docs/06-commands/explain-define-product.md +0 -43
  124. package/docs/06-commands/explain-dev-gen-test.md +0 -28
  125. package/docs/06-commands/explain-dev-run-test.md +0 -24
  126. package/docs/06-commands/explain-dev-smoke-test.md +0 -25
  127. package/docs/06-commands/explain-fix-bug.md +0 -28
  128. package/docs/06-commands/explain-generate-bdd.md +0 -45
  129. package/docs/06-commands/explain-generate-code.md +0 -53
  130. package/docs/06-commands/explain-generate-design-spec.md +0 -54
  131. package/docs/06-commands/explain-generate-prd.md +0 -45
  132. package/docs/06-commands/explain-generate-spec-manifest.md +0 -20
  133. package/docs/06-commands/explain-generate-tech-docs.md +0 -56
  134. package/docs/06-commands/explain-learn.md +0 -21
  135. package/docs/06-commands/explain-map-testids.md +0 -28
  136. package/docs/06-commands/explain-propose-scenario.md +0 -24
  137. package/docs/06-commands/explain-qc-analyze.md +0 -22
  138. package/docs/06-commands/explain-qc-design-test.md +0 -20
  139. package/docs/06-commands/explain-qc-plan.md +0 -21
  140. package/docs/06-commands/explain-qc-report.md +0 -23
  141. package/docs/06-commands/explain-qc-review.md +0 -24
  142. package/docs/06-commands/explain-qc-run-test.md +0 -27
  143. package/docs/06-commands/explain-refine-prd.md +0 -51
  144. package/docs/06-commands/explain-report-bug.md +0 -24
  145. package/docs/06-commands/explain-review-code.md +0 -45
  146. package/docs/06-commands/explain-review-context.md +0 -68
  147. package/docs/06-commands/explain-review-tech-docs.md +0 -45
  148. package/docs/06-commands/explain-setup-ai-first.md +0 -25
  149. package/docs/06-commands/explain-sync.md +0 -24
  150. package/docs/06-commands/explain-update-framework.md +0 -22
  151. package/docs/06-commands/explain-validate-traces.md +0 -25
  152. package/docs/t-sample.md +0 -826
@@ -1,307 +1,299 @@
1
1
  <!--
2
2
  ════════════════════════════════════════════════════════════════════════════
3
- TEMPLATE: Technical Design Document (per-PRD, full-stack, merged)
4
- Used by: /generate-tech-docs
3
+ TEMPLATE: Tài liệu Thiết kế Kỹ thuật (per-PRD, full-stack, gộp)
4
+ Dùng bởi: /generate-tech-docs
5
5
  ════════════════════════════════════════════════════════════════════════════
6
6
 
7
- SCOPE MODEL
8
- - ONE document per PRD (not per UC). It covers EVERY use case of the PRD in a
9
- single merged, full-stack design: backend (API, data model, DB) AND client
10
- (components, state, API-integration) side by side, joined by cross-tier
11
- sequence diagrams. This is the "construction blueprint" any developer opens
12
- to implement the whole feature.
13
- - INPUT is the BDD feature files of the PRD (web/ · app/ · system/), NOT the
14
- PRD prose. The PRD is loaded only for Overview/Goals/Actors context.
15
-
16
- INCREMENTAL / APPEND
17
- - When new BDD is added to the same PRD later, this document is EXTENDED, not
18
- regenerated: add the new UC's sections + sequence diagrams, update the
19
- UC Coverage matrix (§10) and the Changelog. Never clobber existing content
20
- or hand edits.
21
-
22
- FILLING RULES
23
- - Replace every {…} placeholder with real content. Delete guidance comments.
24
- - TERMINOLOGY: obey the project dictionary 100%
25
- (specs/domain-knowledge/business-dictionary.md). Status/enum values
26
- core-entities.md (Enum Registry). Entities core-entities.md.
27
- - Keep code/DTO/DB samples in the project's stack idiom (see the active module
28
- stack-profile). The C#/Angular snippets below are ILLUSTRATIVE swap for
29
- the real stack.
30
- - A section that does not apply to this PRD: keep the heading and write
31
- "N/A — {reason}" rather than deleting it, so the shape stays predictable.
32
- - Every sequence diagram / API / rule should be traceable back to a scenario:
33
- reference the SC id (e.g. UC1-SC3) it serves.
7
+ HÌNH PHẠM VI
8
+ - MỘT tài liệu cho mỗi PRD (không phải per-UC). bao phủ MỌI use case của PRD
9
+ trong một thiết kế full-stack gộp: backend (API, hình dữ liệu, DB) client
10
+ (component, state, tích hợp API) đặt cạnh nhau, nối bằng sequence diagram xuyên
11
+ tầng. Đây "bản vẽ thi công" bất kỳ dev nào mở ra để implement cả feature.
12
+ - ĐẦU VÀO các file BDD của PRD (web/ · app/ · system/), KHÔNG phải văn xuôi PRD.
13
+ PRD chỉ nạp để lấy bối cảnh Overview/Goals/Actors.
14
+
15
+ TĂNG DẦN / APPEND
16
+ - Khi BDD mới được thêm vào cùng PRD về sau, tài liệu này được MỞ RỘNG, không sinh
17
+ lại: thêm section + sequence diagram của UC mới, cập nhật ma trận Độ phủ UC (§10)
18
+ Changelog. KHÔNG bao giờ đè nội dung sẵn hay chỉnh tay.
19
+
20
+ QUY TẮC ĐIỀN
21
+ - Thay MỌI placeholder {…} bằng nội dung thật. Xoá các comment hướng dẫn.
22
+ - THUẬT NGỮ: tuân 100% từ điển dự án (specs/domain-knowledge/business-dictionary.md).
23
+ Giá trị status/enum core-entities.md (Enum Registry). Entity core-entities.md.
24
+ - Giữ code/DTO/DB mẫu theo idiom stack của dự án (xem stack-profile của module đang
25
+ dùng). Snippet C#/Angular bên dưới chỉ MANG TÍNH MINH HOẠ — thay bằng stack thật.
26
+ - Section không áp dụng cho PRD này: GIỮ heading và viết "N/A — {lý do}" thay vì
27
+ xoá, để cấu trúc luôn nhất quán, dễ đoán.
28
+ - Mọi sequence diagram / API / rule phải truy vết được về một scenario: tham chiếu
29
+ id SC (vd UC1-SC3) mà nó phục vụ.
34
30
  -->
35
31
 
36
- # {Feature Area} — {PRD Title} Technical Design Document
32
+ # {Feature Area} — Tài liệu Thiết kế Kỹ thuật: {PRD Title}
37
33
 
38
- <!-- @trace block (PRD-level). ucs = every UC covered by this doc; append ids as UCs are added. -->
34
+ <!-- Khối @trace (cấp PRD). ucs = mọi UC doc này phủ; nối thêm id khi thêm UC. GIỮ NGUYÊN key @trace.* — máy đọc. -->
39
35
  ---
40
36
  @trace.id: {TICKET-ID}
41
37
  @trace.domain: {domain}
42
38
  @trace.prd: {TICKET-ID}
43
39
  @trace.ucs: {TICKET-ID}-UC1, {TICKET-ID}-UC2{, …}
44
- @trace.service: {service — from BDD header @trace.service}
45
- @trace.module: {module(s) involvede.g. dotnet, angular}
46
- @trace.platforms: {system | web | app — whichever BDD folders exist}
47
- @trace.bdd_version: {per-platform map e.g. system=1.5, web=1.9, app=1.7; only platforms present. Each feature carries its own bdd_version; do not flatten to one number.}
40
+ @trace.service: {service — từ header BDD @trace.service}
41
+ @trace.module: {module liên quan vd dotnet, angular}
42
+ @trace.platforms: {system | web | app — tuỳ thư mục BDD nào tồn tại}
43
+ @trace.bdd_version: {map theo từng platform — vd system=1.5, web=1.9, app=1.7; chỉ platform có mặt. Mỗi feature mang bdd_version riêng; đừng gộp về một số.}
48
44
  @trace.api_source: {existing | —}
49
45
  @trace.revision: 1
50
46
  @trace.status: draft
51
47
  @trace.generated_at: {YYYY-MM-DD}
52
48
  ---
53
49
 
54
- > **Related docs:** {link sibling PRDs / tech-designs this depends on, e.g. [OTHER-TICKET](../{other-slug}/tech-docs/{OTHER-TICKET}-tech-design.md)}. Delete if none.
50
+ > **Tài liệu liên quan:** {link các PRD / tech-design anh em mà doc này phụ thuộc, vd [OTHER-TICKET](../{other-slug}/tech-docs/{OTHER-TICKET}-tech-design.md)}. Xoá nếu không có.
55
51
 
56
- ## 1. Overview
52
+ ## 1. Tổng quan (Overview)
57
53
 
58
- <!-- 2–4 sentences: what this feature does, who uses it, the key technical shape
59
- (data sources, primary side effects). Name where data comes from (DB vs
60
- external API) and the main write. Source: PRD + system BDD. -->
54
+ <!-- 2–4 câu: feature làm gì, ai dùng, hình dạng kỹ thuật cốt lõi (nguồn dữ liệu,
55
+ side effect chính). Nêu dữ liệu đến từ đâu (DB vs API ngoài) và thao tác ghi
56
+ chính. Nguồn: PRD + system BDD. -->
61
57
 
62
- {What the feature does, its main actor, and the core technical mechanism. State
63
- which data is owned (DB) vs sourced live (external API), and the primary write.}
58
+ {Feature làm gì, tác nhân chính, chế kỹ thuật cốt lõi. Nêu rõ dữ liệu nào được
59
+ sở hữu (DB) vs lấy live (API ngoài), thao tác ghi chính.}
64
60
 
65
- ### Goals
61
+ ### Mục tiêu (Goals)
66
62
 
67
- <!-- Bullet the technical goalsderived from PRD goals, phrased as what the
68
- system must guarantee. -->
63
+ <!-- Liệt mục tiêu kỹ thuật suy từ mục tiêu PRD, diễn đạt thành thứ hệ thống
64
+ phải đảm bảo. -->
69
65
 
70
- - {Goal 1}
71
- - {Goal 2}
66
+ - {Mục tiêu 1}
67
+ - {Mục tiêu 2}
72
68
 
73
- ### Business Actors
69
+ ### Tác nhân nghiệp vụ (Business Actors)
74
70
 
75
- | Actor | Description | Channel |
71
+ | Tác nhân | tả | Kênh |
76
72
  |-------|-------------|---------|
77
- | {Actor} | {role & permission} | {entry path, e.g. App → Widget → Portal → API} |
73
+ | {Actor} | {vai trò & quyền} | {đường vào, vd App → Widget → Portal → API} |
78
74
 
79
75
  ---
80
76
 
81
- ## 2. Architecture Overview
77
+ ## 2. Tổng quan Kiến trúc (Architecture Overview)
82
78
 
83
- ### 2.1 High-level Architecture
79
+ ### 2.1 Kiến trúc tổng thể (High-level Architecture)
84
80
 
85
- <!-- ASCII (or mermaid) topology showing the systems this feature touches:
86
- client → gateway → service(s) → data stores / external APIs. Keep it to the
87
- components THIS PRD actually exercises. Source: architecture.md /
88
- project-context.yaml (services, stack). -->
81
+ <!-- ASCII (hoặc mermaid) topology thể hiện các hệ thống feature này chạm tới:
82
+ client → gateway → service(s) → data store / API ngoài. Chỉ giữ các component
83
+ PRD NÀY thực sự dùng. Nguồn: architecture.md / project-context.yaml (services, stack). -->
89
84
 
90
85
  ```
91
- {ASCII or mermaid diagram of the components this feature touches}
86
+ {Sơ đồ ASCII hoặc mermaid các component feature này chạm tới}
92
87
  ```
93
88
 
94
- > **Note:** {call out which data is fetched live from an external API vs stored in the owned DB, and any cache layer + TTL.}
89
+ > **Lưu ý:** {chỉ ra dữ liệu nào lấy live từ API ngoài vs lưu trong DB sở hữu, lớp cache + TTL nếu có.}
95
90
 
96
- ### 2.2 Communication Patterns
91
+ ### 2.2 Mẫu giao tiếp (Communication Patterns)
97
92
 
98
- | Pattern | Usage | Scope (UC/SC) |
93
+ | Mẫu | Dùng cho | Phạm vi (UC/SC) |
99
94
  |---------|-------|---------------|
100
95
  | {Client → Gateway → API} | {auth / action} | {UC1} |
101
- | {API → External API} | {what it fetches, cache TTL} | {UC1-SC…} |
96
+ | {API → API ngoài} | {lấy gì, cache TTL} | {UC1-SC…} |
102
97
 
103
98
  ---
104
99
 
105
- ## 3. Data Model
100
+ ## 3. Mô hình Dữ liệu (Data Model)
106
101
 
107
- <!-- Source: core-entities.md (owned entities) + BDD Then-clauses (state) + PRD.
108
- Distinguish OWNED entities (in the DB) from API-SOURCED models (fetched
109
- live, not persisted). List only fields this PRD reads or writes. -->
102
+ <!-- Nguồn: core-entities.md (entity sở hữu) + mệnh đề Then của BDD (state) + PRD.
103
+ Phân biệt entity SỞ HỮU (trong DB) với model NGUỒN-API (lấy live, không lưu).
104
+ Chỉ liệt field PRD này đọc hoặc ghi. -->
110
105
 
111
- ### 3.1 Entity Design
106
+ ### 3.1 Thiết kế Entity (Entity Design)
112
107
 
113
- #### {EntityName} ({DB entity | API-sourced POCO})
108
+ #### {EntityName} ({DB entity | POCO nguồn-API})
114
109
 
115
- {One line: what it represents, and whether it is persisted or fetched live.}
110
+ {Một dòng: biểu diễn gì, được lưu hay lấy live.}
116
111
 
117
- | Field | Type | Usage in {TICKET-ID} |
112
+ | Field | Kiểu | Dùng trong {TICKET-ID} |
118
113
  |-------|------|----------------------|
119
- | `{field}` | `{type}` | {how this feature uses itread/write, which SC} |
114
+ | `{field}` | `{type}` | {feature này dùng thế nàođọc/ghi, SC nào} |
120
115
 
121
- <!-- Repeat per entity. If the feature has meaningful state transitions, add a
122
- small state table/diagram like below. -->
116
+ <!-- Lặp lại cho mỗi entity. Nếu feature chuyển trạng thái đáng kể, thêm bảng/sơ đồ
117
+ state nhỏ như dưới. -->
123
118
 
124
- **State transitions (if any):**
119
+ **Chuyển trạng thái (nếu ):**
125
120
 
126
121
  ```
127
- {state A}: {condition} → {outcome / UI signal}
128
- {state B}: {condition} → {outcome}
122
+ {state A}: {điều kiện} → {kết quả / tín hiệu UI}
123
+ {state B}: {điều kiện} → {kết quả}
129
124
  ```
130
125
 
131
- **Constraints:**
132
- - {invariant enforced in application/DB logic, e.g. exactly one primary per tenant}
126
+ **Ràng buộc:**
127
+ - {invariant enforce tầng application/DB, vd đúng một primary cho mỗi tenant}
133
128
 
134
- ### 3.2 Entity Relationships
129
+ ### 3.2 Quan hệ Entity (Entity Relationships)
135
130
 
136
131
  ```
137
- {relationship diagramcardinalities, join keys, which fields are read-only vs owned}
132
+ { đồ quan hệ cardinality, khoá join, field nào read-only vs sở hữu}
138
133
  ```
139
134
 
140
- ### 3.3 Data Source Boundaries
135
+ ### 3.3 Ranh giới Nguồn dữ liệu (Data Source Boundaries)
141
136
 
142
- <!-- Crisp statement of what THIS PRD reads vs writes, and what is delegated
143
- elsewhere. Prevents scope bleed. -->
137
+ <!-- Phát biểu gọn PRD NÀY đọc vs ghi gì, cái gì được uỷ thác nơi khác.
138
+ Chống lem phạm vi. -->
144
139
 
145
- **{TICKET-ID} scope: {READ … / WRITE …}.**
140
+ **Phạm vi {TICKET-ID}: {ĐỌC … / GHI …}.**
146
141
 
147
- | Responsibility | In scope? | Handled by |
142
+ | Trách nhiệm | Trong phạm vi? | Do ai xử lý |
148
143
  |----------------|-----------|-----------|
149
- | {read merged list} | ✅ Yes | {endpoint / service} |
150
- | {write X flag} | ✅ Yes | {service} |
151
- | {base data} | ❌ Read-only | {external API + cache} |
152
- | {other module concern} | ❌ No | {module/team} |
144
+ | {đọc list đã gộp} | ✅ | {endpoint / service} |
145
+ | {ghi cờ X} | ✅ | {service} |
146
+ | {dữ liệu gốc} | ❌ Read-only | {API ngoài + cache} |
147
+ | {mối lo module khác} | ❌ Không | {module/team} |
153
148
 
154
149
  ### 3.4 Multi-tenant & Sharding
155
150
 
156
- <!-- Only if the project is multi-tenant. Else write "N/A — single tenant". -->
151
+ <!-- Chỉ khi dự án multi-tenant. Nếu không, viết "N/A — single tenant". -->
157
152
 
158
- - {tenant key on entities, query-filter isolation, shard resolution from architecture.md}
153
+ - {khoá tenant trên entity, cách ly bằng query-filter, phân giải shard — từ architecture.md}
159
154
 
160
155
  ---
161
156
 
162
- ## 4. API Contracts
157
+ ## 4. Hợp đồng API (API Contracts)
163
158
 
164
- <!-- Backend contract. For greenfield: design endpoints from BDD scenarios. For
165
- brownfield (@trace.api_source = existing): reverse-document the live API
166
- as-is and note gaps vs BDD expectations. Mark REUSE vs NEW explicitly.
167
- CLIENT-ONLY PRD (no system/ BDD this feature owns no backend): do NOT
168
- fabricate a BE contract. §4.1 then lists the endpoints the client CONSUMES
169
- (external / third-party / another team's / existing), marked "consumed
170
- (external)", reverse-documented from the client BDD Then-clauses + PRD;
171
- fill §4.2/§4.3 only if the shape is known. If the feature makes no network
172
- calls at all write "N/A client-only, no backend". §4.5.4 maps client
173
- methods to whatever §4.1 lists (or none). -->
159
+ <!-- Contract backend. Greenfield: thiết kế endpoint từ scenario BDD. Brownfield
160
+ (@trace.api_source = existing): reverse-document API đang chạy as-is và ghi chú
161
+ gap so với kỳ vọng BDD. Đánh dấu REUSE vs NEW rõ ràng.
162
+ PRD CHỈ-CLIENT (không có BDD system/ — feature này không sở hữu backend): ĐỪNG
163
+ bịa contract BE. §4.1 khi đó liệt các endpoint mà client TIÊU THỤ (ngoài /
164
+ bên thứ ba / của team khác / có sẵn), đánh dấu "consumed (external)",
165
+ reverse-document từ mệnh đề Then của BDD client + PRD; chỉ điền §4.2/§4.3 nếu
166
+ biết shape. Nếu feature không gọi mạng cả viết "N/A — client-only, no backend".
167
+ §4.5.4 ánh xạ method client tới bất cứ §4.1 liệt kê (hoặc không có). -->
174
168
 
175
169
 
176
170
  ### 4.1 Endpoints
177
171
 
178
172
  ```
179
- {METHOD} {/path} # NEW | REUSE ({source}) — {one-line purpose}
173
+ {METHOD} {/path} # NEW | REUSE ({nguồn}) — {mục đích một dòng}
180
174
  ```
181
175
 
182
- ### 4.2 Request/Response Models
176
+ ### 4.2 Model Request/Response (Request/Response Models)
183
177
 
184
- <!-- Show DTO shapes in the stack's idiom. Note which fields come from DB vs
185
- external API. -->
178
+ <!-- Thể hiện shape DTO theo idiom của stack. Ghi field nào đến từ DB vs API ngoài. -->
186
179
 
187
180
  ```{lang}
188
- {DTO definitions with per-field source comments}
181
+ {định nghĩa DTO kèm comment nguồn từng field}
189
182
  ```
190
183
 
191
- ### 4.3 Validation & Error Codes
184
+ ### 4.3 Validation & Mã lỗi (Validation & Error Codes)
192
185
 
193
- **Validation rules:**
186
+ **Quy tắc validation:**
194
187
 
195
188
  ```{lang}
196
- {validation rules, in the stack's idiom (e.g. FluentValidation / class-validator)}
189
+ {quy tắc validation, theo idiom stack (vd FluentValidation / class-validator)}
197
190
  ```
198
191
 
199
- | Code | HTTP Status | Description | Trace |
192
+ | Code | HTTP Status | tả | Trace |
200
193
  |------|-------------|-------------|-------|
201
- | `{ERROR_CODE}` | {4xx/5xx} | {when it fires} | {UC1-SC…} |
194
+ | `{ERROR_CODE}` | {4xx/5xx} | {khi nào phát sinh} | {UC1-SC…} |
202
195
 
203
- ### 4.4 Handler Logic (key endpoints)
196
+ ### 4.4 Logic Handler (endpoint chính)
204
197
 
205
- <!-- For non-trivial writes, spell out the ordered steps (validation →
206
- transaction → commit/rollback → return). Keeps the sequence diagram and
207
- the code aligned. -->
198
+ <!-- Với các thao tác ghi không tầm thường, viết các bước thứ tự (validation →
199
+ transaction → commit/rollback → return). Giữ sequence diagram và code khớp nhau. -->
208
200
 
209
201
  **{HandlerName}:**
210
- 1. {step}
211
- 2. {step — transaction boundary if any}
202
+ 1. {bước}
203
+ 2. {bướcranh giới transaction nếu }
212
204
 
213
- ### 4.5 UI Component Mapping — {platform} ({framework})
205
+ ### 4.5 Ánh xạ Component UI (UI Component Mapping) — {platform} ({framework})
214
206
 
215
- <!-- CLIENT design, GROUPED BY PLATFORM: one "### 4.5 … — {platform}" section per
216
- client platform present in the BDD (a web group, an app group). Do NOT title
217
- this heading by screenscreens/UCs live in the sub-blocks below.
218
- Inside a platform group:
219
- • §4.5.1 Component Hierarchy repeat the sub-block per screen/UC:
220
- "#### 4.5.1.x {Screen} — {UC}". A PRD with many screens/UCsmany sub-blocks
221
- in the SAME platform group (never a second 4.5 group for the same platform).
222
- • §4.5.2–§4.5.5 — likewise per screen/UC where they differ.
223
- • §4.5.6 Test Selectors — ONE shared table for the whole platform group; its
224
- "Serves SC" column carries (UC · SC) so per-UC consumers filter their rows.
225
- Append: new platform → new "### 4.5 — {platform}" group; new screen/UC in an
226
- existing platform → add a sub-block + rows to §4.5.6 (don't duplicate the group).
227
- Omit §4.5 entirely for a backend-only PRD. -->
207
+ <!-- Thiết kế CLIENT, NHÓM THEO PLATFORM: một section "### 4.5 … — {platform}" cho mỗi
208
+ platform client trong BDD (một nhóm web, một nhóm app). ĐỪNG đặt tên heading
209
+ này theo màn hìnhmàn hình/UC nằm các sub-block bên dưới.
210
+ Bên trong một nhóm platform:
211
+ • §4.5.1 Cây Component — lặp sub-block theo màn hình/UC:
212
+ "#### 4.5.1.x {Screen} — {UC}". Một PRD nhiều màn hình/UCnhiều sub-block
213
+ trong CÙNG nhóm platform (không bao giờ tạo nhóm 4.5 thứ hai cho cùng platform).
214
+ • §4.5.2–§4.5.5 — tương tự theo màn hình/UC chỗ chúng khác nhau.
215
+ • §4.5.6 Test Selectors — MỘT bảng dùng chung cho cả nhóm platform; cột
216
+ "Phục vụ SC" mang (UC · SC) để consumer per-UC lọc row của mình.
217
+ Append: platform mới nhóm "### 4.5 — {platform}" mới; màn hình/UC mới trong
218
+ platform đã có thêm sub-block + row vào §4.5.6 (đừng lặp nhóm).
219
+ Bỏ hẳn §4.5 với PRD backend-only. -->
228
220
 
229
- > **Source:** {Figma file + node id, from design-spec}
230
- > **Stack:** {framework, state primitive, component library}
231
- > <!-- @figma.url: {node-level figma url} -->
221
+ > **Nguồn:** {file Figma + node id, từ design-spec}
222
+ > **Stack:** {framework, state primitive, thư viện component}
223
+ > <!-- @figma.url: {url figma cấp node} -->
232
224
 
233
- #### 4.5.1 Component Hierarchy — {Screen} ({UC})
225
+ #### 4.5.1 Cây Component (Component Hierarchy) — {Screen} ({UC})
234
226
 
235
- <!-- Repeat this sub-block per screen/UC in this platform group (4.5.1.a, 4.5.1.b …). -->
227
+ <!-- Lặp sub-block này theo màn hình/UC trong nhóm platform này (4.5.1.a, 4.5.1.b …). -->
236
228
 
237
229
  ```
238
- {component tree — container vs presentational, conditional children}
230
+ {cây component — container vs presentational, con có điều kiện}
239
231
  ```
240
232
 
241
- #### 4.5.2 Component File Mapping
233
+ #### 4.5.2 Ánh xạ file Component (Component File Mapping)
242
234
 
243
- | Component | Path | Type | Purpose |
235
+ | Component | Path | Loại | Trách nhiệm |
244
236
  |-----------|------|------|---------|
245
- | `{Component}` | `{path}` | {Feature/Child} | {responsibility} |
237
+ | `{Component}` | `{path}` | {Feature/Child} | {trách nhiệm} |
246
238
 
247
- #### 4.5.3 State Management ({state primitive})
239
+ #### 4.5.3 Quản lý State (State Management) ({state primitive})
248
240
 
249
- <!-- State shape derived from System BDD Then-clauses + response shapes from §4.2.
250
- Show derived/computed values and their inputs. -->
241
+ <!-- Shape state suy từ mệnh đề Then của System BDD + shape response từ §4.2.
242
+ Thể hiện giá trị dẫn xuất/tính toán input của chúng. -->
251
243
 
252
244
  ```{lang}
253
- {state declarations with source comments (which BDD field / BE field each maps to)}
245
+ {khai báo state kèm comment nguồn (mỗi cái map tới field BDD / field BE nào)}
254
246
  ```
255
247
 
256
- #### 4.5.4 API Integration Layer (port/adapter)
248
+ #### 4.5.4 Tầng tích hợp API (API Integration Layer port/adapter)
257
249
 
258
- <!-- Modal/route config + API-integration map: each client service methoda
259
- REAL endpoint from §4.1 (do not invent endpoints). Error → UI state per SC.
260
- This table is what /generate-code --phase=integration reads to wire the real adapter. -->
250
+ <!-- Cấu hình modal/route + bản đồ tích hợp API: mỗi method service clientmột
251
+ endpoint THẬT từ §4.1 (đừng bịa endpoint). Lỗistate UI theo từng SC.
252
+ Bảng này thứ /generate-code --phase=integration đọc để wire adapter thật. -->
261
253
 
262
- | Client method | Endpoint (§4.1) | Request map | Response → model | Error → UI |
254
+ | Method client | Endpoint (§4.1) | Map request | Response → model | Lỗi → UI |
263
255
  |---------------|-----------------|-------------|------------------|-----------|
264
256
  | {svc.getX()} | {GET /…} | {params} | {DTO → ViewModel} | {4xx → state/toast} |
265
257
 
266
- #### 4.5.5 Figma → Design System Mapping
258
+ #### 4.5.5 Ánh xạ Figma → Design System
267
259
 
268
- | Figma element | Design system class/token | Notes |
260
+ | Element Figma | Class/token design system | Ghi chú |
269
261
  |---------------|---------------------------|-------|
270
- | {element} | {class / token} | {size, color, state} |
262
+ | {element} | {class / token} | {size, màu, state} |
271
263
 
272
- #### 4.5.6 Test Selectors — element IDs for actionable elements (QC contract)
264
+ #### 4.5.6 Test Selectors — id element cho phần tử action (hợp đồng QC)
273
265
 
274
- <!-- Stable test-id per interactive element so QC locates directly (no runtime
275
- scan). Convention: {uc-lower}-{screen}-{element}-{type}; DO NOT embed
276
- scenario numbers. Attribute per platform: web data-testid · RN testID ·
277
- Flutter Key/Semantics · iOS accessibilityIdentifier. Reuse the same id
278
- VALUE across web/app for the same logical element.
279
- ONE shared table for the whole platform group (covers every screen/UC of this
280
- platform). The "Serves SC" column carries (UC · SC) so a per-UC consumer
281
- (generate-code / qc) filters to its own rows via §10. This §4.5 group is
282
- already platform-scoped, so the platform is implicit (web block → web · SC). -->
266
+ <!-- Test-id ổn định cho mỗi element tương tác để QC định vị trực tiếp (không scan
267
+ runtime). Quy ước: {uc-lower}-{screen}-{element}-{type}; ĐỪNG nhúng số scenario.
268
+ Attribute theo platform: web data-testid · RN testID · Flutter Key/Semantics ·
269
+ iOS accessibilityIdentifier. Dùng lại CÙNG giá trị id trên web/app cho cùng một
270
+ element logic.
271
+ MỘT bảng dùng chung cho cả nhóm platform (phủ mọi màn hình/UC của platform này).
272
+ Cột "Phục vụ SC" mang (UC · SC) để consumer per-UC (generate-code / qc) lọc row
273
+ của mình qua §10. Nhóm §4.5 này vốn đã theo platform, nên platform là ngầm định
274
+ (khối web → web · SC). -->
283
275
 
284
- | Test-ID | Element | Component (§4.5.1.x) | Action | Serves SC (UC · SC) |
276
+ | Test-ID | Element | Component (§4.5.1.x) | Action | Phục vụ SC (UC · SC) |
285
277
  |---------|---------|----------------------|--------|---------------------|
286
- | `{uc}-{screen}-{element}-{type}` | {Submit button} | {Component} | {submit} | {UC1 · SC1, UC1 · SC3} |
278
+ | `{uc}-{screen}-{element}-{type}` | {Nút submit} | {Component} | {submit} | {UC1 · SC1, UC1 · SC3} |
287
279
 
288
280
  ---
289
281
 
290
- ## 5. Key Flows (Sequence Diagrams)
282
+ ## 5. Luồng chính (Key Flows Sequence Diagrams)
291
283
 
292
- <!-- ONE mermaid sequence diagram per meaningful scenario. Participants span tiers:
293
- client component → service → API → external API → DB.
294
- ⚠ SC ids are unique only within (UC × platform): `{UC}-SC1` on `system` and
295
- `{UC}-SC1` on `web` are DIFFERENT scenarios. So group flows into PLATFORM LANES
296
- (5.A system · 5.B web · 5.C app) and ALWAYS pair the SC with its platform,
297
- e.g. "(web · UC1-SC1)". Never write a bare "UC1-SC1" hereit is ambiguous.
298
- Only include the lanes whose BDD exists in this PRD. -->
284
+ <!-- MỘT mermaid sequence diagram cho mỗi scenario đáng kể. Participant xuyên tầng:
285
+ component client → service → API → API ngoài → DB.
286
+ id SC chỉ duy nhất trong phạm vi (UC × platform): `{UC}-SC1` `system`
287
+ `{UC}-SC1` `web` HAI scenario KHÁC nhau. Nên gom luồng vào các LANE PLATFORM
288
+ (5.A system · 5.B web · 5.C app) LUÔN ghi kèm platform với SC, vd
289
+ "(web · UC1-SC1)". Đừng bao giờ viết "UC1-SC1" trơ ở đây hồ.
290
+ Chỉ đưa các lane BDD tồn tại trong PRD này. -->
299
291
 
300
- ### 5.A System flows
292
+ ### 5.A Luồng System
301
293
 
302
- <!-- One diagram per system-BDD scenario. Skip this lane if no system/ BDD. -->
294
+ <!-- Một diagram cho mỗi scenario system-BDD. Bỏ lane này nếu không BDD system/. -->
303
295
 
304
- #### 5.A.1 {name} (system · {UC}-SC…)
296
+ #### 5.A.1 {tên} (system · {UC}-SC…)
305
297
 
306
298
  ```mermaid
307
299
  sequenceDiagram
@@ -309,147 +301,147 @@ sequenceDiagram
309
301
  {…}
310
302
  ```
311
303
 
312
- ### 5.B Web flows
304
+ ### 5.B Luồng Web
313
305
 
314
- <!-- One diagram per web-BDD scenario. Skip this lane if no web/ BDD. -->
306
+ <!-- Một diagram cho mỗi scenario web-BDD. Bỏ lane này nếu không BDD web/. -->
315
307
 
316
- #### 5.B.1 {name} (web · {UC}-SC…)
308
+ #### 5.B.1 {tên} (web · {UC}-SC…)
317
309
 
318
310
  ```mermaid
319
311
  sequenceDiagram
320
312
  {…}
321
313
  ```
322
314
 
323
- ### 5.C App flows
315
+ ### 5.C Luồng App
324
316
 
325
- <!-- One diagram per app-BDD scenario. Skip this lane if no app/ BDD. -->
317
+ <!-- Một diagram cho mỗi scenario app-BDD. Bỏ lane này nếu không BDD app/. -->
326
318
 
327
- #### 5.C.1 {name} (app · {UC}-SC…)
319
+ #### 5.C.1 {tên} (app · {UC}-SC…)
328
320
 
329
321
  ```mermaid
330
322
  sequenceDiagram
331
323
  {…}
332
324
  ```
333
325
 
334
- <!-- Number within each lane: 5.A.1, 5.A.2 … / 5.B.1 … / 5.C.1 …. For a scenario
335
- whose effect crosses into another module, note "(covered by {OTHER-UC})". -->
326
+ <!-- Đánh số trong từng lane: 5.A.1, 5.A.2 … / 5.B.1 … / 5.C.1 …. Với scenario
327
+ hiệu ứng lấn sang module khác, ghi "(covered by {OTHER-UC})". -->
336
328
 
337
- **Key integration points (optional table per flow):**
329
+ **Điểm tích hợp chính (bảng tuỳ chọn cho mỗi luồng):**
338
330
 
339
- | Step | State transition | Verified by (platform · SC) |
331
+ | Bước | Chuyển trạng thái | Verify bởi (platform · SC) |
340
332
  |------|------------------|-----------------------------|
341
- | {step} | {beforeafter} | {web · UC1-SC…} |
333
+ | {bước} | {trướcsau} | {web · UC1-SC…} |
342
334
 
343
335
  ---
344
336
 
345
- ## 6. Integration Points
337
+ ## 6. Điểm tích hợp (Integration Points)
346
338
 
347
- | Integration | Direction | Method | Description |
339
+ | Tích hợp | Chiều | Phương thức | tả |
348
340
  |-------------|-----------|--------|-------------|
349
- | {Client → API} | Outbound (client) | {REST/Bearer} | {what} |
350
- | {API → External} | Outbound (server) | {REST + header} | {what, cache TTL} |
341
+ | {Client → API} | Outbound (client) | {REST/Bearer} | {} |
342
+ | {API → Ngoài} | Outbound (server) | {REST + header} | {gì, cache TTL} |
351
343
 
352
344
  ### 6.1 Event Bus / Messaging
353
345
 
354
- <!-- Kafka/queue events produced/consumed by this feature. "N/A — no events" if none. -->
346
+ <!-- Event Kafka/queue feature này produce/consume. "N/A — no events" nếu không có. -->
355
347
 
356
- {events, or N/A}
348
+ {events, hoặc N/A}
357
349
 
358
- ### 6.2 Cross-Service Dependencies
350
+ ### 6.2 Phụ thuộc Cross-Service (Cross-Service Dependencies)
359
351
 
360
- | Dependent service | What's needed | Contract | Status |
352
+ | Service phụ thuộc | Cần | Contract | Trạng thái |
361
353
  |-------------------|---------------|----------|--------|
362
- | {service} | {need} | {endpoint} | {✅ Exists / ⚠️ pending} |
354
+ | {service} | {cần} | {endpoint} | {✅ / ⚠️ pending} |
363
355
 
364
356
  ---
365
357
 
366
- ## 7. Security & Authorization
358
+ ## 7. Bảo mật & Phân quyền (Security & Authorization)
367
359
 
368
- ### 7.1 Authentication
360
+ ### 7.1 Xác thực (Authentication)
369
361
 
370
- {Auth flow + token type/TTL. Source: PRD auth + project rules.}
362
+ {Luồng auth + loại token/TTL. Nguồn: auth PRD + rule dự án.}
371
363
 
372
- ### 7.2 Authorization Rules
364
+ ### 7.2 Quy tắc Phân quyền (Authorization Rules)
373
365
 
374
- | Action | Required role/permission | Description | Trace |
366
+ | Action | Role/quyền yêu cầu | tả | Trace |
375
367
  |--------|--------------------------|-------------|-------|
376
- | {action} | {role} | {how enforced, where} | {UC1-SC… / out of scope} |
368
+ | {action} | {role} | {enforce thế nào, ở đâu} | {UC1-SC… / ngoài phạm vi} |
377
369
 
378
370
  ---
379
371
 
380
- ## 8. Error Handling & Edge Cases
372
+ ## 8. Xử lý lỗi & Trường hợp biên (Error Handling & Edge Cases)
381
373
 
382
- <!-- One row per error / edge / negative scenario in the BDD. This must line up
383
- with §4.3 error codes and the §5 error sequence diagrams. -->
374
+ <!-- Một row cho mỗi scenario lỗi / biên / âm trong BDD. Phải khớp với mã lỗi §4.3
375
+ các sequence diagram lỗi §5. -->
384
376
 
385
- | Scenario | Strategy | Details | Trace |
377
+ | Scenario | Chiến lược | Chi tiết | Trace |
386
378
  |----------|----------|---------|-------|
387
- | {condition} | {approach} | {behavior, message, side effect} | {UC1-SC…, BR…} |
379
+ | {điều kiện} | {cách xử lý} | {hành vi, message, side effect} | {UC1-SC…, BR…} |
388
380
 
389
381
  ---
390
382
 
391
- ## 9. Design Decisions
383
+ ## 9. Quyết định Thiết kế (Design Decisions)
392
384
 
393
- <!-- The "why" behind non-obvious choices, with alternatives considered. Source:
394
- PRD alternatives/assumptions + reasoning during generation. This is what lets
395
- a reviewer trust the design. -->
385
+ <!-- Cái "vì sao" đằng sau các lựa chọn không hiển nhiên, kèm phương án đã cân nhắc.
386
+ Nguồn: alternatives/assumptions của PRD + lập luận lúc sinh. Đây thứ giúp
387
+ reviewer tin tưởng thiết kế. -->
396
388
 
397
- | # | Decision | Rationale | Alternatives considered |
389
+ | # | Quyết định | do | Phương án đã cân nhắc |
398
390
  |---|----------|-----------|-------------------------|
399
- | 1 | **{decision}** | {why} | {altwhy rejected} |
391
+ | 1 | **{quyết định}** | {vì sao} | {phương án sao loại} |
400
392
 
401
- ### NFR-to-Design Mapping
393
+ ### Ánh xạ NFR → Thiết kế (NFR-to-Design Mapping)
402
394
 
403
- | NFR category | PRD requirement | Design decision |
395
+ | Nhóm NFR | Yêu cầu PRD | Quyết định thiết kế |
404
396
  |--------------|-----------------|-----------------|
405
- | {e.g. Multi-tenant isolation} | {requirement} | {mechanism} |
397
+ | {vd Cách ly multi-tenant} | {yêu cầu} | {cơ chế} |
406
398
 
407
399
  ---
408
400
 
409
- ## 10. UC Coverage
401
+ ## 10. Độ phủ UC (UC Coverage)
410
402
 
411
- <!-- THE APPEND ANCHOR **and the INDEX for per-UC consumers**. Every UC of the PRD
412
- gets a row; every scenario maps to the section(s) that design it.
413
- - /generate-tech-docs uses it to detect what is already covered vs missing.
414
- - /generate-code, /map-testids, /qc-* work on ONE UC of a PRD-level doc they
415
- look this UC up HERE first to locate its scenariosthe sections/§5-lanes
416
- (and thus the §4.1 endpoints its §5 flows call) that belong to it. Don't
417
- pull another UC's endpoints/sections.
418
- Scenario coverage is keyed by (platform, SC) because SC ids repeat across
419
- platforms the Platform column disambiguates. -->
403
+ <!-- ĐIỂM NEO ĐỂ APPEND ** MỤC LỤC cho consumer per-UC**. Mọi UC của PRD có một
404
+ row; mọi scenario map tới (các) section thiết kế nó.
405
+ - /generate-tech-docs dùng để phát hiện cái đã phủ vs còn thiếu.
406
+ - /generate-code, /map-testids, /qc-* làm việc trên MỘT UC của doc cấp-PRD — chúng
407
+ tra UC này ĐÂY trước để định vị scenario của nó các section/lane-§5 (và do đó
408
+ các endpoint §4.1 luồng §5 của nó gọi) thuộc về nó. Đừng lấy
409
+ endpoint/section của UC khác.
410
+ Độ phủ scenario khoá theo (platform, SC) id SC lặp giữa các platform —
411
+ cột Platform để phân biệt. -->
420
412
 
421
- | UC | Feature | Platforms | Sections covered | Status |
413
+ | UC | Feature | Platforms | Section phủ | Trạng thái |
422
414
  |----|---------|-----------|------------------|--------|
423
415
  | {TICKET-ID}-UC1 | {title} | {system, web, app} | §… | ✅ Covered |
424
416
 
425
- ### UC1 Scenario Coverage
417
+ ### Độ phủ Scenario UC1
426
418
 
427
- <!-- One row per (platform, SC). Same SC number on different platforms = different
428
- scenariosseparate rows. -->
419
+ <!-- Một row cho mỗi (platform, SC). Cùng số SC platform khác nhau = scenario khác
420
+ nhaurow riêng. -->
429
421
 
430
422
  | Platform | Scenario | Section | Business rule |
431
423
  |----------|----------|---------|---------------|
432
- | system | {UC}-SC1: {name} | §5.A.1 | {BR…} |
433
- | web | {UC}-SC1: {name} | §4.5 (web), §5.B.1 | {BR…} |
424
+ | system | {UC}-SC1: {tên} | §5.A.1 | {BR…} |
425
+ | web | {UC}-SC1: {tên} | §4.5 (web), §5.B.1 | {BR…} |
434
426
 
435
- <!-- Repeat a scenario-coverage block per UC. -->
427
+ <!-- Lặp một khối scenario-coverage cho mỗi UC. -->
436
428
 
437
429
  ---
438
430
 
439
- ## 11. Cross-cutting & Assumptions (Out-of-Scope Reference)
431
+ ## 11. Cross-cutting & Giả định (Tham chiếu ngoài phạm vi)
440
432
 
441
- <!-- Upstream concerns this PRD DEPENDS ON but does not implement (admin gate,
442
- downstream UI in another module, order snapshotting…). Keep for cross-team
443
- context. Reference the owning UC/team + doc. Source: PRD out-of-scope +
444
- BDD BR "out of scope" notes. -->
433
+ <!-- Các mối lo upstream mà PRD này PHỤ THUỘC VÀO nhưng không implement (cổng admin,
434
+ UI downstream module khác, snapshot đơn hàng…). Giữ để có bối cảnh liên team.
435
+ Tham chiếu UC/team sở hữu + doc. Nguồn: out-of-scope của PRD + ghi chú BR
436
+ "out of scope" trong BDD. -->
445
437
 
446
- ### 11.1 {Concern}
438
+ ### 11.1 {Mối lo}
447
439
 
448
- > {Quote the BDD/PRD line that scopes it out.}
440
+ > {Trích câu BDD/PRD đã scope ra ngoài.}
449
441
 
450
- {Explanation of the boundary + a reference sequence diagram if useful.}
442
+ {Giải thích ranh giới + một sequence diagram tham chiếu nếu hữu ích.}
451
443
 
452
- **Owned by:** {team / module}. See {link}.
444
+ **Sở hữu bởi:** {team / module}. Xem {link}.
453
445
 
454
446
  ---
455
447
 
@@ -482,9 +474,9 @@ sequenceDiagram
482
474
 
483
475
  ---
484
476
 
485
- ## Figma Design References
477
+ ## Tham chiếu Thiết kế Figma (Figma Design References)
486
478
 
487
- <!-- @figma.url: {node-level figma url per screen} -->
479
+ <!-- @figma.url: {url figma cấp node cho mỗi màn hình} -->
488
480
  - {Screen}: [Figma — {frame}]({url})
489
481
  - Exported: {YYYY-MM-DD}
490
482
 
@@ -492,7 +484,7 @@ sequenceDiagram
492
484
 
493
485
  ## Changelog
494
486
 
495
- | Revision | Date | Changes |
487
+ | Revision | Ngày | Thay đổi |
496
488
  |----------|------|---------|
497
- | 1 | {YYYY-MM-DD} | Initial generation from {TICKET-ID} BDD (v{bdd_version}): {list UCs covered} |
498
- <!-- On append: add a row per extension, e.g. "2 | {date} | Added UC3 (§5.9, §10) from new BDD v{n}" -->
489
+ | 1 | {YYYY-MM-DD} | Sinh lần đầu từ BDD {TICKET-ID} (v{bdd_version}): {liệt UC đã phủ} |
490
+ <!-- Khi append: thêm một row cho mỗi lần mở rộng, vd "2 | {ngày} | Thêm UC3 (§5.9, §10) từ BDD mới v{n}" -->