chore(shipping-notice): 统一货代发货生命周期阶段命名并优化全链路业务逻辑

This commit is contained in:
hugo committed 2026-08-17 19:56:51 +08:00
1 parent 5ef8329bd8
commit 4ec4e57005
183 files changed
+14653 -3936

No files matched your search

@@ -55,6 +55,7 @@ describe('workbenchActionRegistry', () => {
for (const code of [
'confirm_inventory_source',
'match_inventory',
'retry_inventory_matching',
'generate_excel',
'mark_manual_uploaded',
'retry_upload',
@@ -69,6 +70,8 @@ describe('workbenchActionRegistry', () => {
expect(WORKBENCH_ACTION_REGISTRY.open_inventory_source_review.reviewBehavior).toBe('open_inventory_candidates');
expect(WORKBENCH_ACTION_REGISTRY.confirm_inventory_source.reviewBehavior).toBe('todo_panel');
expect(WORKBENCH_ACTION_REGISTRY.confirm_customer.reviewBehavior).toBe('open_customer_dialog');
// 保存订单并校验只属于工作台底栏,不得注册为右栏当前任务动作。
expect(WORKBENCH_ACTION_REGISTRY.validate).toBeUndefined();
});
it('hides open_order_review / edit_formal_task / refresh on review surface', () => {
@@ -110,6 +113,10 @@ describe('workbenchActionRegistry', () => {
it('exposes match_inventory as primary for review Footer', () => {
const result = resolveProcessingActionPresentation(projection({
uiState: {
status: 'waiting_human', stage: 'inventory_matching', blocking_reason: null,
primary_action: { code: 'match_inventory', label_key: 'x' }, secondary_actions: [],
},
currentGate: {
gateCode: 'inventory_match',
status: 'blocked',
@@ -124,9 +131,35 @@ describe('workbenchActionRegistry', () => {
expect(result.secondary).toBeNull();
});
it('routes backend retry_inventory_matching through the formal Gate todo action', () => {
const result = resolveProcessingActionPresentation(projection({
uiState: {
status: 'retryable', stage: 'inventory_matching', blocking_reason: null,
primary_action: { code: 'retry_inventory_matching', label_key: 'x' }, secondary_actions: [],
},
currentGate: {
gateCode: 'inventory_matching',
status: 'blocked_retryable',
nextActionCode: 'retry_inventory_matching',
blockingReasonCode: 'inventory_match_failed',
attemptNo: 1,
},
}), { surface: 'review', actionsExecutable: true });
expect(result.primary?.actionCode).toBe('retry_inventory_matching');
const resolved = resolveWorkbenchActionItem(result.primary!, { postCreate: true });
expect(resolved?.reviewBehavior).toBe('todo_panel');
expect(resolved?.todoActionCode).toBe('retry_inventory_matching');
});
it('shows RPA upload retry instead of manual upload entries when Gate 19 is blocked', () => {
const result = resolveProcessingActionPresentation(projection({
stage: 'freight_uploading',
uiState: {
status: 'retryable', stage: 'freight_uploading', blocking_reason: null,
primary_action: { code: 'retry_freight_upload_rpa', label_key: 'x' },
secondary_actions: [{ code: 'download_excel', enabled: true }],
},
currentGate: {
gateCode: 'freight_upload_rpa',
status: 'blocked',