# T007 — Domain types + repo interfaces + createRepos

> Status: `done`
> Completed: 2026-07-09  
> Milestone: `M3`  
> Est. change: `~180 lines`

## Goal

TypeScript domain 型別 + repository 介面；`createRepos('mock'|'live')` 工廠就位（live 可 throw/not implemented）。

## Depends on

- T006

## Inputs

- Spec §2 實體、§5.1 JSON 形狀、§5.0 共用規則

## Outputs

### 程式變更

| 路徑 | 動作 | 說明 |
|------|------|------|
| `apps/web/src/domain/types.ts` | add | Member, ThreadsAccount, ThreadPlay, PlayStep, Outbox*, Job, Notification |
| `apps/web/src/data/repos.ts` | add | interface 定義 |
| `apps/web/src/data/createRepos.ts` | add | 工廠 |
| `apps/web/src/data/DataContext.tsx` | add | 提供 repos 給 React |

### 行為變更

- 型別含 `lead_account_id`, `cast_account_ids`, steps with kind root|reply  
- Speakers 校驗 helper 可放 `domain/speakers.ts`

## Out of scope

- mock 實作細節（T008）
- HTTP client live

## Acceptance

- [ ] 型別可 compile  
- [ ] `createRepos('mock')` 可呼叫（實作可先空再由 T008 補）  
- [ ] `npm run build` 通過

```bash
cd apps/web && npm run build
```
