feat(shipping-notice): 收敛订单处理状态与履约门禁

This commit is contained in:
hugo committed 2026-09-07 09:42:12 +08:00
1 parent bffcd55b40
commit 70dd0051b8
153 files changed
+10916 -4296

No files matched your search

@@ -42,11 +42,12 @@ describe('useChatShippingRefresh', () => {
it('syncs ui_state for notifications without attaching chat action buttons', async () => {
getWorkspaceShippingTaskUiState.mockResolvedValue({
task_no: 'SN-FOCUS-B',
checkpoint: 'ready_export',
match_status: 'matched',
lifecycle_stage: 'fulfillment_prep',
user_mode: 'auto_continue',
position: 'ready_to_export',
match_status: 'fulfillable',
review_status: null,
pending_human_reason: null,
match_status: 'fulfillable',
current_step: null,
steps: [],
summary: {
@@ -102,11 +103,12 @@ describe('useChatShippingRefresh', () => {
it('clears legacy shipping_actions even when api returns action_buttons', async () => {
getWorkspaceShippingTaskUiState.mockResolvedValue({
task_no: 'SN-SOURCE-001',
checkpoint: 'ready_export',
match_status: 'matched',
lifecycle_stage: 'fulfillment_prep',
user_mode: 'auto_continue',
position: 'ready_to_export',
match_status: 'fulfillable',
review_status: null,
pending_human_reason: null,
match_status: 'fulfillable',
current_step: null,
steps: [],
summary: {
@@ -187,4 +189,33 @@ describe('useChatShippingRefresh', () => {
expect(getWorkspaceShippingTaskUiState).not.toHaveBeenCalled();
expect(messages.value[0].shipping_actions).toBeUndefined();
});
it('treats lifecycle upload_complete as terminal without position code', async () => {
getWorkspaceShippingTaskUiState.mockResolvedValue({
task_no: 'SN-DONE-001',
lifecycle_stage: 'upload_complete',
user_mode: 'complete',
steps: [],
summary: { title: '已完成', message: '上传完成' },
});
const messages = ref([
{
role: 'assistant' as const,
content: '处理中',
shipping_actions: [{ id: 'x', label: 'x', message: 'x', variant: 'primary' as const }],
},
]);
const { refreshShippingActions } = createShippingActionsRefresher({
isShippingNoticeAgent: computed(() => true),
messages,
conversationId: ref('conv-done'),
isThinking: ref(false),
resolvedShippingTaskId: ref('SN-DONE-001'),
shippingTaskIdFromQuery: computed(() => ''),
getActiveShippingTaskId: () => 'SN-DONE-001',
});
await refreshShippingActions();
expect(messages.value[0].shipping_actions).toBeUndefined();
expect(messages.value[0].shipping_ui_state?.lifecycle_stage).toBe('upload_complete');
});
});