Commit Graph

120 Commits

Author SHA1 Message Date
hailin ee6a092a1a fix(authorization-service): 修复授权查询使用错误字段导致省市互斥验证失效
问题:数据库 user_id 列存储的是 accountSequence,但查询时使用 userId.value,
导致查询不到已有授权记录,省市互斥验证被绕过。

修复方法:所有基于 UserId 的查询改为使用 accountSequence 字段:
- findByUserIdAndRoleType
- findByUserIdRoleTypeAndRegion
- findByUserId
- findPendingByUserId
- findAllByUserIdIncludeDeleted

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 10:15:40 -08:00
hailin 8f5b4df3d1 feat(authorization-service): 新增权益考核记录表 BenefitAssessmentRecord
新增独立的权益有效性考核记录表,与火柴人排名(MonthlyAssessment)分离:

Schema & Migration:
- 新增 BenefitAssessmentRecord 表存储权益考核历史
- 新增 BenefitActionType 枚举(ACTIVATED/RENEWED/DEACTIVATED/NO_CHANGE)
- 记录考核月份、目标、完成数、权益状态变化等信息

领域层:
- 新增 BenefitAssessmentRecord 聚合根
- 新增 IBenefitAssessmentRecordRepository 接口

应用层:
- 修改 processExpiredCommunityBenefits 保存考核记录
- 修改 processExpiredCityCompanyBenefits 保存考核记录
- 修改 processExpiredProvinceCompanyBenefits 保存考核记录
- 修改 processExpiredAuthCityBenefits 保存考核记录(新增,原无记录)
- 修改 processExpiredAuthProvinceBenefits 保存考核记录(新增,原无记录)

此改动 100% 不影响原有业务逻辑:
- 原有 MonthlyAssessment 表继续用于火柴人排名
- 仅在权益考核执行完成后追加保存记录到新表

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 04:15:07 -08:00
hailin 36a83397a8 revert: 撤销对 authorization/identity/reporting 服务的修改
这些服务不需要同步手续费账户的定义,wallet-service 独立处理。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 09:48:42 -08:00
hailin 898521d236 fix: 同步手续费归集账户到所有相关服务
- identity-service: seed.ts 添加 S0000000005 和 S0000000006
- authorization-service: 枚举添加 SHARE_RIGHT_POOL 和 FEE_COLLECTION
- authorization-service: 初始化固定账户列表添加新账户
- reporting-service: 修复账户类型映射 (PLATFORM_FEE -> FEE_COLLECTION)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 09:30:45 -08:00
hailin 8b80e45524 fix(authorization): 火柴人排名过滤已撤销授权的考核记录
- findRankingsByMonthAndRegion 和 findRankingsByMonthAndRoleType 增加过滤条件
- 排除 authorization.status = 'REVOKED' 的记录
- 解决同一用户因有多条授权记录(含已撤销)而重复显示的问题

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 19:55:23 -08:00
hailin 6c78e22000 fix(authorization): 添加火柴人排名调试日志
添加详细日志显示返回的每条记录的区域信息,便于调试过滤问题。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 06:23:57 -08:00
hailin bdc6ba524f fix(authorization): 火柴人排名改为按区域过滤
修改排名逻辑,只显示获得相同省/市公司授权的用户排名。

- 后端 getStickmanRanking 改用 findRankingsByMonthAndRegion
- 简化实时创建评估逻辑,只为当前区域创建
- 更新前端注释说明

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-05 05:56:30 -08:00
hailin e95316c5f4 fix(authorization-service): register SystemAccountApplicationService in AppModule
Add missing dependency injection for SystemAccountApplicationService
which is required by InternalAuthorizationController for system account
report statistics API.

- Import SystemAccountRepositoryImpl and SYSTEM_ACCOUNT_REPOSITORY
- Register SystemAccountApplicationService as provider
- Register SYSTEM_ACCOUNT_REPOSITORY with SystemAccountRepositoryImpl

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 22:22:02 -08:00
hailin 6e395ce58c feat(reporting): add system account report aggregation feature
## Changes
- Add system account report aggregation APIs in reporting-service
- Add internal statistics APIs in wallet-service, reward-service, authorization-service
- Add system accounts tab in admin-web statistics page
- Enhanced metadata in reward entries for traceability

