51 lines
1.0 KiB
Markdown
51 lines
1.0 KiB
Markdown
|
|
# T301 — mongo-indexes-growth-loop
|
|||
|
|
|
|||
|
|
> Status: `done`
|
|||
|
|
> Milestone: `M0`
|
|||
|
|
> Kind: `feat`
|
|||
|
|
> Est. change: `~120 lines`
|
|||
|
|
|
|||
|
|
## Goal
|
|||
|
|
|
|||
|
|
完成後系統應:`cmd/init`(或既有 index 包)為 Outcome/WeeklyCheckup/AccountHealth/Workspace/InviteReward/DraftReview 建立可重跑 index。
|
|||
|
|
|
|||
|
|
## Depends on
|
|||
|
|
|
|||
|
|
- T300
|
|||
|
|
|
|||
|
|
## Inputs
|
|||
|
|
|
|||
|
|
- Spec:`../spec.md` §8
|
|||
|
|
- 既有:`apps/backend` init/mongo index 模式(haixun-backend T104)
|
|||
|
|
|
|||
|
|
## Outputs
|
|||
|
|
|
|||
|
|
### 程式變更(預期路徑)
|
|||
|
|
|
|||
|
|
| 路徑 | 動作 | 說明 |
|
|||
|
|
|------|------|------|
|
|||
|
|
| `apps/backend/cmd/init/**` 或 `internal/**/index/**` | edit | 新集合 index |
|
|||
|
|
| 相關 test | add | idempotent 可重跑 |
|
|||
|
|
|
|||
|
|
### 行為變更
|
|||
|
|
|
|||
|
|
- index 含 owner_uid、source 查詢鍵、week_key、workspace_id 等(對齊 spec §8)
|
|||
|
|
|
|||
|
|
## Out of scope
|
|||
|
|
|
|||
|
|
- seeder 示範資料(可另開;非本 task 必須)
|
|||
|
|
|
|||
|
|
## Acceptance
|
|||
|
|
|
|||
|
|
- [ ] init 可重複執行不炸
|
|||
|
|
- [ ] 指令:
|
|||
|
|
|
|||
|
|
```bash
|
|||
|
|
cd apps/backend && go test ./... -count=1 -run Index|Init
|
|||
|
|
# 或專案文件中的 init 指令 dry-run
|
|||
|
|
```
|
|||
|
|
|
|||
|
|
## Notes
|
|||
|
|
|
|||
|
|
—
|