Tình trạng tự động hoá

Trang này liệt kê THẲNG THẮN từng tính năng — cái nào đang chạy thật, cái nào còn mock, cái nào chưa code. Không tô vẽ.

Tóm tắt nhanh:

🟢 Đang chạy THẬT (production-grade — single tenant GAB)

Lead Engine API

Inquiry webhook → tạo Lead trong Postgres → tính điểm ICP → gán tier (Large/Mid/Small) → assign sales owner. Mọi action ghi event sourcing.

Verify bằng cách: curl POST /api/v1/webhooks/inquiry — DB sẽ có row mới + event lead.created

✅ Production live

Approval System (cấp A/B/C)

Submit approval → load matrix từ YAML → tính SLA deadline → publish Redis event → notify Telegram + Dashboard. Decide → update DB + sync UI.

Verify bằng cách: Mở /approvals/queue thấy 4 approval của GAB đã tạo trong test trước

✅ Production live

Telegram bot duyệt nội dung

Bot grammY polling, gửi approval card với inline keyboard ✅/❌. Callback gọi API decide, edit message để xoá button + hiện trạng thái.

Verify bằng cách: Group Telegram của bạn đã có 4 approval card, bấm thử Duyệt sẽ thấy realtime sync

✅ Production live

Content Agent (Anthropic Sonnet 4.6)

POST /api/v1/content/draft → call Anthropic API thật → return content. Tự động flag claim ngoài Brand Truth Library, auto-escalate Level C.

Verify bằng cách: Đã test 3 lần generate content cho GAB, output language theo market (US→English, JP→日本語, OTHER→tiếng Việt)

✅ Production live

CMO Daily Briefing + Weekly Analysis

Cron 8:00 sáng VN: scan KPI → call Opus 4.7 → sinh briefing → đẩy Telegram. Cron Monday 8:30: weekly analysis chi tiết hơn.

Verify bằng cách: Đợi mai 8h sáng VN — group Telegram sẽ nhận briefing tự động. Hoặc trigger manual qua POST /api/v1/reporting/daily

✅ Live (GAB tenant)

Sales Pipeline (Lead → RFQ → Sample → Contract → Revenue)

5 module với state machine + SLA timer + auto-create Account khi contract sign + Revenue track theo VND/USD.

Verify bằng cách: Mở /rfqs /samples /contracts /accounts — UI live data từ Postgres

✅ Live (GAB tenant)

Event Sourcing + Audit Log

Mọi action (human + AI agent) ghi event immutable vào table events. Replay được full history per entity.

Verify bằng cách: SELECT * FROM events trong Prisma Studio

✅ Production live

KPI Service + CMO Dashboard

Tính realtime: revenue vs target, pipeline coverage, funnel, conversion, customer concentration, channel ROI, warnings.

Verify bằng cách: Mở http://localhost:3000/dashboard

✅ Live (GAB tenant)

Early Warning System

Cron daily quét lead idle > 7 ngày, RFQ breach SLA → tự động tạo Risk record + alert. Master-rulebook.yaml định nghĩa ngưỡng.

Verify bằng cách: GET /api/v1/risks sau khi cron chạy

✅ Live (GAB tenant)

🟡 ĐANG MOCK — chỉ hoạt động ở mức UI demo

Onboarding Wizard 6 bước

Form + Excel upload + validate đã chạy đầy đủ. Nhưng dữ liệu chỉ lưu vào localStorage trình duyệt — KHÔNG persist vào Postgres, KHÔNG tạo tenant thật, KHÔNG kích hoạt agent thật.

Blocker: Cần Phase A của docs/saas-architecture.md: thêm Tenant model + multi-tenant infra trước

🧪 Mock UI

4 Agent Strategy (Market Research, Offer, Marketing, Task Distribution)

Animation 15 giây ở bước 7 là MOCK — không gọi Anthropic API. Output bước 8 là template tĩnh được adapt nhẹ theo thị trường.

