thread-master/docs/product/demand-radar/tasks/T550-reply-send-outbox-heal...

52 lines
1.8 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.

# T550 — reply-send-outbox-health-gate
> Status: `done`
> Milestone: `M3`
> Kind: `feat`
> Est. change: `~180 lines`
## Goal
完成後系統應:公開留言版經**既有海巡外展Outbox** 送出且**必過 AccountHealth 送出閘**;私訊版只提供複製並標記完成。
## Depends on
- T549
## Inputs
- Spec`../spec.md` §4.5.6、§4.5.7、§9.3RP-04、RP-05、§6不新增繞過護欄路徑
- 既有:`apps/backend/internal/logic/outbox/**`、`internal/module/growth/**`AccountHealth 送出閘、scout 外展送出
## Outputs
### 程式變更(預期路徑)
| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/backend/internal/module/radar/usecase/reply_send.go` | add | 公開留言 → 既有 Outbox外展入口送前呼叫既有健康閘 |
| `apps/backend/generate/api/radar.api` | edit | 送出/標記已使用 request`channel=outbox|manual_copy` |
| `apps/backend/internal/logic/radar/sendOpportunityReplyLogic.go` | edit | 接線+錯誤映射;`MarkUsed` 記錄管道 |
### 行為變更
- `AccountHealth=warn`:可送但回應帶警示;`throttle`**拒絕自動送出**,只回手動路徑提示(沿用既有錯誤語意)。
- 私訊版(`dm`):不提供自動送出端點,只能 `channel=manual_copy` 標記;回應與文案不得宣稱已自動送出。
- Outbox 行為不變:僅平台成功後才 `published`RG-02
## Out of scope
- 前端複製與送出按鈕T552
- FollowUp 建立T585
## Acceptance
- [x] RP-04`throttle` 帳號自動送出被拒,手動路徑可用
- [x] RP-05`dm` 無自動送出路徑
- [x] RG-02Outbox 發布語意回歸測試通過
- [x] 指令:
```bash
cd apps/backend && go test ./internal/module/radar/... ./internal/logic/outbox/... -count=1
```