## Backend Changes
- wallet-service: Add offline settlement summary and system accounts balances APIs
- reward-service: Add expired rewards summary API
- authorization-service: Add fixed accounts list, region accounts summary APIs
- reporting-service: Add HTTP clients and aggregation service for system account reports

## Frontend Changes
- admin-web: Add SystemAccountsTab component with fixed accounts, region summaries,
  offline settlement stats, and expired rewards display

## Rollback Instructions
Each file includes rollback comments with [2026-01-04] tag marking new additions.
To rollback: delete files marked as new, remove code sections marked with date comments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 22:06:58 -08:00
hailin 52afe72f17 fix(authorization): migration should drop both constraint and index
The original migration only used DROP CONSTRAINT which failed silently
because Prisma created an INDEX instead. Added DROP INDEX as well to
handle both cases in future deployments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 03:14:00 -08:00
hailin 0991d5d484 fix(authorization): allow querying REVOKED records despite deletedAt being set
撤销授权时会同时设置 status=REVOKED 和 deletedAt(软删除),
导致 findByStatus(REVOKED) 因为 deletedAt IS NULL 条件永远返回空。
修改为查询 REVOKED 状态时不过滤 deletedAt。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 02:52:43 -08:00
hailin bc1d4a62c6 fix(authorization): add Transform decorator to parse includeRevoked query param
查询参数都是字符串类型,需要将 'true' 转换为布尔值 true,
否则后端无法正确处理 includeRevoked 参数,导致已撤销的授权记录不显示。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 02:07:49 -08:00
hailin af0b9d38c0 Revert "fix(authorization): exclude revoked records when checking existing authorization"
This reverts commit ec528a7226.
2026-01-04 01:08:28 -08:00
hailin ec528a7226 fix(authorization): exclude revoked records when checking existing authorization
The findByAccountSequenceAndRoleType query now excludes REVOKED status,
allowing users to be re-authorized after their authorization was revoked.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 00:59:37 -08:00
hailin 30cb245301 refactor: rename "总部社区" to "总部" across backend services
Changed display name from "总部社区" to "总部" in:
- authorization-service
- identity-service seed
- leaderboard-service seed and entity

Note: Existing database records need manual update if already seeded.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 00:34:36 -08:00
hailin 16d895d460 debug: add logging to queryAuthorizations 2026-01-04 00:12:43 -08:00
hailin ef6b2ceb22 fix(authorization): show all authorized users in admin list including those in assessment period
Previously used findAllActive() which only returned users with benefitActive=true,
causing users still in assessment period to be hidden. Now uses findByStatus()
to show all AUTHORIZED users regardless of benefit activation status.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-04 00:04:24 -08:00
hailin 50f960ecea fix(authorization): allow admin tokens without accountSequence field
Admin JWT tokens from identity-service don't include the accountSequence
field (only userId, email, role, type). This caused a 400 error with
message "管理员账户序列号不能为空" when admins tried to grant authorizations.

Changes:
- Update AdminUserId value object to make accountSequence optional
- Use 'ADMIN' as default value when accountSequence is not provided
- Update all controller methods to handle optional accountSequence

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 22:57:56 -08:00
hailin 35a812c058 feat(authorization): add admin authorization management API and real data integration
Backend (authorization-service):
- Add QueryAuthorizationsDto for query parameters (roleType, keyword, includeRevoked, page, limit)
- Add queryAuthorizations method to fetch all authorizations with user info
- Add GET /admin/authorizations endpoint for listing authorizations
- Add POST /admin/authorizations/:id/revoke endpoint for revoking authorization

Frontend (admin-web):
- Add authorization.types.ts with RoleType, Authorization, and request types
- Add authorizationService.ts for API calls (list, revoke, grant operations)
- Add useAuthorizations.ts React Query hooks
- Update authorization page to use real API data instead of mock data
- Add loading/error states, pagination, and revoke reason display
- Add new styles for loading, error, pagination, and date columns

The authorization management page now displays all authorized users
from the database with support for filtering by role type, status,
and keyword search.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 18:50:10 -08:00
hailin 89a2700fc9 chore(authorization-service): 移除已执行完成的 OTP 修复任务
OTP 修复结果:
- 总计处理: 3 个未激活的社区授权
- 成功修复: 1 (D25122600004)
- 跳过: 2 (未达标)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:06:32 -08:00
hailin f2a59b81ee fix(authorization-service): 修复 OTP 编译错误,使用 findByStatus 方法
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:03:54 -08:00
hailin 16a6edaf15 feat(authorization-service): 添加社区权益激活一次性修复任务
问题:由于 planting-service 发送的 userId 是订单主键而非用户真实 ID,
导致部分已达标的社区权益未被自动激活。

