test(admin): align phase3 loading producer contract
This commit is contained in:
@@ -163,7 +163,7 @@ export async function run(context) {
|
||||
const preloadPageResponse = await context.request('GET',
|
||||
`${FIRST_LEG}/loading-plans?warehouseId=${encodeURIComponent(warehouseId)}&keyword=${encodeURIComponent(containerNo)}&page=1&size=20`)
|
||||
const preloadPage = context.apiSuccess(MODULE, '查询本轮预装清单', preloadPageResponse, '', OPTIONS)
|
||||
context.assert(MODULE, '预装清单包含本轮 EDITING 计划', preloadPageResponse,
|
||||
context.assert(MODULE, '预装清单包含本轮已推送 EDITING 计划', preloadPageResponse,
|
||||
records(preloadPage).some((item) => id(item.planId) === planId && item.status === 'EDITING'),
|
||||
`records=${records(preloadPage).length}`, OPTIONS)
|
||||
|
||||
@@ -185,7 +185,8 @@ export async function run(context) {
|
||||
failure(wrongWarehouseResponse), `HTTP=${wrongWarehouseResponse.http}, code=${codeOf(wrongWarehouseResponse)}`, OPTIONS)
|
||||
|
||||
const claimResponse = await request(context, 'POST', `${PDA}/tasks/${taskId}/claim`, {
|
||||
expectedAssignmentVersion: 0, operationId: `${context.marker}-pda-claim`.slice(0, 128),
|
||||
expectedAssignmentVersion: Number(task?.assignment?.version || 0),
|
||||
operationId: `${context.marker}-pda-claim`.slice(0, 128),
|
||||
})
|
||||
const claimed = context.apiSuccess(MODULE, '领取本轮柜次 PDA 任务', claimResponse, '', OPTIONS)
|
||||
context.assert(MODULE, 'PDA 任务只分配给当前登录作业员', claimResponse,
|
||||
@@ -194,8 +195,8 @@ export async function run(context) {
|
||||
`workflow=${claimed?.workflowStatus || 'missing'}, assigneeId=${id(claimed?.assignment?.assigneeId) || 'missing'}`, OPTIONS)
|
||||
|
||||
const claimedPlanResponse = await context.request('GET', `${SMART}/plans/${planId}`)
|
||||
const claimedPlan = context.apiSuccess(MODULE, '领取后回查计划进入 LOADING', claimedPlanResponse, '', OPTIONS)
|
||||
context.assert(MODULE, '领取后计划进入 LOADING 并记录版本递增', claimedPlanResponse,
|
||||
const claimedPlan = context.apiSuccess(MODULE, '领取后回查装柜计划', claimedPlanResponse, '', OPTIONS)
|
||||
context.assert(MODULE, '领取任务后计划进入 LOADING 且版本递增', claimedPlanResponse,
|
||||
claimedPlan?.status === 'LOADING' && Number(claimedPlan?.version) === Number(pushed?.version) + 1,
|
||||
`status=${claimedPlan?.status || 'missing'}, version=${claimedPlan?.version ?? 'missing'}`, OPTIONS)
|
||||
|
||||
@@ -267,6 +268,7 @@ export async function run(context) {
|
||||
id(confirmedDetail?.summary?.planId) === planId && confirmedDetail?.summary?.status === 'COMPLETED'
|
||||
&& confirmedDetail?.items?.some?.((item) => id(item.inboundId) === inboundId
|
||||
&& id(item.accountId) === tenantId && Boolean(item.frozenAt))
|
||||
&& confirmedDetail?.histories?.some?.((item) => item.actionType === 'START_LOADING')
|
||||
&& confirmedDetail?.histories?.some?.((item) => item.actionType === 'PDA_COMPLETE_LOADING'
|
||||
&& Boolean(item.operatorName) && Boolean(item.occurredAt)),
|
||||
`items=${confirmedDetail?.items?.length ?? 'n/a'}, histories=${confirmedDetail?.histories?.length ?? 'n/a'}`, OPTIONS)
|
||||
|
||||
Reference in New Issue
Block a user