thread-master/docs/product/demand-radar/tasks/T573-conversion-amend-delet...

49 lines
1.3 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.

# T573 — conversion-amend-delete-audit
> Status: `done`
> Milestone: `M4`
> Kind: `feat`
> Est. change: `~150 lines`
## Goal
完成後系統應:成交可修改與刪除,明細與成果彙總保持一致且全程留痕。
## Depends on
- T572
## Inputs
- Spec`../spec.md` §4.6.6、§8touches 只增不改、§9.4CR-09
## Outputs
### 程式變更(預期路徑)
| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/backend/generate/api/crm.api` | edit | conversion PUTDELETE |
| `apps/backend/internal/logic/crm/updateContactConversionLogic.go` | edit | 改金額/備註 → 同步既有 OutcomeEvent |
| `apps/backend/internal/logic/crm/deleteContactConversionLogic.go` | edit | 撤銷成交 → 既有 OutcomeEvent 對應處理 |
### 行為變更
- 每次改/刪都 append 一筆 `conversion` touch記錄原值與新值既有 touch 不修改。
- 刪除成交後階段**不自動退回**,由使用者決定(系統不猜)。
- 成果彙總同步更新;任何情況不得回空成功。
## Out of scope
- 前端表單T575
## Acceptance
- [x] CR-09刪後明細與成果彙總一致時間軸看得到兩次變更
- [x] 刪除不存在的成交回明確錯誤
- [x] 指令:
```bash
cd apps/backend && go test ./internal/logic/crm/... -count=1
```