fix(authorization-service): 修复 OTP 编译错误,使用 findByStatus 方法

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-25 23:03:54 -08:00
parent 16a6edaf15
commit f2a59b81ee
1 changed files with 5 additions and 6 deletions

View File

@ -53,15 +53,14 @@ export class BenefitActivationFixOTP implements OnModuleInit {
this.logger.log('[OTP] ========================================')
try {
// 1. 查找所有未激活的社区授权
const pendingCommunities = await this.authorizationRepository.findByRoleTypeAndStatus(
RoleType.COMMUNITY,
// 1. 查找所有 AUTHORIZED 状态的授权
const authorizedRoles = await this.authorizationRepository.findByStatus(
AuthorizationStatus.AUTHORIZED,
)
// 过滤出 benefitActive = false 的记录
const unactivatedCommunities = pendingCommunities.filter(
(auth) => !auth.benefitActive,
// 过滤出社区角色且 benefitActive = false 的记录
const unactivatedCommunities = authorizedRoles.filter(
(auth) => auth.roleType === RoleType.COMMUNITY && !auth.benefitActive,
)
this.logger.log(`[OTP] 找到 ${unactivatedCommunities.length} 个未激活权益的社区授权`)