49 lines
1.3 KiB
Markdown
49 lines
1.3 KiB
Markdown
|
|
# 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、§8(touches 只增不改)、§9.4(CR-09)
|
|||
|
|
|
|||
|
|
## Outputs
|
|||
|
|
|
|||
|
|
### 程式變更(預期路徑)
|
|||
|
|
|
|||
|
|
| 路徑 | 動作 | 說明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `apps/backend/generate/api/crm.api` | edit | conversion PUT/DELETE |
|
|||
|
|
| `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
|
|||
|
|
```
|