fix: complete development acceptance paths

This commit is contained in:
2026-09-03 19:10:18 +08:00
parent 4df0ae4811
commit 2063d29d16
13 changed files with 203 additions and 79 deletions
@@ -4,6 +4,7 @@ import { readFileSync } from 'node:fs'
const acceptance = readFileSync(new URL('./phase3-warehouse-rbac.mjs', import.meta.url), 'utf8')
const iamSql = readFileSync(new URL('../../iam/src/main/resources/db/lastleg-permissions.sql', import.meta.url), 'utf8')
const phase5Sql = readFileSync(new URL('../../iam/src/main/resources/db/phase5-delivery-permissions.sql', import.meta.url), 'utf8')
const unifiedSql = readFileSync(new URL('../../deploy/sql/头程数据库统一增量-MySQL8.sql', import.meta.url), 'utf8')
const listCodes = [
@@ -19,19 +20,42 @@ const listCodes = [
'platform:overseas-business:looseboard:list',
]
test('warehouse operator and tally use the exact phase-four list/detail permission set', () => {
test('warehouse operator and tally use the exact phase-four and phase-five permission sets', () => {
for (const code of listCodes) {
assert.match(acceptance, new RegExp(code.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
assert.match(iamSql, new RegExp(`'WAREHOUSE_OPERATOR','${code}'`))
assert.match(iamSql, new RegExp(`'WAREHOUSE_TALLY','${code}'`))
}
assert.match(acceptance, /operatorCodes\.size === 15/)
assert.match(acceptance, /tallyCodes\.size === 22/)
assert.match(acceptance, /operatorCodes\.size === 29/)
assert.match(acceptance, /tallyCodes\.size === 28/)
assert.match(acceptance, /PHASE4_WRITE_SUFFIXES/)
assert.match(iamSql, /assert_phase4_warehouse_role_minimum/)
assert.match(iamSql, /permission_code REGEXP ':\(create\|edit\|status\|export\|adjust\|delete\|review\)\$'/)
})
test('warehouse roles include the exact phase-five fulfillment responsibilities', () => {
assert.match(acceptance, /PHASE5_OPERATOR_CODES/)
assert.match(acceptance, /PHASE5_TALLY_CODES/)
for (const code of [
'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'
]) {
assert.match(phase5Sql, new RegExp(code.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')))
}
})
test('domestic and overseas PDA operators use isolated authorities', () => {
assert.match(acceptance, /domesticPdaCodes\.size === 2/)
assert.match(acceptance, /overseasPdaCodes\.size === 1/)