feat(phase3): 收口父子单与全链路验收
This commit is contained in:
@@ -71,6 +71,15 @@ function scheduleData(context, suffix, oceanBookingId, containerBookingId, expir
|
||||
}
|
||||
|
||||
export async function run(context) {
|
||||
context.addCoverageGap(MODULE, OPTIONS.scenario, '官网船期查询任务、3天窗口最多3次及失败/过期状态',
|
||||
'当前 PlatformPortScheduleController/OpenAPI 仅公开来源观测 CRUD,没有官网查询 task、3天计数、FAILED/EXPIRED 或任务级人工兜底端点',
|
||||
'contract-gap')
|
||||
context.addCoverageGap(MODULE, OPTIONS.scenario, 'ZIM 官网 hCaptcha 自动查询',
|
||||
'ZIM hCaptcha 需要第三方交互能力,仓库未公开 provider/task 契约;保留为外部依赖缺口',
|
||||
'external-third-party')
|
||||
context.addCoverageGap(MODULE, OPTIONS.scenario, 'COSCO 动态页面自动查询',
|
||||
'COSCO 动态页面没有已公开 provider/task 契约或稳定机器接口;保留为外部依赖缺口',
|
||||
'external-third-party')
|
||||
const suffix = context.marker.replace(/\D/g, '').slice(-10)
|
||||
const probe = await request(context, 'GET', `${BASE}?page=1&size=5&keyword=${encodeURIComponent(context.marker)}`)
|
||||
if (probe.http === 404 || probe.http === 405 || probe.http === 503 || probe.http === 0) {
|
||||
@@ -180,14 +189,18 @@ export async function run(context) {
|
||||
|
||||
const currentData = scheduleData(context, suffix, ocean.id, knownAllocation, false)
|
||||
currentData.sourceRef = payload.data.sourceRef
|
||||
currentData.sourceType = 'MANUAL'
|
||||
currentData.sourceName = `平台人工兜底-${suffix}`
|
||||
const refreshResponse = await request(context, 'PUT', `${BASE}/${scheduleId}`,
|
||||
{ expectedVersion: initialVersion + 1, data: currentData, reason: '刷新为当前有效船期' },
|
||||
{ 'Idempotency-Key': `${context.marker}-port-refresh`.slice(0, 128) })
|
||||
const refreshed = context.apiSuccess(MODULE, '刷新船期为国内出仓可用终态', refreshResponse, '', OPTIONS)
|
||||
context.assert(MODULE, '刷新后船期有效且版本再次递增', refreshResponse,
|
||||
refreshed?.portSchedule?.expired === false
|
||||
&& refreshed?.portSchedule?.schedule?.sourceType === 'MANUAL'
|
||||
&& refreshed?.portSchedule?.schedule?.sourceName === currentData.sourceName
|
||||
&& Number(refreshed?.portSchedule?.schedule?.version) === initialVersion + 2,
|
||||
`expired=${refreshed?.portSchedule?.expired ?? 'missing'}, version=${refreshed?.portSchedule?.schedule?.version ?? 'missing'}`, OPTIONS)
|
||||
`expired=${refreshed?.portSchedule?.expired ?? 'missing'}, sourceType=${refreshed?.portSchedule?.schedule?.sourceType || 'missing'}, version=${refreshed?.portSchedule?.schedule?.version ?? 'missing'}`, OPTIONS)
|
||||
|
||||
if (knownAllocation && inboundId) {
|
||||
const selector = `inboundId=${encodeURIComponent(inboundId)}&containerBookingId=${encodeURIComponent(knownAllocation)}`
|
||||
|
||||
Reference in New Issue
Block a user