refactor(admin): drop the SPA credits asset record browser

「用户近期资产记录」卡片在 SPA 积分配置页里按用户 ID + 资产类型 +
日期查 user meta 历史,再伪装成统一账本行(entries / operation_key /
ref_key)。SPA 只承载配置,运营记录归原生 用户 → 积分/余额 屏幕
(CreditsAdmin / BalanceAdmin),这条平行路径删除,不留双读或迁移。

- CmsCredits.vue: 移除卡片、表格、分页及 ledger* 状态与
  formatAssetValue/loadLedger/searchLedger/resetLedger
- users.js: 删除仅服务该卡片的 getCreditLog()
- UserController: 删除 /assets/transactions 路由、rest_get_credits_log()
  及其唯一调用方 asset_value_to_minor()
- 契约测试改为断言该能力不得回归

points_record / balance_record 本身保留,前端账本与原生后台仍在消费。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-01 14:20:07 +08:00
1 parent 324bcfdadc
commit 1c95f94bca
4 files changed
+15 -179

No files matched your search

@@ -324,18 +324,22 @@ test('VIP card redemption is one locked transaction with bounded retry and repla
assert.match(method, /vip_card_replay_result/)
})
test('admin recent asset records read the user-meta histories', () => {
const controller = fs.readFileSync(path.join(root, 'src', 'Admin', 'UserController.php'), 'utf8')
test('the SPA credits page is configuration only, with no asset record browser', () => {
// Recent per-user asset records live on the native 用户 → 积分/余额 screens
// (src/User/CreditsAdmin.php, src/User/BalanceAdmin.php). The SPA keeps
// configuration only, so the record table, its REST route and its API method
// must not come back.
const page = fs.readFileSync(path.join(root, 'assets', 'admin', 'src', 'pages', 'CmsCredits.vue'), 'utf8')
assert.match(controller, /'balance_record'/)
assert.match(controller, /'points_record'/)
assert.match(controller, /'balance_value'/)
assert.match(controller, /'points_value'/)
assert.match(page, /用户近期资产记录/)
assert.match(page, /api\.getCreditLog\(params\)/)
assert.doesNotMatch(page, /统一资产账本|transaction_id|operation_key|toFixed|number_format/)
assert.match(page, /Math\.trunc\(raw\)/)
assert.match(page, /padStart\(3, '0'\)/)
const api = fs.readFileSync(path.join(root, 'assets', 'admin', 'src', 'api', 'modules', 'users.js'), 'utf8')
const controller = fs.readFileSync(path.join(root, 'src', 'Admin', 'UserController.php'), 'utf8')
assert.match(page, /积分配置/)
assert.match(page, /api\.getCreditSettings\(\)/)
assert.doesNotMatch(page, /用户近期资产记录/)
assert.doesNotMatch(page, /getCreditLog|ledgerRows|ledgerFilters|assetOptions/)
assert.doesNotMatch(api, /getCreditLog|assets\/transactions/)
assert.doesNotMatch(controller, /assets\/transactions/)
assert.doesNotMatch(controller, /rest_get_credits_log|asset_value_to_minor/)
})
test('asset purchases share the order center and refresh every wallet surface', () => {