优化泥点流水素材原因展示
Project CI / Frontend tests (pull_request) Successful in 3m34s
Project CI / Repository checks (pull_request) Successful in 6m1s
Project CI / Backend tests (pull_request) Successful in 7m32s
Project CI / Native shell tests (pull_request) Successful in 22m59s

记录资产扣费类型并保留队列任务元数据

按白名单返回用户可见原因且未知历史流水继续回退

扩展共享契约与账单展示并补齐回归测试和团队决策记录
This commit is contained in:
2026-09-07 19:34:09 +08:00
parent 5d8f5731b2
commit e40d41d608
7 changed files with 172 additions and 17 deletions
@@ -131,4 +131,45 @@ test('builds wallet ledger presentation with stable source fallbacks', () => {
},
],
});
for (const reason of [
'生成美术素材',
'编辑美术素材',
'提取美术素材',
'生成角色动画',
'生成视频素材',
'生成音效素材',
'生成背景音乐',
]) {
expect(
buildWalletLedgerPresentation(
{
entries: [
buildLedgerEntry({
amountDelta: -12,
sourceType: 'asset_operation_consume',
reason,
}),
],
},
12,
).entries[0]?.sourceLabel,
`unexpected source label for ${reason}`,
).toBe(reason);
}
expect(
buildWalletLedgerPresentation(
{
entries: [
buildLedgerEntry({
amountDelta: -12,
sourceType: 'asset_operation_consume',
reason: ' ',
}),
],
},
12,
).entries[0]?.sourceLabel,
).toBe('资产操作消耗');
});
@@ -103,7 +103,8 @@ export function buildWalletLedgerPresentation(
createdAtLabel: formatWalletLedgerDate(entry.createdAt),
id: entry.id,
isIncome: entry.amountDelta > 0,
sourceLabel: getWalletLedgerSourceLabel(entry.sourceType),
sourceLabel:
entry.reason?.trim() || getWalletLedgerSourceLabel(entry.sourceType),
})),
};
}
+1
View File
@@ -84,6 +84,7 @@ export type ProfileWalletLedgerEntry = {
| 'puzzle_author_incentive_claim'
| 'daily_task_reward';
createdAt: string;
reason?: string;
};
export type ProfileWalletLedgerResponse = {