修复:添加 BenefitActivationFixOTP 一次性任务,在服务启动时:
1. 查找所有状态为 AUTHORIZED 但 benefitActive=false 的社区授权
2. 检查每个社区的 subordinateTeamPlantingCount 是否 >= 10
3. 满足条件则激活权益

使用方式:
1. 部署此代码,服务启动后自动执行修复
2. 确认修复完成后,删除 OTP 文件并重新部署

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 23:00:38 -08:00
hailin 6e84e370ee fix(authorization-service): 使用 accountSequence 替代 userId 查询团队统计
问题:planting-service 发送的 PlantingOrderPaid 事件中的 userId 是
订单表的自增主键(如 15),而不是 referral-service 中的真实 user_id
(如 25122600006)。这导致 handleTreePlanted 方法查询团队统计时
返回 null,社区权益无法被自动激活。

修复:改用事件中的 accountSequence 字段查询团队统计,因为
accountSequence 是跨服务一致的用户标识。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 22:51:32 -08:00
hailin 906279ee8a fix(mobile): 修复用户详情页头像和用户ID显示问题
- 修复avatarUrl为SVG数据时的渲染问题,添加SVG检测逻辑
- 修复后端getUserInfoBySequence响应解析,处理包装格式
- 将用户详情弹窗改为全屏页面,提供更好的用户体验
- 新增统计数据卡片展示直推人数、伞下用户、认种数量
- 改进卡片样式,添加图标和阴影效果

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:28:28 -08:00
hailin 6745721399 fix: 修复火柴人排名点击查看用户详情功能
- 后端DTO添加accountSequence字段
- 后端服务返回accountSequence
- 前端映射accountSequence到StickmanRankingData
- 优化错误提示样式与页面风格一致

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 01:05:18 -08:00
hailin ed1f863919 fix(authorization): 修复团队升级竞态条件,改用事件链模式
问题:authorization-service 和 referral-service 并行消费 TreePlanted 事件,
导致升级检查时统计数据尚未更新完成。

解决方案:
- referral-service: 批量更新团队统计后发布 TeamStatisticsUpdatedEvent
- authorization-service: 监听该事件触发升级检查,替代原有的即时检查
- TeamStatistics 聚合添加 accountSequence 字段用于事件发布

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 00:13:39 -08:00
hailin 647f86ec89 fix(authorization): 暂时禁止所有用户查看私密资料
由于系统尚未实现权限管理功能,暂时将 checkPrivateProfileAccess
始终返回 false,禁止所有用户查看其他用户的手机号、邮箱等隐私信息。

后续实现权限系统后可恢复原有逻辑。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:46:15 -08:00
hailin 27a4bbfbef feat(authorization): 实现火柴人排名用户详情查看功能
后端:
- identity-service: 新增内部API获取用户详情(手机号、邮箱、KYC等)
- referral-service: 新增内部API获取用户团队统计(直推人数、伞下用户数、认种数量)
- authorization-service:
  - 新增用户公开资料和私密资料API
  - 聚合identity-service和referral-service数据
  - 省团队以上权限可查看私密信息(脱敏处理)

前端:
- 新增UserProfileDialog弹窗组件,支持查看用户详情
- stickman_race_widget: 排名列表项可点击查看用户详情
- authorization_service: 新增getUserProfile/getUserPrivateProfile方法

