fix: complete development acceptance paths
This commit is contained in:
@@ -13,6 +13,29 @@ const PHASE4_READ_CODES = [
|
||||
'platform:overseas-business:looseboard:list',
|
||||
]
|
||||
const PHASE4_WRITE_SUFFIXES = [':create', ':edit', ':status', ':export', ':adjust', ':delete', ':review']
|
||||
const PHASE5_OPERATOR_CODES = [
|
||||
'platform:overseas-warehouse:dispatch:list',
|
||||
'platform:overseas-warehouse:dispatch:edit',
|
||||
'platform:overseas-warehouse:dispatch:cancel',
|
||||
'platform:overseas-warehouse:dispatch:transfer-delivery',
|
||||
'platform:overseas-warehouse:outbound:list',
|
||||
'platform:overseas-warehouse:outbound:create',
|
||||
'platform:overseas-warehouse:outbound:cancel',
|
||||
'platform:overseas-warehouse:delivery:list',
|
||||
'platform:overseas-warehouse:exception-order:list',
|
||||
'platform:overseas-warehouse:exception-order:create',
|
||||
'platform:overseas-warehouse:delivery:return',
|
||||
'platform:overseas-warehouse:delivery:status',
|
||||
'platform:overseas-warehouse:customer-visit:list',
|
||||
'platform:overseas-warehouse:customer-visit:edit',
|
||||
]
|
||||
const PHASE5_TALLY_CODES = [
|
||||
'platform:overseas-warehouse:dispatch:list',
|
||||
'platform:overseas-warehouse:outbound:list',
|
||||
'platform:overseas-warehouse:delivery:list',
|
||||
'platform:overseas-warehouse:exception-order:list',
|
||||
'platform:overseas-warehouse:customer-visit:list',
|
||||
]
|
||||
|
||||
function id(value) { return value == null ? '' : String(value) }
|
||||
|
||||
@@ -62,38 +85,41 @@ export async function run(context) {
|
||||
`permissions=${[...overseasPdaCodes].sort().join(',')}`, OPTIONS)
|
||||
|
||||
const operatorCodes = roleCodes('WAREHOUSE_OPERATOR')
|
||||
context.assert(MODULE, '操作员具备国内入仓权限与四期十项只读权限', rolesResponse,
|
||||
context.assert(MODULE, '操作员具备国内入仓权限、四期只读权限与五期履约权限', rolesResponse,
|
||||
operatorCodes.has('platform:firstleg:inbound:loading:view')
|
||||
&& operatorCodes.has('platform:firstleg:inbound:loading:edit')
|
||||
&& operatorCodes.size === 15
|
||||
&& operatorCodes.size === 29
|
||||
&& PHASE4_READ_CODES.every((code) => operatorCodes.has(code))
|
||||
&& PHASE5_OPERATOR_CODES.every((code) => operatorCodes.has(code))
|
||||
&& !operatorCodes.has('platform:firstleg:inbound:loading:complete')
|
||||
&& !operatorCodes.has('platform:firstleg:pda:assign')
|
||||
&& !operatorCodes.has('platform:firstleg:outbound-dispatch:confirm')
|
||||
&& !operatorCodes.has('platform:firstleg:outbound-dispatch:reverse')
|
||||
&& [...operatorCodes].filter((code) => code.startsWith('platform:overseas-'))
|
||||
.every((code) => !PHASE4_WRITE_SUFFIXES.some((suffix) => code.endsWith(suffix))),
|
||||
.every((code) => PHASE4_READ_CODES.includes(code) || PHASE5_OPERATOR_CODES.includes(code)),
|
||||
`permissionCount=${operatorCodes.size}`, OPTIONS)
|
||||
|
||||
const tallyCodes = roleCodes('WAREHOUSE_TALLY')
|
||||
context.assert(MODULE, '理货员可后台维护证据和复核但不能完成装柜', rolesResponse,
|
||||
context.assert(MODULE, '理货员可维护证据、复核并只读查看海外履约', rolesResponse,
|
||||
tallyCodes.has('platform:firstleg:inbound:loading:view')
|
||||
&& tallyCodes.has('platform:firstleg:inbound:loading:edit')
|
||||
&& tallyCodes.has('platform:firstleg:pda:review')
|
||||
&& tallyCodes.size === 22
|
||||
&& tallyCodes.size === 28
|
||||
&& PHASE4_READ_CODES.every((code) => tallyCodes.has(code))
|
||||
&& PHASE5_TALLY_CODES.every((code) => tallyCodes.has(code))
|
||||
&& !tallyCodes.has('platform:firstleg:inbound:loading:complete')
|
||||
&& !tallyCodes.has('platform:firstleg:outbound-dispatch:confirm')
|
||||
&& [...tallyCodes].filter((code) => code.startsWith('platform:overseas-'))
|
||||
.every((code) => !PHASE4_WRITE_SUFFIXES.some((suffix) => code.endsWith(suffix))),
|
||||
.every((code) => PHASE4_READ_CODES.includes(code) || PHASE5_TALLY_CODES.includes(code)),
|
||||
`permissionCount=${tallyCodes.size}`, OPTIONS)
|
||||
|
||||
context.assert(MODULE, '四期list权限同时用于列表与详情且不隐含写权限', rolesResponse,
|
||||
context.assert(MODULE, '四期只读与五期岗位权限集合严格匹配', rolesResponse,
|
||||
PHASE4_READ_CODES.every((code) => code.endsWith(':list'))
|
||||
&& [...operatorCodes, ...tallyCodes]
|
||||
.filter((code) => code.startsWith('platform:overseas-'))
|
||||
.every((code) => PHASE4_READ_CODES.includes(code)),
|
||||
`phase4ReadCodes=${PHASE4_READ_CODES.length}`, OPTIONS)
|
||||
&& PHASE5_TALLY_CODES.every((code) => code.endsWith(':list'))
|
||||
&& PHASE5_OPERATOR_CODES.some((code) => PHASE4_WRITE_SUFFIXES.some((suffix) => code.endsWith(suffix)))
|
||||
&& PHASE5_OPERATOR_CODES.every((code) => operatorCodes.has(code))
|
||||
&& PHASE5_TALLY_CODES.every((code) => tallyCodes.has(code)),
|
||||
`phase4ReadCodes=${PHASE4_READ_CODES.length}, phase5OperatorCodes=${PHASE5_OPERATOR_CODES.length}, phase5TallyCodes=${PHASE5_TALLY_CODES.length}`, OPTIONS)
|
||||
|
||||
context.assert(MODULE, '仓库系统角色不包含任何客户侧权限', rolesResponse,
|
||||
[...operatorCodes, ...domesticPdaCodes, ...overseasPdaCodes, ...tallyCodes]
|
||||
|
||||
Reference in New Issue
Block a user