Browse Source

📝 docs(story-007.005): 更新地理区域多租户故事依赖和测试细节

- 明确标注需要更新的依赖包:@d8d/user-module-mt, @d8d/auth-module-mt, @d8d/file-module-mt
- 细化测试任务,指定具体需要更新的测试文件
- 增强Dev Notes中的测试文件结构说明

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
yourname 1 month ago
parent
commit
3f3f23e21a
1 changed files with 24 additions and 7 deletions
  1. 24 7
      docs/stories/007.005.geo-areas-module-multi-tenant-replication.md

+ 24 - 7
docs/stories/007.005.geo-areas-module-multi-tenant-replication.md

@@ -26,7 +26,10 @@ Ready for Development
 - [ ] 复制地理区域模块为多租户版本 (AC: 1)
   - [ ] 复制 `packages/geo-areas` 为 `packages/geo-areas-mt`
   - [ ] 更新包配置为 `@d8d/geo-areas-mt`
-  - [ ] 添加多租户模块依赖:`@d8d/user-module-mt`
+  - [ ] 更新依赖:
+    - [ ] 将 `@d8d/user-module` 替换为 `@d8d/user-module-mt`
+    - [ ] 将 `@d8d/auth-module` 替换为 `@d8d/auth-module-mt`
+    - [ ] 将 `@d8d/file-module` 替换为 `@d8d/file-module-mt`
 
 - [ ] 更新多租户区域实体 (AC: 2)
   - [ ] 创建 `AreaEntityMt` 实体,表名为 `areas_mt`
@@ -50,9 +53,9 @@ Ready for Development
   - [ ] 添加租户ID字段定义
 
 - [ ] 实现租户数据隔离API测试 (AC: 5)
-  - [ ] 编写租户数据隔离集成测试
-  - [ ] 编写跨租户区域访问安全测试
-  - [ ] 验证租户过滤功能正确性
+  - [ ] 在 `packages/geo-areas-mt/tests/integration/areas.integration.test.ts` 中添加租户隔离测试用例
+  - [ ] 在 `packages/geo-areas-mt/tests/integration/admin-areas.integration.test.ts` 中添加跨租户区域访问安全验证
+  - [ ] 在现有功能测试中验证租户过滤功能正确性
 
 - [ ] 验证单租户系统完整性 (AC: 6)
   - [ ] 运行单租户地理区域模块回归测试
@@ -112,11 +115,25 @@ Ready for Development
 - **集成测试**: `packages/geo-areas-mt/tests/integration/**/*.test.ts`
 - **测试框架**: Vitest + shared-test-util
 - **测试重点**: API功能验证、租户数据隔离、区域树形查询、跨租户安全
+- **现有测试文件**:
+  - `packages/geo-areas-mt/tests/integration/areas.integration.test.ts` - 区域API集成测试
+  - `packages/geo-areas-mt/tests/integration/admin-areas.integration.test.ts` - 管理区域API集成测试
+  - `packages/geo-areas-mt/tests/utils/integration-test-utils.ts` - 测试断言工具
+  - `packages/geo-areas-mt/tests/utils/test-data-factory.ts` - 测试数据工厂
 
 ### 依赖关系
-- **必需依赖**: `@d8d/user-module-mt`
-- **共享依赖**: `@d8d/shared-crud`, `@d8d/shared-types`, `@d8d/shared-utils`
-- **测试依赖**: `@d8d/shared-test-util`
+- **必需依赖**:
+  - `@d8d/user-module-mt` (替换现有的 `@d8d/user-module`)
+  - `@d8d/auth-module-mt` (替换现有的 `@d8d/auth-module`)
+  - `@d8d/file-module-mt` (替换现有的 `@d8d/file-module`)
+- **共享依赖**:
+  - `@d8d/shared-crud` (保持)
+  - `@d8d/shared-types` (保持)
+  - `@d8d/shared-utils` (保持)
+- **测试依赖**:
+  - `@d8d/shared-test-util` (保持)
+- **框架依赖**:
+  - `hono`, `@hono/zod-openapi`, `typeorm`, `zod` (保持)
 
 ### 共享CRUD包租户隔离支持
 [Source: packages/shared-crud/src/routes/generic-crud.routes.ts]