用户详情包括:
- 基本信息: 用户ID、昵称、头像、注册时间、所在地区
- 团队数据: 推荐人、直推人数、伞下用户数、个人/团队认种数
- 授权信息: 授权类型、权益激活状态
- 联系信息(特权用户可见): 手机号、邮箱、真实姓名(脱敏)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:42:19 -08:00
hailin 050cfacec3 fix(authorization): 增大 monthly_assessments.local_percentage 字段精度
将 local_percentage 字段从 DECIMAL(5,2) 改为 DECIMAL(10,2)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 08:02:21 -08:00
hailin 68621d3826 fix(authorization): 增大 progress_percentage 字段精度避免溢出
将 stickman_rankings 表的 progress_percentage 字段从 DECIMAL(5,2)
改为 DECIMAL(10,2),以支持超过 999.99% 的进度百分比。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 07:42:07 -08:00
hailin 454b466993 fix(authorization): 修复自动升级检查被提前返回跳过的问题
当认种用户没有授权时,不再提前返回,确保 checkAllTeamAutoUpgrade()
始终被调用,以正确检查所有市/省团队的自动升级条件。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 07:23:46 -08:00
hailin 8367530ebe refactor(authorization): 移除祖先链升级逻辑,只保留团队本人升级
业务规则简化:
- 市/省团队本人伞下认种数达到阈值时,团队本人获得区域授权
- 移除了"伞下成员达到阈值时该成员获得授权"的逻辑
- 两种逻辑是互斥的,只保留团队本人升级的方式

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 07:14:08 -08:00
hailin 7c2d0b8b7f fix(authorization): 修正自动升级逻辑,totalTeamPlantingCount已是伞下认种数
referral-service 返回的 totalTeamPlantingCount 已经是不含自己的伞下认种数,
无需再减去 selfPlantingCount。更新注释说明。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 07:09:31 -08:00
hailin 8501cc34dc fix(authorization): 修改市/省团队自动升级逻辑为使用伞下认种数
业务规则调整:
- 市团队本人伞下认种数(不含自己)达到1万棵时自动升级为市区域
- 省团队本人伞下认种数(不含自己)达到5万棵时自动升级为省区域
- 伞下认种数 = 团队总认种数 - 自己认种数

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 07:06:46 -08:00
hailin d24a474d02 feat(authorization): 火柴人排名更新频率从每天凌晨1点改为每10分钟
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 06:50:15 -08:00
hailin 16a3e76588 fix(authorization): 配置 REWARD_SERVICE_URL 环境变量
- 在 .env.example 添加 REWARD_SERVICE_URL 配置
- 在 docker-compose.yml 添加 REWARD_SERVICE_URL 和 REWARD_SERVICE_ENABLED 环境变量
- 在 docker-compose.windows.yml 添加相同配置
- authorization-service 依赖 reward-service 启动

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 05:15:20 -08:00
hailin 2f5ca85106 feat(authorization/reward): 实现火柴人排名本月收益显示功能
- reward-service: 添加批量查询月度收益内部接口
  - 新增 InternalController 提供 /internal/monthly-earnings/batch 端点
  - 在 RewardApplicationService 添加 batchGetMonthlyEarnings 方法
  - 支持按账户序列号、月份、权益类型批量查询可结算收益
  - 统计分享权益(SHARE_RIGHT)、省团队权益(PROVINCE_TEAM_RIGHT)、市团队权益(CITY_TEAM_RIGHT)

- authorization-service: 集成 reward-service 获取月度收益
  - 新增 RewardServiceClient 用于调用 reward-service 内部接口
  - 修改 getStickmanRanking 方法,调用 reward-service 获取月度收益
  - 省团队查询省团队权益+分享权益,市团队查询市团队权益+分享权益
  - monthlyEarnings 字段现在显示真实的月度可结算收益

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 05:04:55 -08:00
hailin bf63852a0f feat(authorization): 实现市/省团队自动升级为市/省区域机制
- 添加 findAllActiveAuthProvinceCompanies 和 findAllActiveAuthCityCompanies 仓储方法
- 在认种事件处理中添加 checkAllTeamAutoUpgrade 检查所有已激活团队
- 市团队达到1万棵自动升级为市区域(CITY_COMPANY)
- 省团队达到5万棵自动升级为省区域(PROVINCE_COMPANY)
- 保持原有手动授权功能不变

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 03:56:38 -08:00
hailin b04dd1f234 fix(authorization-service): 修复 identity-service 响应解析
- 处理 TransformInterceptor 包装的响应格式 { success, data }
- 正确提取 data 字段中的用户信息

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 03:12:58 -08:00
hailin 1d21ae8ff7 fix(identity-service): 修复 InternalController 未注册问题
- 在 app.module.ts 的内联 ApiModule 中添加 InternalController
- 添加 InfrastructureModule 导入和 UserAccountRepositoryImpl provider
- 修正 authorization-service 的 identity-service URL 默认值

