feat(ECR-018): Entitlement 用户权益只读并 Closed

聚合 GET /admin/users/:id/entitlements(Membership∪DeepAccess∪问答额度)与 admin-h5 权益 Tab;无 migration / 无真支付。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
jackyu66git
2026-08-07 19:26:15 +08:00
co-authored by Cursor
parent 37b91e51b8
commit c81f57a7d1
28 changed files with 597 additions and 12 deletions
@@ -0,0 +1,36 @@
# Feature Spec: EntitlementOps · ECR-018
> Status: `Active`Loop continuous · **ECR-018 Closed**
> Parent: WAVE0-FROZEN · Predecessor: ECR-017 Closed
> Capability: `CommerceEntitlement` · BC: `Membership_Orders`
> 授权:`docs/WAVE0/LOOP_AUTHORIZATION.md`
## Non-goals
真支付 · 改订单/退款 · 新建权益矩阵表 · UGC · 改报告正文 · ask_pack SKU
## L2 读模型(无 migration
| 概念 | 来源 |
|------|------|
| `Entitlement` | Membership + DeepAccess 列表 + ask_paid_quota 聚合 |
| flags | `report_detail_via_membership` · `deep_access_count` |
## L3 API
| Method | Path | 权限 | 语义 |
|--------|------|------|------|
| GET | `/admin/users/:id/entitlements` | `admin.users.read` | 用户权益只读视图 |
## L4 AC
| ID | Then |
|----|------|
| AC-F-01 | 授予会员后 flags.report_detail_via_membership=true |
| AC-F-02 | 有 deep_access 时 deep_accesses 非空或 count≥1 |
| AC-F-03 | 无会员无深度 → membership.active=false 且 count=0 仍 200 |
| AC-S-01 | 无 Admin → 401 |
| AC-P-01 | GET &lt; 500ms 本机 |
| AC-O-01 | N/A 只读 |
contract_diff: `docs/CONTRACT_DIFF/ECR-018.yaml`