持久化用户历史消费泥点投影
后台用户详情展示历史花费并保留手动对账 消费落账原子更新投影并提供存量初始化 为手动对账增加独立管理员操作权限 更新SpacetimeDB绑定、文档和测试
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user