test: cover overseas pda warehouse operation lifecycles

This commit is contained in:
2026-08-25 11:25:13 +08:00
parent 042d0b738a
commit 68bdc3e6bb
6 changed files with 588 additions and 19 deletions
+14 -9
View File
@@ -5,7 +5,7 @@ import { dirname, resolve } from 'node:path'
import { pathToFileURL } from 'node:url'
import process from 'node:process'
const CONFIGURED_MODULES = ['merchant-qualification-fixture', 'customers', 'overseas-storage-fees', 'system', 'notifications', 'master-data', 'suppliers', 'domestic-container', 'orders', 'fee-items', 'pricing', 'downloads', 'inbound-weight-ocr', 'inbound-measurement', 'inbound-fees', 'phase3-container-loading', 'phase3-container-overview', 'phase3-loading', 'phase3-loading-model-bridge', 'phase3-pda-convergence', 'phase3-evidence-gate', 'supplemental', 'supplemental-boundaries', 'ocean-bookings', 'truck-appointments', 'service-center-flow', 'phase3-loading-finalize', 'phase3-customs', 'phase3-port-schedules', 'phase3-carrier-schedule-queries', 'phase3-outbound-dispatch', 'phase3-outbound-aggregate', 'phase3-dispatch-gate', 'phase3-waiting-for-loading', 'phase3-warehouse-rbac', 'phase3-order-splitting', 'manual-state-matrix', 'phase4-overseas-warehouse', 'phase4-carrier-pickup-ready', 'phase4-overseas-pda', 'phase4-overseas-inbound-operations', 'phase4-overseas-client-services', 'phase4-overseas-dispatch', 'phase4-cross-region-events', 'phase4-overseas-business', 'phase4-overseas-master-data', 'phase4-carrier-nodes', 'finance', 'finance-full-fixtures', 'finance-reconciliation-full', 'finance-settlement-full', 'finance-downloads', 'customer-operating-statistics']
const CONFIGURED_MODULES = ['merchant-qualification-fixture', 'customers', 'overseas-storage-fees', 'system', 'notifications', 'master-data', 'suppliers', 'domestic-container', 'orders', 'fee-items', 'pricing', 'downloads', 'inbound-weight-ocr', 'inbound-measurement', 'inbound-fees', 'phase3-container-loading', 'phase3-container-overview', 'phase3-loading', 'phase3-loading-model-bridge', 'phase3-pda-convergence', 'phase3-evidence-gate', 'supplemental', 'supplemental-boundaries', 'ocean-bookings', 'truck-appointments', 'service-center-flow', 'phase3-loading-finalize', 'phase3-customs', 'phase3-port-schedules', 'phase3-carrier-schedule-queries', 'phase3-outbound-dispatch', 'phase3-outbound-aggregate', 'phase3-dispatch-gate', 'phase3-waiting-for-loading', 'phase3-warehouse-rbac', 'phase3-order-splitting', 'manual-state-matrix', 'phase4-overseas-warehouse', 'phase4-carrier-pickup-ready', 'phase4-overseas-pda', 'phase4-overseas-pda-operations', 'phase4-overseas-inbound-operations', 'phase4-overseas-client-services', 'phase4-overseas-dispatch', 'phase4-cross-region-events', 'phase4-overseas-business', 'phase4-overseas-master-data', 'phase4-carrier-nodes', 'finance', 'finance-full-fixtures', 'finance-reconciliation-full', 'finance-settlement-full', 'finance-downloads', 'customer-operating-statistics']
const MODULE_DEPENDENCIES = new Map([
['orders', ['merchant-qualification-fixture']],
@@ -31,11 +31,12 @@ const MODULE_DEPENDENCIES = new Map([
['manual-state-matrix', ['phase3-loading-finalize', 'phase3-customs', 'ocean-bookings']],
['phase4-carrier-pickup-ready', ['phase3-carrier-schedule-queries']],
['phase4-overseas-pda', ['phase4-carrier-pickup-ready']],
['phase4-overseas-inbound-operations', ['phase4-overseas-pda']],
['phase4-overseas-client-services', ['phase4-overseas-pda']],
['phase4-overseas-dispatch', ['phase4-overseas-pda']],
['phase4-cross-region-events', ['system', 'phase3-customs', 'phase4-overseas-pda']],
['phase4-carrier-nodes', ['phase4-overseas-pda']],
['phase4-overseas-pda-operations', ['phase4-overseas-pda']],
['phase4-overseas-inbound-operations', ['phase4-overseas-pda-operations']],
['phase4-overseas-client-services', ['phase4-overseas-pda-operations']],
['phase4-overseas-dispatch', ['phase4-overseas-pda-operations']],
['phase4-cross-region-events', ['system', 'phase3-customs', 'phase4-overseas-pda-operations']],
['phase4-carrier-nodes', ['phase4-overseas-pda-operations']],
])
function stableTopologicalOrder(modules) {
@@ -119,10 +120,14 @@ export function normalizeModuleOrder(modules) {
}
for (const consumer of ['phase4-overseas-inbound-operations', 'phase4-overseas-client-services',
'phase4-overseas-dispatch']) {
if (normalized.includes(consumer) && !normalized.includes('phase4-overseas-pda')) {
normalized.splice(normalized.indexOf(consumer), 0, 'phase4-overseas-pda')
if (normalized.includes(consumer) && !normalized.includes('phase4-overseas-pda-operations')) {
normalized.splice(normalized.indexOf(consumer), 0, 'phase4-overseas-pda-operations')
}
}
if (normalized.includes('phase4-overseas-pda')
&& !normalized.includes('phase4-overseas-pda-operations')) {
normalized.splice(normalized.indexOf('phase4-overseas-pda') + 1, 0, 'phase4-overseas-pda-operations')
}
if (normalized.includes('phase4-overseas-pda')) {
const prerequisites = ['merchant-qualification-fixture', 'phase3-loading', 'phase3-pda-convergence',
'phase3-evidence-gate', 'phase3-loading-finalize']
@@ -133,7 +138,7 @@ export function normalizeModuleOrder(modules) {
if (normalized.includes('phase4-cross-region-events')) {
const prerequisites = ['system', 'merchant-qualification-fixture', 'orders', 'inbound-measurement',
'phase3-container-loading', 'phase3-loading', 'phase3-pda-convergence', 'phase3-evidence-gate',
'phase3-loading-finalize', 'phase3-customs', 'phase4-overseas-pda']
'phase3-loading-finalize', 'phase3-customs', 'phase4-overseas-pda-operations']
const targetIndex = normalized.indexOf('phase4-cross-region-events')
const missing = prerequisites.filter((name) => !normalized.includes(name))
if (missing.length > 0) normalized.splice(targetIndex, 0, ...missing)