This commit is contained in:
2026-09-20 19:48:49 +08:00
parent 93b58fdd6d
commit db07111e63
3 changed files with 37 additions and 3 deletions
@@ -124,11 +124,18 @@ export async function run(context) {
const detailResponse = await context.request('GET', `${CONTAINERS}/domestic/${containerId}`)
const detail = context.apiSuccess(MODULE, '读取本轮货柜权威渠道', detailResponse, '', OPTIONS)
if (id(detail?.container?.id) !== containerId || !detail?.container?.channelCode) {
context.addStep(MODULE, '货柜渠道适用性前置', detailResponse, false, '缺少同柜权威渠道', OPTIONS)
if (id(detail?.container?.id) !== containerId || !detail?.container?.oceanBookingId) {
context.addStep(MODULE, '货柜渠道适用性前置', detailResponse, false, '缺少同柜关联订舱', OPTIONS)
return
}
const expectedTypes = applicableDocumentTypes(detail.container.channelCode)
const bookingId = id(detail.container.oceanBookingId)
const bookingResponse = await context.request('GET', `/api/platform/v1/ocean-bookings/${encodeURIComponent(bookingId)}`)
const booking = context.apiSuccess(MODULE, '读取本柜关联订舱权威渠道', bookingResponse, '', OPTIONS)?.oceanBooking
if (id(booking?.id) !== bookingId || booking?.status !== 'RELEASED' || !booking?.channelCode) {
context.addStep(MODULE, '货柜订舱渠道适用性前置', bookingResponse, false, '关联订舱身份、放舱状态或渠道缺失', OPTIONS)
return
}
const expectedTypes = applicableDocumentTypes(booking.channelCode)
const specs = [
{
type: 'DESTINATION_CLEARANCE',