fix(wallet): 隐藏临时流水记录并统一充值名称显示

- 在流水明细查询中排除冻结/解冻等临时记录
- 将"充值 (KAVA)"统一改为"充值"

🤖 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-23 21:00:31 -08:00
parent a38aac5581
commit 4e670ad774
4 changed files with 19 additions and 6 deletions

View File

@ -2115,8 +2115,8 @@ export class WalletApplicationService {
*/
private getEntryTypeName(entryType: string): string {
const nameMap: Record<string, string> = {
DEPOSIT_KAVA: '充值绿积分',
DEPOSIT_BSC: '充值 (BSC)',
DEPOSIT_KAVA: '充值',
DEPOSIT_BSC: '充值',
PLANT_PAYMENT: '认种支付',
PLANT_FREEZE: '认种冻结',
PLANT_UNFREEZE: '认种解冻',

View File

@ -46,14 +46,27 @@ export class LedgerEntryRepositoryImpl implements ILedgerEntryRepository {
});
}
// 临时性流水类型,不在流水明细中显示
private static readonly HIDDEN_ENTRY_TYPES = [
'PLANT_FREEZE', // 认种冻结(临时)
'PLANT_UNFREEZE', // 认种解冻(回滚)
'FREEZE', // 通用冻结(临时)
'UNFREEZE', // 通用解冻(回滚)
];
async findByUserId(
userId: bigint,
filters?: LedgerFilters,
pagination?: Pagination,
): Promise<PaginatedResult<LedgerEntry>> {
const where: Record<string, unknown> = { userId };
const where: Record<string, unknown> = {
userId,
// 排除临时性流水类型
entryType: { notIn: LedgerEntryRepositoryImpl.HIDDEN_ENTRY_TYPES },
};
if (filters?.entryType) {
// 如果用户指定了类型筛选,则使用用户指定的类型
where.entryType = filters.entryType;
}
if (filters?.assetType) {

View File

@ -780,8 +780,8 @@ class LedgerEntry {
///
String get entryTypeName {
const nameMap = {
'DEPOSIT_KAVA': '充值 (KAVA)',
'DEPOSIT_BSC': '充值 (BSC)',
'DEPOSIT_KAVA': '充值',
'DEPOSIT_BSC': '充值',
'PLANT_PAYMENT': '认种支付',
'PLANT_FREEZE': '认种冻结',
'PLANT_UNFREEZE': '认种解冻',

View File

@ -41,7 +41,7 @@ class _LedgerDetailPageState extends ConsumerState<LedgerDetailPage>
{'value': 'REWARD_EXPIRED', 'label': '奖励过期'},
{'value': 'WITHDRAWAL', 'label': '提现'},
{'value': 'REWARD_SETTLED', 'label': '结算'},
{'value': 'DEPOSIT_KAVA', 'label': '充值绿积分'},
{'value': 'DEPOSIT_KAVA', 'label': '充值'},
];
@override