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
@@ -149,6 +149,24 @@ describe('ShippingWorkflowTimeline', () => {
|
||||
expect(wrapper.find('[data-testid="shipping-workflow-download-toolbar"]').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('shows stage needs_action once even when backend also reports failed for the same files', async () => {
|
||||
// 后端对失败文件会同时写入 needs_action 与 failed;阶段卡只能读 needs_action,禁止再加 failed。
|
||||
const processing = processingProjection({
|
||||
lifecycle_nodes: [
|
||||
{ code: 'intake_parse', status: 'pending', summary: { total: 0, completed: 0, needs_action: 0, processing: 0, failed: 0, blocking_reason: null } },
|
||||
{ code: 'order_review', status: 'blocked', summary: { total: 3, completed: 0, needs_action: 3, processing: 0, failed: 0, blocking_reason: null } },
|
||||
{ code: 'fulfillment_prep', status: 'blocked', summary: { total: 2, completed: 0, needs_action: 2, processing: 0, failed: 2, blocking_reason: null } },
|
||||
{ code: 'freight_upload', status: 'pending', summary: { total: 0, completed: 0, needs_action: 0, processing: 0, failed: 0, blocking_reason: null } },
|
||||
{ code: 'upload_complete', status: 'pending', summary: { total: 0, completed: 0, needs_action: 0, processing: 0, failed: 0, blocking_reason: null } },
|
||||
],
|
||||
} as Partial<ConversationProcessingProjection>);
|
||||
const wrapper = mountTimeline(processing, [fileProjection()]);
|
||||
await flushPromises();
|
||||
|
||||
expect(wrapper.get('[data-testid="shipping-workflow-stage-filter-fulfillment_prep"]').text()).toBe('通知准备2 待处理');
|
||||
expect(wrapper.get('[data-testid="shipping-workflow-stage-filter-order_review"]').text()).toBe('订单复核3 待处理');
|
||||
});
|
||||
|
||||
it('separates ignored Excel attachments from order-file progress totals', async () => {
|
||||
const ignoredExcel = fileProjection({
|
||||
workItemNo: 'PLAN:EML-EXCEL:report',
|
||||
|
||||
@@ -162,12 +162,13 @@ function selectLifecycleFilter(code: 'intake_parse' | 'order_review' | 'fulfillm
|
||||
}
|
||||
/**
|
||||
* 阶段卡优先展示后端统计中的最高关注状态,避免仅显示数字而无法辨识处理中或待处理。
|
||||
* 核心逻辑:后端已把 failed 计入 needs_action,前端只读 needs_action,禁止再加 failed,否则会翻倍。
|
||||
* @param node - 后端五阶段节点及其汇总。
|
||||
* @returns 国际化状态摘要。
|
||||
*/
|
||||
function stageTotalText(node: NonNullable<typeof batchLifecycleNodes.value>[number]): string {
|
||||
const summary = node.summary;
|
||||
const needsAction = Number(summary?.needs_action || 0) + Number(summary?.failed || 0);
|
||||
const needsAction = Number(summary?.needs_action || 0);
|
||||
if (needsAction > 0) return t('chat.shippingProcessing.batchWorkbench.stageSummary.needsAction', { count: needsAction });
|
||||
if (Number(summary?.processing || 0) > 0) return t('chat.shippingProcessing.batchWorkbench.stageSummary.processing', { count: summary?.processing });
|
||||
if (Number(summary?.completed || 0) > 0) return t('chat.shippingProcessing.batchWorkbench.stageSummary.completed', { count: summary?.completed });
|
||||
|
||||
Reference in new issue
Block a user