优化
This commit is contained in:
@@ -34,14 +34,20 @@ async function request(context, method, path, body, headers = {}) {
|
||||
}
|
||||
}
|
||||
|
||||
function fixture(context) {
|
||||
return context.createdResources?.orchestrationFixtures?.phase3Container
|
||||
|| context.createdResources?.inboundMeasurement
|
||||
|| context.createdResources?.orders
|
||||
export function selectContainerLoadingFixture(context) {
|
||||
const candidates = [
|
||||
context.createdResources?.orchestrationFixtures?.phase3Container,
|
||||
context.createdResources?.inboundMeasurement,
|
||||
context.createdResources?.orders,
|
||||
].filter(Boolean)
|
||||
// Finance and downstream modules temporarily switch context.marker for
|
||||
// their own isolated runs. Never select the older CAB fixture merely because
|
||||
// it is first in the object; ownership is the marker contract.
|
||||
return candidates.find((candidate) => candidate.marker === context.marker) || candidates[0]
|
||||
}
|
||||
|
||||
export async function run(context) {
|
||||
const source = fixture(context)
|
||||
const source = selectContainerLoadingFixture(context)
|
||||
const tenantId = id(source?.tenantId)
|
||||
const inboundId = id(source?.inboundId)
|
||||
if (!tenantId || !inboundId || source?.marker !== context.marker) {
|
||||
|
||||
Reference in New Issue
Block a user