问题原因:app.module.ts 定义了内联 ApiModule,不是导入的 api.module.ts

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 03:04:57 -08:00
hailin a194fcad72 fix(identity-service): 内部接口改用 accountSequence 查询
- identity-service InternalController 改用 accountSequence 批量/单个查询
- 添加 findByAccountSequences 批量查询方法
- authorization-service 调用改为 batchGetUserInfoBySequence/getUserInfoBySequence
- 系统间通信统一使用 accountSequence 作为标识符

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 02:16:12 -08:00
hailin 5fa195e4bc fix: 修复火柴人排名显示问题
1. identity-service: 添加批量获取用户信息内部接口
   - 新增 InternalController 提供 POST /internal/users/batch
   - repository 添加 findByUserIds 批量查询方法

2. authorization-service: 修复 cumulativeCompleted=0 问题
   - assessAndRankRegion 改用 findByAccountSequence 查询团队统计
   - referral-service 使用 accountSequence 作为主键

3. mobile-app: 修复火柴人UI显示问题
   - 容器边距调整为16px与其他组件一致
   - 行高增加到100px避免火柴人重叠

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:48:16 -08:00
hailin a9d5d297d8 feat(authorization): 火柴人排名查询时实时创建评估记录
当查询火柴人排名时,如果没有评估记录,则实时调用 assessAndRankRegion
创建评估记录,避免用户需要等待凌晨1点的定时任务。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 01:02:23 -08:00
hailin d862c9a623 Revert "fix(authorization): 自助申请市/省团队激活权益时创建考核评估记录"
This reverts commit d029cd5872.
2025-12-23 00:54:08 -08:00
hailin d029cd5872 fix(authorization): 自助申请市/省团队激活权益时创建考核评估记录
自助申请流程在激活权益时缺少创建 MonthlyAssessment 记录的逻辑,
导致火柴人排名功能无法正常显示。本次修复在 processCityTeamApplication
和 processProvinceTeamApplication 方法中添加了 createInitialAssessment 调用。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:43:29 -08:00
hailin 2d3891740c feat(authorization): 火柴人排名改为全系统排名,不按区域过滤
- 后端新增 findRankingsByMonthAndRoleType 方法查询全系统排名
- 修改 getStickmanRanking 不再按 regionCode 过滤
- 前端简化加载条件,只要有授权就加载排名
- 添加详细调试日志帮助排查问题

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:20:35 -08:00
hailin 428ac91737 feat(authorization): 优化市/省团队自助申请逻辑
- 团队链区域唯一性:同一直推链上只阻止申请已被占用的城市/省份,非全部阻止
- 市/省团队互斥:同一用户只能拥有市团队或省团队之一
- 前端优化:显示已占用区域数量提示,选择时验证区域可用性

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 22:52:39 -08:00
hailin cb0f10af34 feat: 多项业务功能增强
- 动态提取手续费配置:支持固定/百分比两种费率类型,默认2绿积分/笔
- 找回密码功能:新增手机号+短信验证码重置密码流程
- 授权申请优化:自助申请时验证团队链授权状态
- UI文案调整:登录账号、监控页待开启等

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 19:00:02 -08:00
hailin 7a264a0158 feat(authorization): 实现省区域/市区域自动升级机制
- 添加 createAutoUpgradedProvinceCompany/CityCompany 工厂方法
- 在 handleTreePlanted 中检查自动升级条件
- 省区域:团队累计5万棵时自动升级
- 市区域:团队累计1万棵时自动升级
- 扩展 ITeamStatisticsRepository 接口添加 getReferralChain 方法

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 17:24:44 -08:00
hailin 0506a3547c fix(authorization): 自助申请授权状态设为AUTHORIZED而非PENDING
问题:自助申请的社区/市团队/省团队授权创建时状态为PENDING,
导致在推荐关系查询中无法找到这些授权(查询只匹配AUTHORIZED状态)

解决方案:
- 新增 createSelfAppliedCommunity 工厂方法,状态直接设为 AUTHORIZED
- 新增 createSelfAppliedAuthCityCompany 工厂方法
- 新增 createSelfAppliedAuthProvinceCompany 工厂方法
- 更新事件类型允许 authorizedBy 为 null(表示自助申请)
- 自助申请处理方法改用新的工厂方法

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 16:59:20 -08:00