Blocker: Cần Phase E của docs/saas-architecture.md: build 4 agent thật + Tavily web search tool + Temporal workflow orchestration

🧪 Mock UI

Market Sizing (TAM/SAM/SOM)

Số liệu hardcode theo market context (VN/USA/JP/EU). KHÔNG có nghiên cứu thị trường thật.

Blocker: Cần Tavily/Brave API + Market Research Agent gọi Anthropic Opus 4.7

🧪 Mock UI

Competitor Mapping

Nếu user nhập đối thủ thì hiện tên user nhập, NHƯNG mô tả vị thế/điểm yếu/cơ hội là template tĩnh.

Blocker: Cần web search + Anthropic phân tích từng đối thủ riêng

🧪 Mock UI

Channel Mix Recommendation

Đã adapt theo market (VN/USA/JP/EU) với channel list hardcode khác nhau. Bốn ngân sách là giả định template.

Blocker: Cần Marketing Strategy Agent + lịch sử performance để compute thật

🧪 Mock UI

Task Distribution (Kanban 4 lane)

14 task hiển thị là template hardcode, có thay tên sản phẩm theo input nhưng không lưu DB.

Blocker: Cần Task Distribution Agent + bảng projects/tasks trong DB

🧪 Mock UI

🔵 ĐÃ DESIGN, CHƯA CODE

Multi-tenant infra (Tenant model + RLS)

Schema design xong trong docs/saas-architecture.md §3. Cần thêm tenant_id vào 15 bảng + Postgres RLS + Prisma middleware.

📐 Đã design

NextAuth Google OAuth + RBAC

Hiện chưa có authentication. Mọi endpoint API đều mở. Cần invite flow + tenant switcher.

📐 Đã design

Per-tenant Brand Truth + Rulebook + Approval Matrix

Hiện đang đọc từ file YAML chung. Cần move sang DB tables + override per tenant.

📐 Đã design

Pricing & Billing

4 plan đề xuất (Starter/Growth/Scale/Enterprise). Cần Stripe/Paddle + token usage tracking + plan enforcement.

📐 Đã design

⚪ CHƯA START (Phase 4-5)

Video Agent (Remotion + ElevenLabs + Whisper)

Sinh video factory tour, case study, social short. Cần template Remotion, voiceover ElevenLabs, caption Whisper.

⚪ Chưa bắt đầu

Image Agent (Replicate Flux/SDXL)

Sinh ảnh AI cho product showcase, social content. 3 tier: Tier 1 (ảnh thật), Tier 2 (AI từ ảnh thật), Tier 3 (full AI).

⚪ Chưa bắt đầu

Meta Ads + Google Ads automation

CMO Agent đề xuất → user approve budget → tự tạo campaign qua Meta Marketing API + Google Ads API. Auto-pause khi CPA vượt 2x target.

⚪ Chưa bắt đầu

SEO Pipeline (Ahrefs + content cluster)

Weekly keyword research → content gap analysis → tạo brief → Content Agent draft → push to website repo (PR).

⚪ Chưa bắt đầu

LinkedIn Outreach Automation

Account-based outreach script + connection request + follow-up sequence. Cần LinkedIn API hoặc Sales Navigator integration.

⚪ Chưa bắt đầu

Landing Page Generator

Template-based: input campaign goal → AI sinh copy + hero image → render Next.js page → preview deploy → approve → publish.

⚪ Chưa bắt đầu

Bước tiếp theo bạn có thể chọn

  1. Stay single-tenant GAB: tiếp tục build Video Agent + Ads automation + SEO pipeline cho GAB (Phase 4-5 của CLAUDE.md §11).
  2. Pivot SaaS multi-tenant: bắt đầu Phase A của docs/saas-architecture.md (refactor tenant model + RLS + auth). Sau đó chuyển 4 agent strategy từ mock sang real (Phase E).
  3. Hybrid: refactor tenant model trước, GAB thành tenant đầu tiên, sau đó pause để hoàn thiện cho GAB rồi mới mở public.