持久化用户历史消费泥点投影
Project CI / Repository checks (push) Successful in 59s
Project CI / Frontend tests (push) Successful in 1m58s
Project CI / Native shell tests (push) Successful in 2m28s
Project CI / Backend tests (push) Successful in 3m5s

后台用户详情展示历史花费并保留手动对账
消费落账原子更新投影并提供存量初始化
为手动对账增加独立管理员操作权限
更新SpacetimeDB绑定、文档和测试
This commit is contained in:
2026-07-28 16:20:43 +08:00
parent 66a8b7f597
commit 271d5d7bd3
45 changed files with 2141 additions and 105 deletions
+9 -1
View File
@@ -195,7 +195,7 @@ function mapAccountSnapshot(value) {
return value;
}
assert(
Array.isArray(value) && value.length === 10,
Array.isArray(value) && value.length === 11,
'Invalid admin account snapshot.',
);
return {
@@ -209,6 +209,7 @@ function mapAccountSnapshot(value) {
updated_by: value[7],
created_at_micros: value[8],
updated_at_micros: value[9],
action_permissions_json: value[10],
};
}
@@ -322,6 +323,7 @@ async function runSmoke(serverUrl, bootstrapSecret) {
tab_permissions_json: '["dashboard"]',
enabled: true,
created_by: 'admin-account-smoke',
action_permissions_json: '[]',
};
const updateInput = {
account_id: 'member-1',
@@ -330,6 +332,7 @@ async function runSmoke(serverUrl, bootstrapSecret) {
tab_permissions_json: '["dashboard","tracking"]',
enabled: false,
updated_by: 'admin-account-smoke',
action_permissions_json: '["profile-wallet-consumption-reconcile"]',
};
assertDenied(
@@ -475,6 +478,11 @@ async function runSmoke(serverUrl, bootstrapSecret) {
updated.ok && updated.account?.token_version === 2,
'State update did not increment once.',
);
assert(
updated.account?.action_permissions_json ===
'["profile-wallet-consumption-reconcile"]',
'Action permission was not persisted.',
);
const displayOnly = parseAccountResult(
await callProcedure(