fix(overseas): repair pallet transitions and transfer queries
This commit is contained in:
@@ -129,7 +129,7 @@ async function verifyRelabel(context, token, order) {
|
||||
const created = await merchant(context, token, 'POST', '客户创建贴标申请', RELABEL, body)
|
||||
const relabelNo = id(created.data?.application?.relabelNo)
|
||||
context.assert(MODULE, '客户贴标申请进入合法待处理状态', created.response,
|
||||
Boolean(relabelNo) && created.data?.application?.status === 'PENDING_PROCESSING'
|
||||
Boolean(relabelNo) && created.data?.application?.status === 'PENDING_REVIEW'
|
||||
&& created.data?.application?.customerOrderNo === order.row.orderNo,
|
||||
`relabelNo=${relabelNo || 'missing'}, status=${created.data?.application?.status || 'missing'}; ${trace(created.response)}`, OPTIONS)
|
||||
if (!relabelNo) return false
|
||||
@@ -145,9 +145,9 @@ async function verifyRelabel(context, token, order) {
|
||||
const detail = await merchant(context, token, 'GET', '客户查询自身贴标申请详情',
|
||||
`${RELABEL}/${encodeURIComponent(relabelNo)}`)
|
||||
context.assert(MODULE, '贴标详情保留明细与创建历史', detail.response,
|
||||
id(detail.data?.application?.relabelNo) === relabelNo && detail.data?.application?.status === 'PENDING_PROCESSING'
|
||||
id(detail.data?.application?.relabelNo) === relabelNo && detail.data?.application?.status === 'PENDING_REVIEW'
|
||||
&& Array.isArray(detail.data?.items) && detail.data.items.length === 1
|
||||
&& Array.isArray(detail.data?.history) && detail.data.history.some((item) => item?.toStatus === 'PENDING_PROCESSING'),
|
||||
&& Array.isArray(detail.data?.history) && detail.data.history.some((item) => item?.toStatus === 'PENDING_REVIEW'),
|
||||
`items=${detail.data?.items?.length ?? 'missing'}, histories=${detail.data?.history?.length ?? 'missing'}; ${trace(detail.response)}`, OPTIONS)
|
||||
context.createdResources.phase4OverseasClientServices.relabelNo = relabelNo
|
||||
return true
|
||||
@@ -299,7 +299,7 @@ export async function run(context) {
|
||||
const transferDone = await verifyTransfer(context, token, orders)
|
||||
const discardDone = await verifyDiscard(context, token, orders)
|
||||
context.createdResources.phase4OverseasClientServices.finalStatuses = {
|
||||
relabel: relabelDone ? 'PENDING_PROCESSING' : null,
|
||||
relabel: relabelDone ? 'PENDING_REVIEW' : null,
|
||||
transfer: transferDone ? 'APPROVED' : null,
|
||||
discard: discardDone ? 'PENDING_REVIEW' : null,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user