feat(shipping-notice): 收敛阶段能力投影并修复库存 RPA 运行链路
下发 preparation capabilities 并与右卡展示同源授权; 库存 RPA 运行态请求内 memo;取消会话 Profile 本地 TTL; 并为 shipping-worker 挂载共享盘。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
f773237226
commit
a6edc4fe61
16 files changed
+433
-179
No files matched your search
@@ -1471,6 +1471,71 @@ describe('ShippingOrderReviewView layout phase 1', () => {
|
||||
expect(wrapper.get('[data-testid="review-current-task-status"]').text()).not.toContain('自动处理失败');
|
||||
});
|
||||
|
||||
it('submits retry_inventory_preparation from A even when B.actions lacks the code', async () => {
|
||||
// 回归:右卡只读 A.primary_action 展示「重新获取库存(RPA)」;若仍按 B.actions
|
||||
// 授权,会落到「未识别的动作」。A 展示即写路径授权;capabilities 可作 bypass。
|
||||
activeCase.value = {
|
||||
...activeCase.value,
|
||||
status: 'confirmed', has_formal_ot: true, task_missing: false,
|
||||
confirmed_task_id: 905, confirmed_task_no: 'SN-RPA-A-ONLY',
|
||||
};
|
||||
shippingProcessingProjection.value = {
|
||||
workItemType: 'order_task', workItemNo: 'SN-RPA-A-ONLY',
|
||||
status: 'failed', userStatus: 'retryable', stage: 'inventory_fetching',
|
||||
progressVersion: 3, currentGate: { status: 'blocked_retryable' },
|
||||
uiState: {
|
||||
status: 'retryable', stage: 'inventory_fetching', lifecycleStage: 'fulfillment_prep',
|
||||
primary_action: { code: 'retry_inventory_preparation' },
|
||||
secondary_actions: [],
|
||||
},
|
||||
} as any;
|
||||
const taskApi = await import('@/features/chat/api/shipping.api');
|
||||
vi.mocked(taskApi.getWorkspaceShippingTask).mockResolvedValue({
|
||||
task_no: 'SN-RPA-A-ONLY', status: 'processing', lines: [], events: [],
|
||||
ui_state: {
|
||||
// B.actions 故意为空:模拟展示单源收敛后 B 滞后 / 无同码。
|
||||
actions: { primary: null, secondary: [] },
|
||||
process_gate: {
|
||||
execution_no: 'EXEC-RPA-A-ONLY',
|
||||
current_blocking_gate: {
|
||||
gate_code: 'inventory_preparation', evaluation_version: 2, status: 'blocked_retryable',
|
||||
},
|
||||
allowed_actions: ['retry_inventory_preparation'],
|
||||
recovery_targets: [{ action_code: 'retry_inventory_preparation' }],
|
||||
},
|
||||
stage_context: {
|
||||
preparation: {
|
||||
status: 'blocked', source_locked: false, source_options: [{ source_code: 'DSV' }],
|
||||
capabilities: [{
|
||||
code: 'retry_inventory_preparation', scope: 'task',
|
||||
action_code: 'retry_inventory_preparation', enabled: true,
|
||||
}],
|
||||
frozen_order_lines: [], lines: [],
|
||||
},
|
||||
},
|
||||
summary: {}, steps: [],
|
||||
},
|
||||
} as any);
|
||||
|
||||
submitProcessGatePrimaryActionMock.mockClear();
|
||||
messageMocks.info.mockClear();
|
||||
const wrapper = await mountView({ lifecycle_stage: 'fulfillment_prep' });
|
||||
await flushPromises();
|
||||
await wrapper.get('[data-testid="review-current-processing-retry"]').trigger('click');
|
||||
await flushPromises();
|
||||
|
||||
expect(messageMocks.info).not.toHaveBeenCalledWith(
|
||||
expect.stringMatching(/未识别的动作|Unrecognized action/),
|
||||
);
|
||||
expect(submitProcessGatePrimaryActionMock).toHaveBeenCalledWith(
|
||||
expect.any(Object),
|
||||
expect.objectContaining({
|
||||
actionCode: 'retry_inventory_preparation',
|
||||
stageCapabilityBypass: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('refreshes the processing projection after field-conflict adjudication refreshes the Case', async () => {
|
||||
activeCase.value = {
|
||||
...activeCase.value,
|
||||
|
||||
Reference in new issue
Block a user