refactor(shipping-notice): 重构货代发货通知状态管理,移除废弃的process_status字段

统一货代发货通知的业务阶段为四个标准阶段:接收解析、订单复核、发货准备、上传完成
设置 ui_state 为前端唯一状态数据源,不再依赖 process_status 驱动业务流程
删除 shipping_notices 表的废弃 process_status 列及对应复合索引,新增数据库迁移脚本
替换全栈代码中所有对 process_status 的引用为生命周期、上传状态等领域字段
更新相关文档、测试用例与前端展示逻辑适配新的状态管理规则
This commit is contained in:
hugo committed 2026-08-15 10:19:10 +08:00
1 parent 6684e7181a
commit 5ef8329bd8
178 files changed
+5091 -1734

No files matched your search

@@ -31,7 +31,27 @@ describe('normalizeShippingProcessingProjection', () => {
blocking_reason_code: 'pdf_preferred_critical_conflict',
attempt_no: 1,
},
process_gate: {
execution_no: 'EXE-1',
status: 'blocked',
current_gate_code: 'inventory_preparation',
expected_gate_version: 3,
current_blocking_gate: {
gate_code: 'inventory_preparation',
status: 'blocked_manual',
evaluation_version: 3,
},
next_action_code: 'retry_inventory_preparation',
allowed_actions: ['retry_inventory_preparation', 'upload_inventory_file'],
},
available_actions: ['open_review'],
ui_state: {
status: 'waiting_human',
stage: 'order_review',
blocking_reason: { code: 'pdf_preferred_critical_conflict' },
primary_action: { code: 'resolve_field_conflicts', i18n_key: 'action.resolve_field_conflicts' },
secondary_actions: [{ code: 'view_details', enabled: true }],
},
source_summary: {
email_subject: null,
filename: 'a.pdf',
@@ -53,10 +73,23 @@ describe('normalizeShippingProcessingProjection', () => {
expect(normalized!.status).toBe('waiting_review');
expect(normalized!.currentGate?.gateCode).toBe('field_conflict_resolution');
expect(normalized!.currentGate?.attemptNo).toBe(1);
expect(normalized!.processGate).toMatchObject({
execution_no: 'EXE-1',
current_gate_code: 'inventory_preparation',
expected_gate_version: 3,
next_action_code: 'retry_inventory_preparation',
});
expect(normalized!.sourceSummary.filename).toBe('a.pdf');
expect(normalized!.sourceSummary.documentId).toBe(17);
expect(normalized!.sourceSummary.assetStatus).toBe('ready');
expect(normalized!.availableActions).toEqual(['open_review']);
expect(normalized!.uiState).toEqual({
status: 'waiting_human',
stage: 'order_review',
blocking_reason: { code: 'pdf_preferred_critical_conflict', i18nKey: null, details: {} },
primary_action: { code: 'resolve_field_conflicts', i18nKey: 'action.resolve_field_conflicts', parameters: {} },
secondary_actions: [{ code: 'view_details', enabled: true }],
});
});
it('normalizes stage_nodes from backend', () => {