This commit is contained in:
2026-08-17 18:04:04 +08:00
parent fd4afd6ae6
commit 5c22018edd
5 changed files with 25 additions and 14 deletions
+9 -2
View File
@@ -67,8 +67,15 @@ export function normalizeModuleOrder(modules) {
for (const prerequisite of financeChain) {
if (!normalized.includes(prerequisite)) normalized.splice(normalized.indexOf('finance-downloads'), 0, prerequisite)
}
normalized.splice(normalized.indexOf('finance-downloads'), 1)
normalized.splice(normalized.indexOf('finance-settlement-full') + 1, 0, 'finance-downloads')
const completeFinanceChain = [...financeChain, 'finance-downloads']
const firstChainIndex = normalized.findIndex((name) => completeFinanceChain.includes(name))
let predecessor = firstChainIndex > 0 ? normalized[firstChainIndex - 1] : null
if (!predecessor) predecessor = ['phase3-container-loading', 'inbound-measurement', 'orders', 'merchant-qualification-fixture']
.find((name) => normalized.includes(name)) || null
const withoutChain = normalized.filter((name) => !completeFinanceChain.includes(name))
const insertionIndex = predecessor ? withoutChain.indexOf(predecessor) + 1 : withoutChain.length
withoutChain.splice(insertionIndex, 0, ...completeFinanceChain)
normalized.splice(0, normalized.length, ...withoutChain)
}
if (normalized.includes('fee-items')) {
const prerequisites = ['merchant-qualification-fixture', 'orders']