feat(shipping-notice): 升级货代发货流程为五阶段,完善业务校验

将货代发货流程从四阶段扩展为五阶段,拆分上传相关逻辑至独立的货代上传阶段;
统一多语言文案修正客户状态语义,将"客户尚未识别"调整为符合业务的"客户尚未确认";
新增严格的上传成功验证谓词,需同时满足任务状态、全部预约单上传成功、存在有效成功上传尝试三个条件方可标记为完成;
新增坐标取值模型配置,支持Legacy冻结绝对坐标和锚点框架受限平移两种模式;
更新全链路相关文档、前端组件、后端服务与测试用例,确保业务逻辑对齐新业务规则。
This commit is contained in:
hugo committed 2026-08-21 09:20:47 +08:00
1 parent 1b6483a4ea
commit 935bf26fa6
86 files changed
+2743 -311

No files matched your search

@@ -1,6 +1,6 @@
/**
* features/chat/shipping/shippingStepper.spec.ts
* 用途:验证发货通知四阶段 Stepper 只消费后端 UI State 投影。
* 用途:验证发货通知五阶段 Stepper 只消费后端 UI State 投影。
* 依赖:shippingStepper 纯函数、vitest。
* 逻辑:后端 UI State 缺失时,前端仍需把关键人工介入态渲染为 blocked。
*/
@@ -12,19 +12,20 @@ import {
} from './shippingStepper';
describe('shippingStepper', () => {
it('renders exactly four stages from backend ui_state', () => {
it('renders exactly five stages from backend ui_state', () => {
const steps = resolveShippingWorkflowSteps({
ui_state: {
steps: [
{ id: 'shipping-stage-1', code: 'intake_parse', label: '接收解析', status: 'completed' },
{ id: 'shipping-stage-2', code: 'order_review', label: '订单复核', status: 'completed' },
{ id: 'shipping-stage-3', code: 'fulfillment_prep', label: '通知准备', status: 'blocked' },
{ id: 'shipping-stage-4', code: 'upload_complete', label: '通知完成', status: 'pending' },
{ id: 'shipping-stage-4', code: 'freight_upload', label: '货代上传', status: 'pending' },
{ id: 'shipping-stage-5', code: 'upload_complete', label: '通知完成', status: 'pending' },
],
},
});
expect(steps).toHaveLength(4);
expect(steps).toHaveLength(5);
expect(steps[2]?.status).toBe('blocked');
});
@@ -33,17 +34,18 @@ describe('shippingStepper', () => {
expect(normalizeShippingWorkflowSteps(null)).toEqual([]);
});
it('maps technical processing stages into the four business stages', () => {
it('maps technical processing stages into the five business stages', () => {
const base = normalizeShippingWorkflowSteps([
{ code: 'intake_parse', status: 'pending' },
{ code: 'order_review', status: 'pending' },
{ code: 'fulfillment_prep', status: 'pending' },
{ code: 'freight_upload', status: 'pending' },
{ code: 'upload_complete', status: 'pending' },
]);
const steps = applyShippingProcessingStageToSteps(base, {
stage: 'inventory_matching',
status: 'running',
});
expect(steps.map((step) => step.status)).toEqual(['completed', 'completed', 'current', 'pending']);
expect(steps.map((step) => step.status)).toEqual(['completed', 'completed', 'current', 'pending', 'pending']);
});
});