feat(ECR-011): 昵称、首页贴士与档案 Self 唯一/合盘交叉校验
ci / h5 (push) Canceled after 0s
ci / api (push) Canceled after 0s
ci / ess-docs (push) Canceled after 0s

每账号仅一条 self(migration 40902);合盘只选 TA;账号昵称可改;首页穿衣/颜色/养生贴士。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-12 22:05:00 +08:00
co-authored by Cursor
parent 5ceb3ce749
commit 13860bf1ef
67 changed files with 1936 additions and 275 deletions
+11
View File
@@ -92,6 +92,8 @@
| R4 | 删除策略:任务未要求硬删 PII 时按实现(软删优先);级联影响报告见服务规则 |
| R5 | Ask / 画像 / 关系必须挂合法 profile_id |
| R6 | 文案用「个人档案」,不用命盘 |
| R7 | **每账号至多一条** `relation=self`(唯一索引);再建 self → 409;解码/星盘等复用或更新既有 Self,禁止重复造「我」 |
| R8 | 合盘/匹配对象列表只展示 `other` + 附近的人;不得把多余 self 当作 TA |
---
@@ -100,6 +102,7 @@
| 表 | 字段要点 |
|---|---|
| `profiles` | id, user_id, relation, display_name, birth_date, birth_time?, birth_place?, gender?, relation_type? |
| 约束 | 部分唯一:`(user_id) WHERE relation='self' AND deleted_at IS NULL` |
---
@@ -143,10 +146,18 @@
**When** 添加 TA
**Then** relation=other 且可用于关系理解
**Given** 已有 Self
**When** 再次 POST relation=self
**Then** 409 conflict;列表仍仅一条 Self
**Given** 他人 id
**When** PATCH
**Then** 失败
**Given** 同账号多条历史 self(脏数据)
**When** 迁移/启动
**Then** 仅保留最新一条,其余软删;合盘 TA 侧不再出现多个「我」
---
## 13. AI 开发前检查