diff --git a/backend/services/wallet-service/src/application/services/wallet-application.service.ts b/backend/services/wallet-service/src/application/services/wallet-application.service.ts index 795f0423..854d823c 100644 --- a/backend/services/wallet-service/src/application/services/wallet-application.service.ts +++ b/backend/services/wallet-service/src/application/services/wallet-application.service.ts @@ -1198,19 +1198,21 @@ export class WalletApplicationService { } const amount = Money.USDT(allocation.amount); - wallet.addAvailableBalance(amount); + // 所有奖励都应该进入可结算余额 (settleable_usdt),与 reward-service 保持一致 + // 用户需要主动点击"结算"才能将 settleable_usdt 转入 usdt_available + wallet.addSettleableReward(amount, Hashpower.create(0)); await this.walletRepo.save(wallet); - // 记录流水 + // 记录流水 - 使用 REWARD_TO_SETTLEABLE 类型,与 SHARE_RIGHT 保持一致 const ledgerEntry = LedgerEntry.create({ accountSequence: wallet.accountSequence, userId: wallet.userId, - entryType: LedgerEntryType.SYSTEM_ALLOCATION, + entryType: LedgerEntryType.REWARD_TO_SETTLEABLE, amount, refOrderId: orderId, memo: isUserAccount - ? `${allocation.allocationType} - community authorization allocation` - : `${allocation.allocationType} - headquarters community allocation`, + ? `${allocation.allocationType} - community authorization allocation (settleable)` + : `${allocation.allocationType} - headquarters community allocation (settleable)`, payloadJson: { allocationType: allocation.allocationType, metadata: allocation.metadata, @@ -1221,7 +1223,7 @@ export class WalletApplicationService { await this.walletCacheService.invalidateWallet(wallet.userId.value); this.logger.debug( - `Allocated ${allocation.amount} USDT to ${isUserAccount ? 'community user' : 'headquarters'} ${wallet.accountSequence} for ${allocation.allocationType}`, + `Allocated ${allocation.amount} USDT to ${isUserAccount ? 'community user' : 'headquarters'} ${wallet.accountSequence} for ${allocation.allocationType} (settleable)`, ); } @@ -1260,17 +1262,19 @@ export class WalletApplicationService { } const amount = Money.USDT(allocation.amount); - wallet.addAvailableBalance(amount); + // 所有奖励都应该进入可结算余额 (settleable_usdt),与 reward-service 保持一致 + // 用户需要主动点击"结算"才能将 settleable_usdt 转入 usdt_available + wallet.addSettleableReward(amount, Hashpower.create(0)); await this.walletRepo.save(wallet); - // 记录流水 + // 记录流水 - 使用 REWARD_TO_SETTLEABLE 类型,与 SHARE_RIGHT 保持一致 const ledgerEntry = LedgerEntry.create({ accountSequence: wallet.accountSequence, userId: wallet.userId, - entryType: LedgerEntryType.SYSTEM_ALLOCATION, + entryType: LedgerEntryType.REWARD_TO_SETTLEABLE, amount, refOrderId: orderId, - memo: `${allocation.allocationType} - region account allocation`, + memo: `${allocation.allocationType} - region account allocation (settleable)`, payloadJson: { allocationType: allocation.allocationType, metadata: allocation.metadata, @@ -1281,7 +1285,7 @@ export class WalletApplicationService { await this.walletCacheService.invalidateWallet(wallet.userId.value); this.logger.debug( - `Allocated ${allocation.amount} USDT to region account ${targetId} for ${allocation.allocationType} (direct)`, + `Allocated ${allocation.amount} USDT to region account ${targetId} for ${allocation.allocationType} (settleable)`, ); }