feat(freight-rpa): 库存/收料改名在手/入站,报表归属RPA,类名统一FreightRpa
把 shipping 侧 inventory/receipt 词根迁到 onhand/inbound,29 张表与 枚举/权限/前端/i18n 同步改名;在手与入站报表配置及文件改由 freight_rpa 持有,发货与调拨仅按 source_code 消费;ORM 类加 FreightRpa 前缀, 上传动作改为 freight_rpa_upload。含类名与上传动作改名规格文档。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
ffc0d4a430
commit
39fe3c05f2
453 files changed
+17945
-8646
No files matched your search
@@ -24,7 +24,7 @@ function projection(
|
||||
submissionNo: 'SOS-1',
|
||||
intakeNo: 'SNI-1',
|
||||
status: 'blocked',
|
||||
stage: 'inventory_source_resolving',
|
||||
stage: 'onhand_source_resolving',
|
||||
progressVersion: 1,
|
||||
lastActivityAt: '2026-08-05T00:00:00Z',
|
||||
currentGate: null,
|
||||
@@ -103,7 +103,7 @@ describe('resolveProcessingActionPresentation', () => {
|
||||
it('does not turn diagnostic gate nextActionCode into a user action', () => {
|
||||
const result = resolveProcessingActionPresentation(projection({
|
||||
currentGate: {
|
||||
gateCode: 'inventory_source_routing',
|
||||
gateCode: 'onhand_source_routing',
|
||||
status: 'blocked',
|
||||
nextActionCode: 'open_inventory_source_review',
|
||||
blockingReasonCode: 'no_inventory_source_candidates',
|
||||
@@ -118,21 +118,21 @@ describe('resolveProcessingActionPresentation', () => {
|
||||
const result = resolveProcessingActionPresentation(projection({
|
||||
status: 'processing',
|
||||
currentGate: {
|
||||
gateCode: 'inventory_source_routing', status: 'blocked', nextActionCode: 'retry',
|
||||
gateCode: 'onhand_source_routing', status: 'blocked', nextActionCode: 'retry',
|
||||
blockingReasonCode: null, attemptNo: 1,
|
||||
},
|
||||
primaryAction: { code: 'retry_parse', i18nKey: 'action.retry_parse', parameters: {} },
|
||||
availableActions: ['retry_parse', 'view_result'],
|
||||
uiState: {
|
||||
status: 'waiting_human', stage: 'fulfillment_prep', blocking_reason: null,
|
||||
primary_action: { code: 'retry_inventory_preparation', i18nKey: 'action.retry_inventory_preparation', parameters: {} },
|
||||
primary_action: { code: 'retry_onhand_preparation', i18nKey: 'action.retry_onhand_preparation', parameters: {} },
|
||||
secondary_actions: [
|
||||
{ code: 'view_details', enabled: true },
|
||||
{ code: 'retry_parse', enabled: false },
|
||||
],
|
||||
},
|
||||
}));
|
||||
expect(result.primary?.actionCode).toBe('retry_inventory_preparation');
|
||||
expect(result.primary?.actionCode).toBe('retry_onhand_preparation');
|
||||
expect(result.secondary?.actionCode).toBe('view_details');
|
||||
expect(result.overflow).toEqual([]);
|
||||
});
|
||||
@@ -230,10 +230,10 @@ describe('resolveProcessingActionPresentation', () => {
|
||||
const result = resolveProcessingActionPresentation(projection({
|
||||
status: 'waiting_human',
|
||||
uiState: {
|
||||
status: 'waiting_human', stage: 'inventory_fetching', blocking_reason: null,
|
||||
status: 'waiting_human', stage: 'onhand_fetching', blocking_reason: null,
|
||||
primary_action: {
|
||||
code: 'retry_inventory_preparation',
|
||||
i18nKey: 'workspace.shippingNotice.processGate.actionCodes.retry_inventory_preparation',
|
||||
code: 'retry_onhand_preparation',
|
||||
i18nKey: 'workspace.shippingNotice.processGate.actionCodes.retry_onhand_preparation',
|
||||
parameters: {},
|
||||
},
|
||||
// Gate 工作台可保留受控上传入口;批次卡只消费 primary_action。
|
||||
@@ -242,7 +242,7 @@ describe('resolveProcessingActionPresentation', () => {
|
||||
}), { surface: 'right' });
|
||||
|
||||
expect(result.primary).toMatchObject({
|
||||
actionCode: 'retry_inventory_preparation',
|
||||
actionCode: 'retry_onhand_preparation',
|
||||
labelKey: 'workspace.shippingNotice.processGate.inventoryActions.retryInventoryPreparation',
|
||||
});
|
||||
expect(result.secondary).toBeNull();
|
||||
@@ -251,14 +251,14 @@ describe('resolveProcessingActionPresentation', () => {
|
||||
it('uses the shared inventory presentation for a rematch action', () => {
|
||||
const result = resolveProcessingActionPresentation(projection({
|
||||
uiState: {
|
||||
status: 'waiting_human', stage: 'inventory_matching', blocking_reason: null,
|
||||
primary_action: { code: 'retry_inventory_matching', i18nKey: null, parameters: {} },
|
||||
status: 'waiting_human', stage: 'onhand_matching', blocking_reason: null,
|
||||
primary_action: { code: 'retry_onhand_matching', i18nKey: null, parameters: {} },
|
||||
secondary_actions: [],
|
||||
},
|
||||
}), { surface: 'right' });
|
||||
|
||||
expect(result.primary).toMatchObject({
|
||||
actionCode: 'retry_inventory_matching',
|
||||
actionCode: 'retry_onhand_matching',
|
||||
labelKey: 'workspace.shippingNotice.processGate.inventoryActions.retryInventoryMatching',
|
||||
});
|
||||
});
|
||||
@@ -332,7 +332,7 @@ describe('resolveProcessingActionPresentation', () => {
|
||||
it('preserves a backend-directed fulfillment preparation target for review navigation', () => {
|
||||
const result = resolveProcessingActionPresentation(projection({
|
||||
uiState: {
|
||||
status: 'waiting_human', stage: 'inventory_matching', blocking_reason: null,
|
||||
status: 'waiting_human', stage: 'onhand_matching', blocking_reason: null,
|
||||
primary_action: {
|
||||
code: 'view_result',
|
||||
targetLifecycleStage: 'fulfillment_prep',
|
||||
@@ -351,7 +351,7 @@ describe('resolveProcessingActionPresentation', () => {
|
||||
it('preserves a backend-directed fulfillment target on a secondary action', () => {
|
||||
const result = resolveProcessingActionPresentation(projection({
|
||||
uiState: {
|
||||
status: 'waiting_human', stage: 'inventory_matching', blocking_reason: null,
|
||||
status: 'waiting_human', stage: 'onhand_matching', blocking_reason: null,
|
||||
primary_action: null,
|
||||
secondary_actions: [{
|
||||
code: 'view_result', enabled: true,
|
||||
@@ -373,7 +373,7 @@ describe('resolveProcessingActionPresentation', () => {
|
||||
const result = resolveConversationTaskActionPresentation({
|
||||
task_no: 'SN-1', group: 'needs_action', status_label: 'waiting_human',
|
||||
uiState: {
|
||||
status: 'waiting_human', stage: 'inventory_matching', blocking_reason: null,
|
||||
status: 'waiting_human', stage: 'onhand_matching', blocking_reason: null,
|
||||
primary_action: null,
|
||||
secondary_actions: [{
|
||||
code: 'view_result', enabled: true,
|
||||
|
||||
@@ -32,11 +32,11 @@ const ACTION_CODE_TO_INTENT: Record<string, ShippingProcessingActionIntent> = {
|
||||
confirm_customer: 'confirm_customer',
|
||||
resolve_field_conflicts: 'resolve_field_conflicts',
|
||||
adjudicate_duplicate: 'adjudicate_duplicate',
|
||||
open_inventory_match_review: 'open_inventory_match_review',
|
||||
open_onhand_match_review: 'open_onhand_match_review',
|
||||
open_shortage_review: 'open_shortage_review',
|
||||
reload_inventory_result: 'reload_inventory_result',
|
||||
retry_inventory_preparation: 'retry_inventory_preparation',
|
||||
retry_inventory_matching: 'retry_inventory_matching',
|
||||
reload_onhand_result: 'reload_onhand_result',
|
||||
retry_onhand_preparation: 'retry_onhand_preparation',
|
||||
retry_onhand_matching: 'retry_onhand_matching',
|
||||
reparse_batch: 'reparse_batch',
|
||||
retry_parse: 'retry_parse',
|
||||
retry_failed_documents: 'retry_failed_documents',
|
||||
@@ -52,10 +52,10 @@ const ACTION_CODE_TO_INTENT: Record<string, ShippingProcessingActionIntent> = {
|
||||
retry_with_latest_rules: 'retry_with_latest_rules',
|
||||
recheck_freeze_readiness: 'recheck_freeze_readiness',
|
||||
retry_task_creation: 'retry_task_creation',
|
||||
retry_inventory_field_mapping: 'retry_inventory_field_mapping',
|
||||
recheck_inventory_sufficiency: 'recheck_inventory_sufficiency',
|
||||
retry_onhand_field_mapping: 'retry_onhand_field_mapping',
|
||||
recheck_onhand_sufficiency: 'recheck_onhand_sufficiency',
|
||||
recheck_excel_readiness: 'recheck_excel_readiness',
|
||||
poll_inventory_preparation: 'refresh',
|
||||
poll_onhand_preparation: 'refresh',
|
||||
poll_freight_upload_rpa: 'refresh',
|
||||
edit_order_fields: 'open_order_review',
|
||||
edit_reservation: 'open_order_review',
|
||||
@@ -86,13 +86,13 @@ const ACTION_CODE_TO_INTENT: Record<string, ShippingProcessingActionIntent> = {
|
||||
const AUTOMATING_STATUSES = new Set(['processing', 'automating', 'queued']);
|
||||
/** 需要在聊天/右侧展示精确恢复动作文案的正式 action_code。 */
|
||||
const RECOVERY_ACTION_CODES = new Set([
|
||||
'reload_inventory_result',
|
||||
'retry_inventory_preparation', 'retry_inventory_matching', 'retry_parse',
|
||||
'reload_onhand_result',
|
||||
'retry_onhand_preparation', 'retry_onhand_matching', 'retry_parse',
|
||||
'retry_failed_documents', 'retry_failed_attachments', 'retry_freight_upload_rpa',
|
||||
'retry_order_extraction', 'retry_layout_parsing', 'rematerialize_document',
|
||||
'reroute_document_profile', 'revalidate_reservation', 'retry_customer_resolution',
|
||||
'retry_duplicate_detection', 'retry_with_latest_rules', 'recheck_freeze_readiness',
|
||||
'retry_task_creation', 'retry_inventory_field_mapping', 'recheck_inventory_sufficiency',
|
||||
'retry_task_creation', 'retry_onhand_field_mapping', 'recheck_onhand_sufficiency',
|
||||
'recheck_excel_readiness', 'retry_stp_auto_create', 'reparse',
|
||||
]);
|
||||
/** 永不升为主 CTA 的动作码(仍可作次要/溢出)。 */
|
||||
@@ -113,13 +113,13 @@ const FILE_ROW_NAVIGATION_CODES = new Set([
|
||||
* 或 retry_inventory_matching 等稳定动作码。
|
||||
*/
|
||||
const INTERNAL_INVENTORY_ACTION_CODES = new Set([
|
||||
'retry_inventory_from_preparation',
|
||||
'retry_inventory_from_matching',
|
||||
'retry_inventory_field_mapping',
|
||||
'retry_inventory_from_field_mapping',
|
||||
'poll_inventory_preparation',
|
||||
'refresh_inventory_candidate_projection',
|
||||
'recheck_inventory_sufficiency',
|
||||
'retry_onhand_from_preparation',
|
||||
'retry_onhand_from_matching',
|
||||
'retry_onhand_field_mapping',
|
||||
'retry_onhand_from_field_mapping',
|
||||
'poll_onhand_preparation',
|
||||
'refresh_onhand_candidate_projection',
|
||||
'recheck_onhand_sufficiency',
|
||||
]);
|
||||
|
||||
/**
|
||||
@@ -131,13 +131,13 @@ const INTERNAL_INVENTORY_ACTION_CODES = new Set([
|
||||
export function inventoryActionLabelKey(code: string | null | undefined): string | null {
|
||||
const normalized = String(code || '').trim().toLowerCase();
|
||||
const keyByCode: Record<string, string> = {
|
||||
reload_inventory_result: 'workspace.shippingNotice.processGate.inventoryActions.reloadInventoryResult',
|
||||
retry_inventory_preparation: 'workspace.shippingNotice.processGate.inventoryActions.retryInventoryPreparation',
|
||||
retry_inventory_matching: 'workspace.shippingNotice.processGate.inventoryActions.retryInventoryMatching',
|
||||
open_inventory_match_review: 'workspace.shippingNotice.processGate.inventoryActions.openInventoryMatchReview',
|
||||
reload_onhand_result: 'workspace.shippingNotice.processGate.inventoryActions.reloadInventoryResult',
|
||||
retry_onhand_preparation: 'workspace.shippingNotice.processGate.inventoryActions.retryInventoryPreparation',
|
||||
retry_onhand_matching: 'workspace.shippingNotice.processGate.inventoryActions.retryInventoryMatching',
|
||||
open_onhand_match_review: 'workspace.shippingNotice.processGate.inventoryActions.openInventoryMatchReview',
|
||||
open_shortage_review: 'workspace.shippingNotice.processGate.inventoryActions.openShortageReview',
|
||||
download_inventory_file: 'workspace.shippingNotice.processGate.inventoryActions.downloadInventoryFile',
|
||||
release_inventory_shortage: 'workspace.shippingNotice.processGate.inventoryActions.releaseInventoryShortage',
|
||||
download_onhand_file: 'workspace.shippingNotice.processGate.inventoryActions.downloadInventoryFile',
|
||||
release_onhand_shortage: 'workspace.shippingNotice.processGate.inventoryActions.releaseInventoryShortage',
|
||||
};
|
||||
return keyByCode[normalized] || null;
|
||||
}
|
||||
|
||||
@@ -135,18 +135,18 @@ describe('ReviewProgressStrip', () => {
|
||||
const wrapper = mountStrip(buildProjection({
|
||||
status: 'automating',
|
||||
userStatus: 'waiting_human',
|
||||
stage: 'inventory_fetching',
|
||||
stage: 'onhand_fetching',
|
||||
currentGate: {
|
||||
gateCode: 'inventory_preparation',
|
||||
gateCode: 'onhand_preparation',
|
||||
status: 'blocked_manual',
|
||||
nextActionCode: 'upload_inventory_file',
|
||||
nextActionCode: 'upload_onhand_file',
|
||||
blockingReasonCode: 'inventory_file_empty',
|
||||
attemptNo: 3,
|
||||
},
|
||||
}), true);
|
||||
const title = wrapper.get('[data-testid="review-progress-title"]').text();
|
||||
expect(title).toContain('待人工处理');
|
||||
expect(title).toContain('inventory_fetching');
|
||||
expect(title).toContain('onhand_fetching');
|
||||
expect(title).not.toContain('系统处理中');
|
||||
expect(wrapper.find('[data-testid="review-progress-refresh"]').exists()).toBe(false);
|
||||
expect(wrapper.find('[data-testid="review-workflow-progress-polling"]').exists()).toBe(false);
|
||||
|
||||
@@ -19,7 +19,7 @@ function base(overrides: Partial<ShippingProcessingProjection> = {}): ShippingPr
|
||||
submissionNo: 'SOS-1',
|
||||
intakeNo: 'SNI-1',
|
||||
status: 'blocked',
|
||||
stage: 'inventory_matching',
|
||||
stage: 'onhand_matching',
|
||||
progressVersion: 3,
|
||||
lastActivityAt: '2026-08-05T00:00:00Z',
|
||||
currentGate: null,
|
||||
@@ -41,12 +41,12 @@ function base(overrides: Partial<ShippingProcessingProjection> = {}): ShippingPr
|
||||
describe('mergeWorkbenchProcessingProjection', () => {
|
||||
it('discards stale incoming with lower progressVersion', () => {
|
||||
const local = base({ progressVersion: 5, stage: 'excel_generating' });
|
||||
const incoming = base({ progressVersion: 4, stage: 'inventory_matching' });
|
||||
const incoming = base({ progressVersion: 4, stage: 'onhand_matching' });
|
||||
expect(mergeWorkbenchProcessingProjection(local, incoming)).toBe(local);
|
||||
});
|
||||
|
||||
it('replaces whole projection when incoming version is newer', () => {
|
||||
const local = base({ progressVersion: 5, stage: 'inventory_matching' });
|
||||
const local = base({ progressVersion: 5, stage: 'onhand_matching' });
|
||||
const incoming = base({ progressVersion: 6, stage: 'excel_generating', availableActions: ['download_excel'] });
|
||||
expect(mergeWorkbenchProcessingProjection(local, incoming)).toEqual(incoming);
|
||||
});
|
||||
|
||||
@@ -27,7 +27,7 @@ function baseProjection(
|
||||
submissionNo: 'SOS-1',
|
||||
intakeNo: 'SNI-1',
|
||||
status: 'blocked',
|
||||
stage: 'inventory_source_resolving',
|
||||
stage: 'onhand_source_resolving',
|
||||
progressVersion: 1,
|
||||
lastActivityAt: '2026-08-05T00:00:00Z',
|
||||
currentGate: null,
|
||||
@@ -47,8 +47,8 @@ function baseProjection(
|
||||
}
|
||||
|
||||
describe('progressWindow', () => {
|
||||
it('anchors inventory_source_resolving at index 7', () => {
|
||||
expect(stageAbsoluteIndex('inventory_source_resolving')).toBe(7);
|
||||
it('anchors onhand_source_resolving at index 7', () => {
|
||||
expect(stageAbsoluteIndex('onhand_source_resolving')).toBe(7);
|
||||
});
|
||||
|
||||
it('workbench shows all 15 stages', () => {
|
||||
@@ -85,11 +85,11 @@ describe('progressWindow', () => {
|
||||
|
||||
it('prefers backend stageNodes status over index heuristic', () => {
|
||||
const nodes = buildProgressWindow(baseProjection({
|
||||
stage: 'inventory_source_resolving',
|
||||
stage: 'onhand_source_resolving',
|
||||
status: 'processing',
|
||||
stageNodes: [
|
||||
{ stage: 'upload_received', absoluteIndex: 0, status: 'passed' },
|
||||
{ stage: 'inventory_source_resolving', absoluteIndex: 7, status: 'failed' },
|
||||
{ stage: 'onhand_source_resolving', absoluteIndex: 7, status: 'failed' },
|
||||
],
|
||||
}), 'workbench');
|
||||
expect(nodes[7]?.status).toBe('failed');
|
||||
|
||||
@@ -25,11 +25,11 @@ describe('stageMapping', () => {
|
||||
candidate_creating: 'intake_parse',
|
||||
customer_resolving: 'order_review',
|
||||
duplicate_checking: 'order_review',
|
||||
inventory_source_resolving: 'order_review',
|
||||
onhand_source_resolving: 'order_review',
|
||||
waiting_review: 'order_review',
|
||||
order_creating: 'fulfillment_prep',
|
||||
inventory_fetching: 'fulfillment_prep',
|
||||
inventory_matching: 'fulfillment_prep',
|
||||
onhand_fetching: 'fulfillment_prep',
|
||||
onhand_matching: 'fulfillment_prep',
|
||||
excel_generating: 'fulfillment_prep',
|
||||
freight_uploading: 'freight_upload',
|
||||
completed: 'upload_complete',
|
||||
@@ -41,8 +41,8 @@ describe('stageMapping', () => {
|
||||
});
|
||||
|
||||
it('过渡态归入对应业务标签(库存准备/充足性→通知准备;人工上传交接→货代上传)', () => {
|
||||
expect(mapProcessingStageToLifecycle('inventory_preparation')).toBe('fulfillment_prep');
|
||||
expect(mapProcessingStageToLifecycle('inventory_sufficiency')).toBe('fulfillment_prep');
|
||||
expect(mapProcessingStageToLifecycle('onhand_preparation')).toBe('fulfillment_prep');
|
||||
expect(mapProcessingStageToLifecycle('onhand_sufficiency')).toBe('fulfillment_prep');
|
||||
expect(mapProcessingStageToLifecycle('manual_upload_handoff')).toBe('freight_upload');
|
||||
});
|
||||
|
||||
|
||||
@@ -44,14 +44,14 @@ export const SHIPPING_STAGE_TO_LIFECYCLE: Record<string, LifecycleStageCode> = {
|
||||
candidate_creating: 'intake_parse',
|
||||
customer_resolving: 'order_review',
|
||||
duplicate_checking: 'order_review',
|
||||
inventory_source_resolving: 'order_review',
|
||||
onhand_source_resolving: 'order_review',
|
||||
waiting_review: 'order_review',
|
||||
order_creating: 'fulfillment_prep',
|
||||
inventory_fetching: 'fulfillment_prep',
|
||||
onhand_fetching: 'fulfillment_prep',
|
||||
// 过渡态:库存准备/充足性归入通知准备。
|
||||
inventory_preparation: 'fulfillment_prep',
|
||||
inventory_matching: 'fulfillment_prep',
|
||||
inventory_sufficiency: 'fulfillment_prep',
|
||||
onhand_preparation: 'fulfillment_prep',
|
||||
onhand_matching: 'fulfillment_prep',
|
||||
onhand_sufficiency: 'fulfillment_prep',
|
||||
excel_generating: 'fulfillment_prep',
|
||||
freight_uploading: 'freight_upload',
|
||||
// 过渡态:人工上传交接归入货代上传。
|
||||
|
||||
@@ -27,7 +27,7 @@ function projection(
|
||||
submissionNo: 'SOS-1',
|
||||
intakeNo: 'SNI-1',
|
||||
status: 'blocked',
|
||||
stage: 'inventory_matching',
|
||||
stage: 'onhand_matching',
|
||||
progressVersion: 1,
|
||||
lastActivityAt: '2026-08-05T00:00:00Z',
|
||||
currentGate: null,
|
||||
@@ -53,7 +53,7 @@ describe('workbenchActionRegistry', () => {
|
||||
|
||||
it('registers Gate fulfillment actions and does not retain legacy aliases', () => {
|
||||
for (const code of [
|
||||
'retry_inventory_matching',
|
||||
'retry_onhand_matching',
|
||||
'mark_manual_uploaded',
|
||||
'retry_freight_upload_rpa',
|
||||
'regenerate_excel_artifact',
|
||||
@@ -88,7 +88,7 @@ describe('workbenchActionRegistry', () => {
|
||||
});
|
||||
|
||||
it('hides write actions when actionsExecutable=false but keeps view_result', () => {
|
||||
expect(shouldRenderWorkbenchAction(WORKBENCH_ACTION_REGISTRY.retry_inventory_matching, {
|
||||
expect(shouldRenderWorkbenchAction(WORKBENCH_ACTION_REGISTRY.retry_onhand_matching, {
|
||||
actionsExecutable: false,
|
||||
surface: 'review',
|
||||
})).toBe(false);
|
||||
@@ -113,64 +113,64 @@ describe('workbenchActionRegistry', () => {
|
||||
expect(payload?.action_code).toBe('totally_unknown_action');
|
||||
});
|
||||
|
||||
it('exposes Gate retry_inventory_matching as primary for review Footer', () => {
|
||||
it('exposes Gate retry_onhand_matching as primary for review Footer', () => {
|
||||
const result = resolveProcessingActionPresentation(projection({
|
||||
uiState: {
|
||||
status: 'waiting_human', stage: 'inventory_matching', blocking_reason: null,
|
||||
primary_action: { code: 'retry_inventory_matching', label_key: 'x' }, secondary_actions: [],
|
||||
status: 'waiting_human', stage: 'onhand_matching', blocking_reason: null,
|
||||
primary_action: { code: 'retry_onhand_matching', label_key: 'x' }, secondary_actions: [],
|
||||
},
|
||||
currentGate: {
|
||||
gateCode: 'inventory_match',
|
||||
status: 'blocked',
|
||||
nextActionCode: 'retry_inventory_matching',
|
||||
nextActionCode: 'retry_onhand_matching',
|
||||
blockingReasonCode: 'inventory_shortage',
|
||||
attemptNo: 1,
|
||||
},
|
||||
availableActions: ['refresh'],
|
||||
}), { surface: 'review', actionsExecutable: true });
|
||||
expect(result.primary?.intent).toBe('retry_inventory_matching');
|
||||
expect(result.primary?.actionCode).toBe('retry_inventory_matching');
|
||||
expect(result.primary?.intent).toBe('retry_onhand_matching');
|
||||
expect(result.primary?.actionCode).toBe('retry_onhand_matching');
|
||||
expect(result.secondary).toBeNull();
|
||||
});
|
||||
|
||||
it('routes backend retry_inventory_matching through the formal Gate todo action', () => {
|
||||
it('routes backend retry_onhand_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: [],
|
||||
status: 'retryable', stage: 'onhand_matching', blocking_reason: null,
|
||||
primary_action: { code: 'retry_onhand_matching', label_key: 'x' }, secondary_actions: [],
|
||||
},
|
||||
currentGate: {
|
||||
gateCode: 'inventory_matching',
|
||||
gateCode: 'onhand_matching',
|
||||
status: 'blocked_retryable',
|
||||
nextActionCode: 'retry_inventory_matching',
|
||||
nextActionCode: 'retry_onhand_matching',
|
||||
blockingReasonCode: 'inventory_match_failed',
|
||||
attemptNo: 1,
|
||||
},
|
||||
}), { surface: 'review', actionsExecutable: true });
|
||||
|
||||
expect(result.primary?.actionCode).toBe('retry_inventory_matching');
|
||||
expect(result.primary?.actionCode).toBe('retry_onhand_matching');
|
||||
const resolved = resolveWorkbenchActionItem(result.primary!, { postCreate: true });
|
||||
expect(resolved?.reviewBehavior).toBe('todo_panel');
|
||||
expect(resolved?.todoActionCode).toBe('retry_inventory_matching');
|
||||
expect(resolved?.todoActionCode).toBe('retry_onhand_matching');
|
||||
});
|
||||
|
||||
it('routes merged inventory rematch through the formal Gate todo action', () => {
|
||||
const result = resolveProcessingActionPresentation(projection({
|
||||
uiState: {
|
||||
status: 'retryable', stage: 'inventory_preparation', blocking_reason: null,
|
||||
primary_action: { code: 'retry_inventory_matching', label_key: 'x' }, secondary_actions: [],
|
||||
status: 'retryable', stage: 'onhand_preparation', blocking_reason: null,
|
||||
primary_action: { code: 'retry_onhand_matching', label_key: 'x' }, secondary_actions: [],
|
||||
},
|
||||
currentGate: {
|
||||
gateCode: 'inventory_preparation',
|
||||
gateCode: 'onhand_preparation',
|
||||
status: 'blocked_retryable',
|
||||
nextActionCode: 'retry_inventory_matching',
|
||||
nextActionCode: 'retry_onhand_matching',
|
||||
},
|
||||
}), { surface: 'review' });
|
||||
|
||||
const resolved = resolveWorkbenchActionItem(result.primary!, { postCreate: true });
|
||||
expect(result.primary?.intent).toBe('retry_inventory_matching');
|
||||
expect(result.primary?.intent).toBe('retry_onhand_matching');
|
||||
expect(resolved?.reviewBehavior).toBe('todo_panel');
|
||||
expect(resolved?.todoActionCode).toBe('retry_inventory_matching');
|
||||
expect(resolved?.todoActionCode).toBe('retry_onhand_matching');
|
||||
});
|
||||
|
||||
it('shows RPA upload retry instead of manual upload entries when Gate 19 is blocked', () => {
|
||||
|
||||
@@ -135,37 +135,37 @@ export const WORKBENCH_ACTION_REGISTRY: Record<string, WorkbenchActionRegistryEn
|
||||
isWrite: true,
|
||||
stageFamily: 'pre_create',
|
||||
},
|
||||
open_inventory_match_review: {
|
||||
intent: 'open_inventory_match_review',
|
||||
open_onhand_match_review: {
|
||||
intent: 'open_onhand_match_review',
|
||||
reviewBehavior: 'todo_panel',
|
||||
todoActionCode: 'open_inventory_match_review',
|
||||
todoActionCode: 'open_onhand_match_review',
|
||||
requiresFormalTask: true,
|
||||
isWrite: true,
|
||||
stageFamily: 'post_create',
|
||||
scrollTestId: 'review-formal-task-todo-panel',
|
||||
},
|
||||
retry_inventory_matching: {
|
||||
intent: 'retry_inventory_matching',
|
||||
retry_onhand_matching: {
|
||||
intent: 'retry_onhand_matching',
|
||||
reviewBehavior: 'todo_panel',
|
||||
todoActionCode: 'retry_inventory_matching',
|
||||
todoActionCode: 'retry_onhand_matching',
|
||||
requiresFormalTask: true,
|
||||
isWrite: true,
|
||||
stageFamily: 'post_create',
|
||||
scrollTestId: 'review-formal-task-todo-panel',
|
||||
},
|
||||
retry_inventory_preparation: {
|
||||
intent: 'retry_inventory_preparation',
|
||||
retry_onhand_preparation: {
|
||||
intent: 'retry_onhand_preparation',
|
||||
reviewBehavior: 'todo_panel',
|
||||
todoActionCode: 'retry_inventory_preparation',
|
||||
todoActionCode: 'retry_onhand_preparation',
|
||||
requiresFormalTask: true,
|
||||
isWrite: true,
|
||||
stageFamily: 'post_create',
|
||||
scrollTestId: 'review-formal-task-todo-panel',
|
||||
},
|
||||
reload_inventory_result: {
|
||||
intent: 'reload_inventory_result',
|
||||
reload_onhand_result: {
|
||||
intent: 'reload_onhand_result',
|
||||
reviewBehavior: 'todo_panel',
|
||||
todoActionCode: 'reload_inventory_result',
|
||||
todoActionCode: 'reload_onhand_result',
|
||||
requiresFormalTask: true,
|
||||
isWrite: true,
|
||||
stageFamily: 'post_create',
|
||||
|
||||
Reference in new issue
Block a user