test(firstleg): verify manual rollover schedule edit

This commit is contained in:
2026-09-26 12:08:29 +08:00
parent 8940c4bcff
commit 5a895bf214
2 changed files with 11 additions and 1 deletions
@@ -172,6 +172,9 @@ export async function run(context) {
const initialVersion = Number(created.portSchedule.schedule.version)
const expiredData = scheduleData(context, suffix, ocean.id, knownAllocation, master.customerId, true)
expiredData.sourceRef = payload.data.sourceRef
// 甩柜只修改原柜的船信息;柜次、订舱关联和船期任务身份保持不变。
expiredData.vesselName = `甩柜改配船-${suffix}`
expiredData.voyageNo = `R${suffix}`
const updateResponse = await request(context, 'PUT', `${BASE}/${scheduleId}`,
{ expectedVersion: initialVersion, data: expiredData, reason: '来源刷新并过期' },
{ 'Idempotency-Key': `${context.marker}-port-update`.slice(0, 128) })
@@ -180,6 +183,13 @@ export async function run(context) {
updated?.portSchedule?.expired === true
&& Number(updated?.portSchedule?.schedule?.version) === initialVersion + 1,
`expired=${updated?.portSchedule?.expired ?? 'missing'}, version=${updated?.portSchedule?.schedule?.version ?? 'missing'}`, OPTIONS)
context.assert(MODULE, '甩柜改船只更新原柜船信息且不改变柜次订舱关联', updateResponse,
id(updated?.portSchedule?.schedule?.id) === scheduleId
&& id(updated?.portSchedule?.schedule?.oceanBookingId) === ocean.id
&& id(updated?.portSchedule?.schedule?.containerBookingId) === (knownAllocation || '')
&& updated?.portSchedule?.schedule?.vesselName === expiredData.vesselName
&& updated?.portSchedule?.schedule?.voyageNo === expiredData.voyageNo,
`schedule=${id(updated?.portSchedule?.schedule?.id)}, ocean=${id(updated?.portSchedule?.schedule?.oceanBookingId)}, container=${id(updated?.portSchedule?.schedule?.containerBookingId)}, vessel=${updated?.portSchedule?.schedule?.vesselName || 'missing'}, voyage=${updated?.portSchedule?.schedule?.voyageNo || 'missing'}`, OPTIONS)
const stale = await request(context, 'PUT', `${BASE}/${scheduleId}`,
{ expectedVersion: initialVersion, data: expiredData, reason: '旧版本覆盖' },