feat: support shared FBA appointments and arrival calendar
This commit is contained in:
@@ -92,7 +92,7 @@ async function inboundAdminLifecycle(context) {
|
||||
const appointmentNo = `FBA-${suffix}`.slice(0, 64)
|
||||
const now = Date.now()
|
||||
const appointmentBody = {
|
||||
customerId, lineIds: fbaLines.map((line) => id(line.id)), appointmentNo,
|
||||
lineIds: fbaLines.map((line) => id(line.id)), appointmentNo,
|
||||
appointmentAt: new Date(now + 24 * 60 * 60_000).toISOString().slice(0, 19),
|
||||
expectedLoadingAt: new Date(now + 26 * 60 * 60_000).toISOString().slice(0, 19),
|
||||
appointmentStatus: 'PENDING', appointmentRemark: context.marker,
|
||||
@@ -108,16 +108,17 @@ async function inboundAdminLifecycle(context) {
|
||||
})
|
||||
context.addStep(MODULE, 'FBA预约同单号异载荷返回A0409', appointmentConflict,
|
||||
conflict(appointmentConflict), trace(appointmentConflict), OPTIONS)
|
||||
const detail = await request(context, 'GET', '查询FBA预约详情', query(
|
||||
`${PLAN_BASE}/fba-appointments/${encodeURIComponent(appointmentNo)}`, { customerId }))
|
||||
const detail = await request(context, 'GET', '查询FBA预约详情',
|
||||
`${PLAN_BASE}/fba-appointments/${encodeURIComponent(appointmentNo)}`)
|
||||
context.assert(MODULE, 'FBA预约详情冻结仓码和所选明细', null,
|
||||
detail?.appointmentNo === appointmentNo && detail?.fbaWarehouseCode === sample.fbaWarehouseCode
|
||||
&& detail?.items?.length === fbaLines.length,
|
||||
`appointmentNo=${detail?.appointmentNo || 'missing'}, warehouse=${detail?.fbaWarehouseCode || 'missing'}`, OPTIONS)
|
||||
const cancelled = await request(context, 'PUT', '取消本轮FBA预约收口',
|
||||
`${PLAN_BASE}/fba-appointments/${encodeURIComponent(appointmentNo)}`, {
|
||||
customerId, appointmentAt: appointmentBody.appointmentAt,
|
||||
appointmentAt: appointmentBody.appointmentAt,
|
||||
expectedLoadingAt: appointmentBody.expectedLoadingAt,
|
||||
version: detail.version, appointmentEndAt: detail.appointmentEndAt,
|
||||
appointmentStatus: 'CANCELLED', appointmentRemark: `${context.marker}-cancelled`,
|
||||
})
|
||||
context.assert(MODULE, 'FBA预约最终为CANCELLED', null,
|
||||
|
||||
Reference in New Issue
Block a user