thread-master/docs/product/demand-radar/tasks/T588-ai-followup-message-ge...

50 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# T588 — ai-followup-message-generation
> Status: `done`
> Milestone: `M5`
> Kind: `feat`
> Est. change: `~140 lines`
## Goal
完成後系統應:可在 Contact 上產生 AI 追蹤訊息,計入 `ai_copy``source=radar.followup`,且同樣受 `forbidden[]` 過濾。
## Depends on
- T510、T587
## Inputs
- Spec`../spec.md` §4.7.3、§5.5、§9.4FU-02
- 既有T549 的 `forbidden_filter.go`
## Outputs
### 程式變更(預期路徑)
| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/backend/generate/api/crm.api` | edit | followup message 生成 reqresp |
| `apps/backend/internal/module/crm/usecase/followup_message.go` | add | 組 prompt原商機原文時間軸摘要ServiceProfile |
| `apps/backend/internal/logic/crm/createFollowupMessageLogic.go` | edit | 生成+扣點+錯誤映射 |
### 行為變更
- 復用 forbidden 過濾(命中重生一次,仍命中回明確錯誤且不輸出)。
- 生成結果寫一筆 `note` 型 touch記錄產出內容送出仍為人工。
- 計費:`ai_copy``source=radar.followup`。
## Out of scope
- 自動送出追蹤訊息(本輪不做)
## Acceptance
- [x] FU-02產出成功且 usage 記 `ai_copy``radar.followup`
- [x] forbidden 命中兩次回錯誤且無內容外洩
- [x] 指令:
```bash
cd apps/backend && go test ./internal/module/crm/... ./internal/logic/crm/... -count=1
```