# BA-Specs — Folder Structure

> **Managed by:** BA  
> **Organized by:** Output Type → Function-ID → Version  
> **Naming:** Function-ID format `F-001_User-Login`  
> **Note:** Templates are managed in a separate shared repo.

---

## Folder Tree

```
02.BA-Specs/
│
├── 00.Requirements/                    # Requirements Gathering
│   └── F-001_User-Login/
│       ├── Raw-Requirements_v1.md      # Raw input: ticket, meeting note, email
│       ├── System-Requirement_v2.md    # Dev-facing bridge doc (create-system-requirement task type)
│       └── assets/                     # Images, attachments, recordings
│
├── 01.Analysis/                        # Gate 1: Business Analysis
│   └── F-001_User-Login/
│       ├── Analysis_v1.md              # Current version
│       └── Analysis_v2.md              # Updated when requirements change
│
├── 02.QnA/                             # Gate 2: Q&A nội bộ với stakeholder
│   └── F-001_User-Login/
│       └── QnA-Log_v1.md               # Q&A loop until all Confirmed
│
├── 03.UI-Prototypes/                   # Gate 3: UI/UX Design
│   └── F-001_User-Login/
│       └── UI-Prototype_v1.html        # Static HTML/CSS prototype
│
└── 04.UC-Specs/                        # Gate 4: Final UC Specification
    └── F-001_User-Login/
        ├── UC-Spec_v2.md               # Current version (BA sign-off)
        └── _archive/
            └── UC-Spec_v1.md           # Previous versions
```

---

## File Naming Convention

| Element | Convention | Example |
|---|---|---|
| Section folder | `{N}.{Pascal-Case}/` | `00.Requirements/`, `03.UI-Prototypes/` |
| Feature folder | `F-{3-digit}_{Pascal-Case}/` | `F-001_User-Login/` |
| Requirements file | `Raw-Requirements_v{N}.md` | `Raw-Requirements_v1.md` |
| System Requirement file | `System-Requirement_v{N}.md` | `System-Requirement_v2.md` |
| Analysis file | `Analysis_v{N}.md` | `Analysis_v2.md` |
| QnA file | `QnA-Log_v{N}.md` | `QnA-Log_v1.md` |
| Prototype file | `UI-Prototype_v{N}.html` | `UI-Prototype_v1.html` |
| Spec file | `UC-Spec_v{N}.md` | `UC-Spec_v2.md` |
| Archive folder | `_archive/` | `04.UC-Specs/F-001-User-Login/_archive/` |

---

## Gate → Folder Mapping

| Gate | Output | Folder |
|---|---|---|
| Gate 1 | Phân tích sơ bộ + Q&A clarify | `00.Requirements/` + `01.Analysis/` |
| Gate 2 | Q&A loop → Confirmed | `02.QnA/` |
| Gate 3 | UI Prototype | `03.UI-Prototypes/` |
| Gate 4 | UC Spec hoàn chỉnh (BA ký off) | `04.UC-Specs/` |

---

## Function-List.md Template

```markdown
| F-ID  | Feature Name | BA     | Status      | Tickets            | Link Spec |
|-------|-------------|--------|-------------|-------------------|-----------|
| F-001 | User Login  | AnhNH  | Done        | #100, #145, #167  | [link]()  |
| F-002 | Dashboard   | LyLT   | In Progress | #110, #178        | [link]()  |
| F-003 | ...         | ...    | Not Started | -                 | -         |
```

---

## Rules

- Không tự sửa template — template nằm trong shared repo riêng
- Lưu tài liệu lên GitLab **sau khi Gate 4 được APPROVED**
- Thông báo cho Dev + Tester sau khi UC Spec sẵn sàng
- Không xóa file cũ — move vào `_archive/` khi có version mới
- `02.QnA/` là Q&A nội bộ với stakeholder — khác với `01.QnA/` ngoài dự án (dành cho khách hàng)
- `System-Requirement_v{N}.md` trong `00.Requirements/` do Dev viết (task type `create-system-requirement`, chạy 1 lần/functionId/UC Spec version), không phải do BA — `N` khớp đúng version của `UC-Spec_v{N}.md` mà nó trace tới, không phải bộ đếm riêng
