Establish product language contract, user journey with dual growth engines, ERD/OpenAPI/Go boundaries, and H5 routes (/profile, /portrait, /relation, /membership) before P1 implementation. Co-authored-by: Cursor <cursoragent@cursor.com>
43 lines
1.6 KiB
Markdown
43 lines
1.6 KiB
Markdown
# Domain Map — 冻结(P1 工程真源)
|
||
|
||
变更本文件或 ERD 需简短 ADR。词汇:[../domain.md](../domain.md) · ERD:[erd.md](erd.md) · API:`proto/openapi.yaml` · Go 边界:[../architecture/go-services.md](../architecture/go-services.md)
|
||
|
||
---
|
||
|
||
## Bounded Contexts
|
||
|
||
| Context | Aggregates | P1 | Owner package |
|
||
|---|---|---|---|
|
||
| Identity | User, Session, DeviceIdentity | Yes | `internal/service/user` |
|
||
| Profile | Profile | Yes | `internal/service/profile` |
|
||
| Discovery | Portrait, Scale, ScaleResult, GrowthReport | Yes | `portrait`, `scale`, `report` |
|
||
| Relation | RelationInsight | Yes **必做** | `relation` |
|
||
| Ask | AskThread, AskMessage, AskQuota | Skeleton | `ask` |
|
||
| Companion | Mood, SolarTerm | Shell | `companion` |
|
||
| Memory | MemoryItem | P2/P3 | `memory` |
|
||
| Commerce | Subscription, Membership, Order, Payment, DeepAccess | Yes mock | `order`, `membership` |
|
||
| Consult | — | P3 | — |
|
||
|
||
---
|
||
|
||
## Context diagram
|
||
|
||
```
|
||
Identity → Profile → Discovery(Portrait/Scale/GrowthReport)
|
||
↘ RelationInsight ← P1 双引擎
|
||
↘ Ask (+ Memory later)
|
||
↘ Companion
|
||
↓
|
||
Commerce(DeepAccess/Membership)
|
||
```
|
||
|
||
---
|
||
|
||
## Invariants
|
||
|
||
1. GrowthReport 完整字段仅当 Membership active **或** DeepAccess 存在。
|
||
2. Ask 必须绑定 `profile_id`(Self 或 Other)。
|
||
3. RelationInsight 引用两个 Profile;禁止无档案的「合婚」式空算。
|
||
4. 客户端不可信任本地「已深度版」标志。
|
||
5. 禁止吉凶/运势类字段名进入 schema(如 `luck_score`)。
|