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
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ẽ.
docs/saas-architecture.md, cần ~10 tuần dev (Phase A-H) để code.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
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
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
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)
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
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
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
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
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
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
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
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
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
Đã 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
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
Schema design xong trong docs/saas-architecture.md §3. Cần thêm tenant_id vào 15 bảng + Postgres RLS + Prisma middleware.
Hiện chưa có authentication. Mọi endpoint API đều mở. Cần invite flow + tenant switcher.
Hiện đang đọc từ file YAML chung. Cần move sang DB tables + override per tenant.
4 plan đề xuất (Starter/Growth/Scale/Enterprise). Cần Stripe/Paddle + token usage tracking + plan enforcement.
Sinh video factory tour, case study, social short. Cần template Remotion, voiceover ElevenLabs, caption Whisper.
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).
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.
Weekly keyword research → content gap analysis → tạo brief → Content Agent draft → push to website repo (PR).
Account-based outreach script + connection request + follow-up sequence. Cần LinkedIn API hoặc Sales Navigator integration.
Template-based: input campaign goal → AI sinh copy + hero image → render Next.js page → preview deploy → approve → publish.