فهرست منبع

📝 docs(architecture): update source tree documentation for goods module

- add version history entry for goods module addition
- document goods-module directory structure including entities, services, schemas, types and routes
- update business module layer order to include goods-module
- mark documentation update task as completed in goods-module story
yourname 1 ماه پیش
والد
کامیت
d6b070a0d8
2فایلهای تغییر یافته به همراه36 افزوده شده و 2 حذف شده
  1. 34 1
      docs/architecture/source-tree.md
  2. 2 1
      docs/stories/005.010.goods-module.story.md

+ 34 - 1
docs/architecture/source-tree.md

@@ -3,6 +3,7 @@
 ## 版本信息
 | 版本 | 日期 | 描述 | 作者 |
 |------|------|------|------|
+| 3.4 | 2025-11-12 | 添加商品管理模块包 (@d8d/goods-module) | James |
 | 3.3 | 2025-11-12 | 补充新添加的业务模块包(广告、商户、供应商) | Winston |
 | 3.2 | 2025-11-11 | 更新包结构,添加基础设施和业务模块包 | Winston |
 | 3.1 | 2025-11-09 | 更新测试结构,清理重复测试文件 | James |
@@ -247,6 +248,38 @@ d8d-mini-starter/
 │   │   │       ├── user-routes.integration.test.ts    # 用户路由集成测试
 │   │   │       └── admin-routes.integration.test.ts   # 管理员路由集成测试
 │   │   └── package.json
+│   ├── goods-module/           # 商品管理模块 (@d8d/goods-module)
+│   │   ├── src/
+│   │   │   ├── entities/
+│   │   │   │   ├── goods.entity.ts                  # 商品实体
+│   │   │   │   └── goods-category.entity.ts          # 商品分类实体
+│   │   │   ├── services/
+│   │   │   │   ├── goods.service.ts                  # 商品服务
+│   │   │   │   └── goods-category.service.ts         # 商品分类服务
+│   │   │   ├── schemas/
+│   │   │   │   ├── goods.schema.ts                   # 商品Schema
+│   │   │   │   ├── goods-category.schema.ts          # 商品分类Schema
+│   │   │   │   ├── random.schema.ts                  # 随机商品Schema
+│   │   │   │   ├── user-goods.schema.ts              # 用户专用Schema
+│   │   │   │   ├── admin-goods.schema.ts             # 管理员专用Schema
+│   │   │   │   └── public-goods.schema.ts            # 公开商品Schema
+│   │   │   ├── types/
+│   │   │   │   └── goods.types.ts                    # 商品类型定义
+│   │   │   └── routes/
+│   │   │       ├── admin-goods-categories.ts         # 商品分类管理路由
+│   │   │       ├── public-goods-random.ts            # 公开随机商品路由
+│   │   │       ├── user-goods-routes.ts              # 用户路由
+│   │   │       ├── admin-goods-routes.ts             # 管理员路由
+│   │   │       ├── public-goods-routes.ts            # 公开商品路由
+│   │   │       └── index.ts                          # 路由导出
+│   │   ├── tests/
+│   │   │   └── integration/
+│   │   │       ├── admin-goods-categories.integration.test.ts    # 商品分类集成测试
+│   │   │       ├── public-goods-random.integration.test.ts       # 随机商品集成测试
+│   │   │       ├── user-goods-routes.integration.test.ts         # 用户路由集成测试
+│   │   │       ├── admin-goods-routes.integration.test.ts        # 管理员路由集成测试
+│   │   │       └── public-goods-routes.integration.test.ts       # 公开商品路由集成测试
+│   │   └── package.json
 │   └── geo-areas/              # 地区模块 (@d8d/geo-areas)
 │       ├── src/
 │       │   ├── modules/areas/
@@ -330,7 +363,7 @@ d8d-mini-starter/
 - **包架构层次**:
   - **基础设施层**: shared-types → shared-utils → shared-crud
   - **测试基础设施**: shared-test-util
-  - **业务模块层**: user-module → auth-module → file-module → delivery-address-module → advertisements-module → merchant-module → supplier-module → geo-areas
+  - **业务模块层**: user-module → auth-module → file-module → delivery-address-module → advertisements-module → merchant-module → supplier-module → goods-module → geo-areas
   - **应用层**: server (重构后)
 - **测试结构**:
   - **基础设施包**: 每个包独立的单元测试和集成测试

+ 2 - 1
docs/stories/005.010.goods-module.story.md

@@ -96,7 +96,7 @@ Draft
 
 - [ ] Task 9: 验证和文档 (AC: 4, 6)
   - [ ] 运行所有测试验证功能
-  - [ ] 更新 docs/architecture/source-tree.md 文档
+  - [x] 更新 docs/architecture/source-tree.md 文档
   - [ ] 验证向后兼容性
 
 ## Dev Notes
@@ -250,6 +250,7 @@ Draft
 - 2025-11-12: 修复了商品模块的类型检查问题,类型检查已通过
 - 2025-11-12: 公开商品路由已完成,配置了只读权限、状态过滤和关联关系加载
 - 2025-11-12: 测试套件已完成,55个集成测试全部通过,使用了shared-test-util
+- 2025-11-12: 已更新 docs/architecture/source-tree.md 文档,添加商品模块信息
 
 ### File List
 - packages/goods-module/package.json