thread-master/docs/product/brand-product-radar/tasks/T772-outcome-event-product-...

48 lines
1.4 KiB
Markdown
Raw Normal View History

2026-08-13 02:22:24 +00:00
# T772 — outcome event product attribution
> Status: `todo`
> Milestone: `M7` · Phase D
> Kind: `feat` · Est. change: `~160 lines`
## Goal
成交回報保存成交當下 Product 歸屬,沿用既有 OutcomeEvent 且不改寫舊成交。
## Depends on
- T762、T771
## Inputs
- growth OutcomeEvent domainradar conversion flow
- `../spec.md` §4.5、§6
## Outputs
| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/backend/internal/module/growth/domain/domain.go` | edit | optional product_idbrand_id attribution |
| radar/crm conversion usecase | edit | won 當下取 primary snapshot IDs |
| `apps/backend/internal/module/growth/repository/{memory,mongo}.go` | edit | optional fields backward compatible |
| `apps/backend/internal/logic/growthmap/map.go` | edit | public outcome mapping |
| conversion tests | edit/add | product、legacy、amend/delete audit |
## Behavior
- 只有人可回報成交;不自動推進或另建成交帳。
- 後續 Product 刪除primary 改變不改舊 OutcomeEvent。
- legacy outcome 欄位可空,既有彙總不受影響。
## Out of scope
- 產品成交率頁與自動調校P1
- 金額規則重做
## Acceptance
- [ ] 既有 growth tests 全綠product attribution 可讀可稽核。
```bash
cd apps/backend && go test ./internal/module/growth/... ./internal/module/crm/... ./internal/module/radar/... -count=1
```