# 🚀 DOING: FAQ Knowledge Base + AI Variant Generator

## 📌 Context
- **Idea:** `plan/ideas/08_faq_knowledge_base.md`
- **Status:** 🚧 In Progress

## 📋 Execution Checklist

### Phase 1: Database
- [x] Task 1.1: Create `faqs` table in SQLite via `_ensure_faqs_table()`.
- [x] Task 1.2: Seed ~50-100 FAQ gốc về Canifa (chính sách, vận chuyển, đổi trả...).

### Phase 2: Backend API
- [x] Task 2.1: Create `faq_route.py` with CRUD endpoints (GET/POST/PUT/DELETE).
- [x] Task 2.2: Add `/api/faqs/generate-variants` endpoint (AI integration).
- [x] Task 2.3: Add `/api/faqs/stats` endpoint.
- [x] Task 2.4: Register router in `server.py`.

### Phase 3: Frontend
- [x] Task 3.1: Create `faqs/` directory with `faqs.html` + `faqs.js` + `faqs.css`.
- [x] Task 3.2: Add FAQ Manager link to sidebar in `main.html`.

### Phase 4: Verification
- [x] Task 4.1: curl test CRUD endpoints.
- [x] Task 4.2: curl test AI variant generation.

## ✅ Completion Gate
- [x] All tasks [x] | [x] Sub-Doings resolved | [x] Smoke test passed | [x] Trade-offs confirmed

---
_Started: 2026-04-28_
