fix: complete GCP synthetic single-order acceptance and align booking collation [skip ci]
This commit is contained in:
@@ -5,13 +5,19 @@ import { executeOrder } from './prod-release-acceptance.mjs'
|
||||
import { executeDelivery } from './prod-release-delivery-stage.mjs'
|
||||
import { createFlowContext, withFlowJournal, requireSuccess } from './prod-release-http.mjs'
|
||||
import { runDomesticStage } from './prod-release-domestic-stage.mjs'
|
||||
import { runOverseasStage, finishSingleOrderTrip } from './prod-release-overseas-stage.mjs'
|
||||
import { runOverseasStage, finishSingleOrderTrip, validateSyntheticLoadingInput } from './prod-release-overseas-stage.mjs'
|
||||
|
||||
export function loadingVerificationResult(overseas) {
|
||||
return { loadingMeasurementMode: overseas.loadingMeasurementMode, realMeasurementVerified: overseas.realMeasurementVerified === true,
|
||||
scope: overseas.loadingMeasurementMode === 'SYNTHETIC_TEST' ? 'ONE_ORDER_SYNTHETIC_HTTP_PATH' : 'ONE_ORDER_NORMAL_HTTP_PATH' }
|
||||
}
|
||||
|
||||
export async function executeFullFlow(settings, rawInput, journalPath, resume = false, fetcher = fetch) {
|
||||
const input = { ...normalizeOrderInput(rawInput), customer: settings.customer,
|
||||
environment: { mode: settings.environment, apiBase: settings.apiBase },
|
||||
operator: { merchant: settings.credentials.MERCHANT.loginId, admin: settings.credentials.ADMIN.loginId } }
|
||||
validateOrderInput(input)
|
||||
validateSyntheticLoadingInput(input)
|
||||
const binding = fingerprint({ input, credentials: Object.fromEntries(Object.entries(settings.credentials).map(([key,value])=>[key,value.loginId])) })
|
||||
return withFlowJournal(journalPath, binding, async (state, save) => {
|
||||
if (state.status !== 'NEW' && !resume) throw Error('已有全流程检查点,须保持原输入并显式 --resume')
|
||||
@@ -73,7 +79,7 @@ export async function executeFullFlow(settings, rawInput, journalPath, resume =
|
||||
if (delivery.blockers.length) throw Error(`签收/回传未闭环:${delivery.blockers.join(',')}`)
|
||||
const tripClosure = await finishSingleOrderTrip({ input: { ...input, customerId: settings.customer.id }, overseas, context: ctx, checkpoint: checkpoint('tripClosure') })
|
||||
const result = { status: 'SINGLE_ORDER_HTTP_COMPLETED', fullFlowVerified: true,
|
||||
scope: 'ONE_ORDER_NORMAL_HTTP_PATH', orderNo: order.orderNo, inboundCode: order.inboundCode,
|
||||
...loadingVerificationResult(overseas), orderNo: order.orderNo, inboundCode: order.inboundCode,
|
||||
containerNo: domestic.containerNo, dispatchNo: overseas.dispatchNo, deliveryNo: overseas.deliveryNo,
|
||||
domesticOrderStatus: delivery.domesticOrderStatus, domesticInboundStatus: delivery.domesticInboundStatus,
|
||||
tripClosureStatus: tripClosure.status,
|
||||
|
||||
Reference in New Issue
Block a user