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:
parent
a38aac5581
commit
4e670ad774
|
|
@ -2115,8 +2115,8 @@ export class WalletApplicationService {
|
||||||
*/
|
*/
|
||||||
private getEntryTypeName(entryType: string): string {
|
private getEntryTypeName(entryType: string): string {
|
||||||
const nameMap: Record<string, string> = {
|
const nameMap: Record<string, string> = {
|
||||||
DEPOSIT_KAVA: '充值绿积分',
|
DEPOSIT_KAVA: '充值',
|
||||||
DEPOSIT_BSC: '充值 (BSC)',
|
DEPOSIT_BSC: '充值',
|
||||||
PLANT_PAYMENT: '认种支付',
|
PLANT_PAYMENT: '认种支付',
|
||||||
PLANT_FREEZE: '认种冻结',
|
PLANT_FREEZE: '认种冻结',
|
||||||
PLANT_UNFREEZE: '认种解冻',
|
PLANT_UNFREEZE: '认种解冻',
|
||||||
|
|
|
||||||
|
|
@ -46,14 +46,27 @@ export class LedgerEntryRepositoryImpl implements ILedgerEntryRepository {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 临时性流水类型,不在流水明细中显示
|
||||||
|
private static readonly HIDDEN_ENTRY_TYPES = [
|
||||||
|
'PLANT_FREEZE', // 认种冻结(临时)
|
||||||
|
'PLANT_UNFREEZE', // 认种解冻(回滚)
|
||||||
|
'FREEZE', // 通用冻结(临时)
|
||||||
|
'UNFREEZE', // 通用解冻(回滚)
|
||||||
|
];
|
||||||
|
|
||||||
async findByUserId(
|
async findByUserId(
|
||||||
userId: bigint,
|
userId: bigint,
|
||||||
filters?: LedgerFilters,
|
filters?: LedgerFilters,
|
||||||
pagination?: Pagination,
|
pagination?: Pagination,
|
||||||
): Promise<PaginatedResult<LedgerEntry>> {
|
): Promise<PaginatedResult<LedgerEntry>> {
|
||||||
const where: Record<string, unknown> = { userId };
|
const where: Record<string, unknown> = {
|
||||||
|
userId,
|
||||||
|
// 排除临时性流水类型
|
||||||
|
entryType: { notIn: LedgerEntryRepositoryImpl.HIDDEN_ENTRY_TYPES },
|
||||||
|
};
|
||||||
|
|
||||||
if (filters?.entryType) {
|
if (filters?.entryType) {
|
||||||
|
// 如果用户指定了类型筛选,则使用用户指定的类型
|
||||||
where.entryType = filters.entryType;
|
where.entryType = filters.entryType;
|
||||||
}
|
}
|
||||||
if (filters?.assetType) {
|
if (filters?.assetType) {
|
||||||
|
|
|
||||||
|
|
@ -780,8 +780,8 @@ class LedgerEntry {
|
||||||
/// 获取流水类型中文名
|
/// 获取流水类型中文名
|
||||||
String get entryTypeName {
|
String get entryTypeName {
|
||||||
const nameMap = {
|
const nameMap = {
|
||||||
'DEPOSIT_KAVA': '充值 (KAVA)',
|
'DEPOSIT_KAVA': '充值',
|
||||||
'DEPOSIT_BSC': '充值 (BSC)',
|
'DEPOSIT_BSC': '充值',
|
||||||
'PLANT_PAYMENT': '认种支付',
|
'PLANT_PAYMENT': '认种支付',
|
||||||
'PLANT_FREEZE': '认种冻结',
|
'PLANT_FREEZE': '认种冻结',
|
||||||
'PLANT_UNFREEZE': '认种解冻',
|
'PLANT_UNFREEZE': '认种解冻',
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class _LedgerDetailPageState extends ConsumerState<LedgerDetailPage>
|
||||||
{'value': 'REWARD_EXPIRED', 'label': '奖励过期'},
|
{'value': 'REWARD_EXPIRED', 'label': '奖励过期'},
|
||||||
{'value': 'WITHDRAWAL', 'label': '提现'},
|
{'value': 'WITHDRAWAL', 'label': '提现'},
|
||||||
{'value': 'REWARD_SETTLED', 'label': '结算'},
|
{'value': 'REWARD_SETTLED', 'label': '结算'},
|
||||||
{'value': 'DEPOSIT_KAVA', 'label': '充值绿积分'},
|
{'value': 'DEPOSIT_KAVA', 'label': '充值'},
|
||||||
];
|
];
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue