feat(pre-planting): 预种权益流水备注添加[预种]前缀

wallet-service 新增 prePlantingPrefix 私有方法,
当 FundAllocationItem.metadata.source === 'PRE_PLANTING' 时,
在流水 memo 中添加 "[预种] " 前缀,使用户可区分预种与普通认种权益。

仅影响 pre-planting 新增的分配流水,不修改任何普通认种 memo。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-28 12:34:01 -08:00
parent 1d0e4352df
commit d9c238702e
3 changed files with 18 additions and 6 deletions

View File

@ -283,6 +283,7 @@ export class InternalPrePlantingController {
targetId: e.recipientAccountSequence,
allocationType: e.rightType,
amount: Number(e.usdtAmount),
metadata: { source: 'PRE_PLANTING' },
})),
});

View File

@ -109,6 +109,8 @@ export class PrePlantingRewardService {
targetId: a.recipientAccountSequence,
allocationType: a.rightType,
amount: a.amount,
// source 标识供 wallet-service 在流水备注中加"[预种]"前缀,与普通认种权益区分
metadata: { source: 'PRE_PLANTING' },
})),
});

View File

@ -1038,6 +1038,15 @@ export class WalletApplicationService {
};
}
/**
* []
* metadata.source === 'PRE_PLANTING' "[预种] "
*
*/
private prePlantingPrefix(allocation: FundAllocationItem): string {
return allocation.metadata?.source === 'PRE_PLANTING' ? '[预种] ' : '';
}
/**
*
* ++
@ -1117,7 +1126,7 @@ export class WalletApplicationService {
entryType: LedgerEntryType.REWARD_TO_SETTLEABLE,
amount,
refOrderId: orderId,
memo: `${allocation.allocationType} allocation (direct settleable)`,
memo: `${this.prePlantingPrefix(allocation)}${allocation.allocationType} allocation (direct settleable)`,
payloadJson: {
allocationType: allocation.allocationType,
metadata: allocation.metadata,
@ -1156,7 +1165,7 @@ export class WalletApplicationService {
entryType: LedgerEntryType.REWARD_PENDING,
amount,
refOrderId: orderId,
memo: `${allocation.allocationType} allocation`,
memo: `${this.prePlantingPrefix(allocation)}${allocation.allocationType} allocation`,
payloadJson: {
allocationType: allocation.allocationType,
expireAt: expireAt.toISOString(),
@ -1220,8 +1229,8 @@ export class WalletApplicationService {
amount,
refOrderId: orderId,
memo: isUserAccount
? `${allocation.allocationType} - community authorization allocation (settleable)`
: `${allocation.allocationType} - headquarters community allocation (settleable)`,
? `${this.prePlantingPrefix(allocation)}${allocation.allocationType} - community authorization allocation (settleable)`
: `${this.prePlantingPrefix(allocation)}${allocation.allocationType} - headquarters community allocation (settleable)`,
payloadJson: {
allocationType: allocation.allocationType,
metadata: allocation.metadata,
@ -1283,7 +1292,7 @@ export class WalletApplicationService {
entryType: LedgerEntryType.REWARD_TO_SETTLEABLE,
amount,
refOrderId: orderId,
memo: `${allocation.allocationType} - region account allocation (settleable)`,
memo: `${this.prePlantingPrefix(allocation)}${allocation.allocationType} - region account allocation (settleable)`,
payloadJson: {
allocationType: allocation.allocationType,
metadata: allocation.metadata,
@ -1343,7 +1352,7 @@ export class WalletApplicationService {
entryType: LedgerEntryType.SYSTEM_ALLOCATION,
amount,
refOrderId: orderId,
memo: `${allocation.allocationType} - system account allocation`,
memo: `${this.prePlantingPrefix(allocation)}${allocation.allocationType} - system account allocation`,
payloadJson: {
allocationType: allocation.allocationType,
metadata: allocation.metadata,