fix(M09-REGRESSION): 完成商品逐单对账与权限收口

This commit is contained in:
Codex
2026-08-11 08:25:12 +08:00
parent e91b979128
commit 41b9cf7349
21 changed files with 566 additions and 39 deletions
+7
View File
@@ -338,6 +338,13 @@ await assert.rejects(
() => service.listStocks(scopedOut, { storeId: '11', page: 1, pageSize: 20 }),
(error) => error instanceof InventoryError && error.code === 'INVENTORY_STORE_SCOPE_FORBIDDEN'
);
const platformManager = {
...manager,
access: { roles: ['STAFF'], capabilities: ['platform.manage'], storeIds: [] }
};
assert.equal((await service.listStocks(
platformManager, { storeId: '11', page: 1, pageSize: 20 }
)).total, 4, 'platform.manage must bypass store grants for inventory reads');
state.lockOrder.length = 0;
const batchBase = {