thread-master/docs/product/haixun-console/tasks/T008-mock-repos-seed.md

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

# T008 — Mock repos + localStorage + seed
> Status: `todo`
> Milestone: `M3`
> Est. change: `~200 lines`
## Goal
全部 mock repository 讀寫 localStorage首次進入寫入 seed 帳號/通知/job。
## Depends on
- T007
## Inputs
- Spec §8.1 keys、§8.5 mock 原則
- keys 前綴 `harbor.*`
## Outputs
### 程式變更
| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/web/src/data/mock/*.ts` | add | 各 repo 實作 |
| `apps/web/src/data/mock/seed.ts` | add | 初始資料 |
| `apps/web/src/data/createRepos.ts` | edit | 接上 mock |
### 行為變更
- 至少 2 個 usable ThreadsAccount
- 1 job running 或 demo、1 unread notification可選
- CRUD ThreadPlay / Outbox 可用(即使 UI 尚未接)
## Out of scope
- 模擬發送狀態機完整邏輯可簡化,細節在 T016 強化
## Acceptance
- [ ] 重整後 seed 不重複爆量idempotent seed
- [ ] 手動在 console 或暫用 dev helper 可 list accounts
- [ ] `npm run build` 通過
```bash
cd apps/web && npm run build
```