Add aftersales stats to dashboard and service-layer tests
- CompanyStatsOverviewDTO and GetStats() now include aftersales counts (total, pending confirmation, closed, rejected) and a recentAftersales list - aftersales_service_test.go covers YYMMNN sequence, owner-only submit, state machine, phone last-4 check, reject increment, force-close - users_service_test.go covers duplicate username, self-demotion guard, last-admin guard, password reset, assignable filter Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -56,8 +56,10 @@ backend-go/
|
||||
│ ├── companies_service.go # 企业管理业务逻辑
|
||||
│ ├── employees_service.go # 员工赋码业务逻辑
|
||||
│ ├── serials_service.go # 序列号业务逻辑
|
||||
│ ├── services_test.go # 服务层单元测试
|
||||
│ └── users_service.go # 用户管理业务逻辑
|
||||
│ ├── aftersales_service_test.go # 售后工单单元测试
|
||||
│ ├── services_test.go # 认证/序列号/员工/企业单元测试
|
||||
│ ├── users_service.go # 用户管理业务逻辑
|
||||
│ └── users_service_test.go # 用户管理单元测试
|
||||
├── tests/ # 集成测试
|
||||
│ └── main_test.go # 端到端测试
|
||||
├── data/ # 数据目录(SQLite 数据库存储位置)
|
||||
@@ -365,11 +367,13 @@ go tool cover -html=coverage.out
|
||||
|
||||
### 当前测试覆盖
|
||||
|
||||
- **services/**: 包含 AuthService、SerialsService、EmployeeSerialsService 和 CompaniesService 的完整单元测试
|
||||
- **services/**: 包含 AuthService、SerialsService、EmployeeSerialsService、CompaniesService、AftersalesService 和 UsersService 的完整单元测试
|
||||
- 用户认证测试(登录、获取用户信息、修改密码、更新资料)
|
||||
- 序列号管理测试(生成、查询、更新、吊销、分页列表)
|
||||
- 员工赋码测试(生成、查询、更新、吊销、二维码生成)
|
||||
- 企业统计测试(统计概览)
|
||||
- 售后工单测试(YYMMNN 序号生成、状态机、客户确认手机号校验、强制关闭)
|
||||
- 用户管理测试(重复用户名、自降级保护、最后管理员保护、密码重置)
|
||||
- **tests/**: 集成测试(健康检查、登录流程)
|
||||
|
||||
## 代码检查
|
||||
|
||||
Reference in New Issue
Block a user