feat(shipping-notice): 完善发货通知自动推进与多库存源复核闭环
This commit is contained in:
1 parent
cfa19a0b7b
commit
8e0bbf7a81
180 files changed
+31210
-1864
No files matched your search
@@ -75,6 +75,51 @@ describe('normalizeShippingProcessingProjection', () => {
|
||||
expect(normalized?.stageNodes?.[1]?.absoluteIndex).toBe(2);
|
||||
});
|
||||
|
||||
it('normalizes structured inventory candidate facts', () => {
|
||||
const projection = normalizeShippingProcessingProjection({
|
||||
work_item_no: 'SN-001',
|
||||
work_item_type: 'order_task',
|
||||
source_type: 'eml',
|
||||
submission_no: 'SUB-1',
|
||||
intake_no: 'INT-1',
|
||||
status: 'processing',
|
||||
stage: 'inventory_matching',
|
||||
progress_version: 2,
|
||||
last_activity_at: '2026-08-08T22:00:00',
|
||||
source_summary: {},
|
||||
available_actions: [],
|
||||
child_order_tasks: [],
|
||||
blocking_reason: {
|
||||
code: 'inventory_candidates_missing',
|
||||
i18n_key: 'workspace.shippingNotice.processGate.reasons.inventory_candidates_missing',
|
||||
},
|
||||
facts: {
|
||||
candidate_set_id: 12,
|
||||
candidate_set_version: 3,
|
||||
candidate_set_status: 'frozen',
|
||||
candidate_source_codes: ['DBS_DUB'],
|
||||
prepared_source_codes: ['DBS_DUB'],
|
||||
pending_source_codes: ['DBS_RTM'],
|
||||
failed_source_codes: ['DBS_SIN'],
|
||||
source_attempts: {
|
||||
DBS_DUB: { status: 'consumed', attempt_no: 1 },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
expect(projection?.facts?.candidateSetId).toBe(12);
|
||||
expect(projection?.facts?.candidateSetVersion).toBe(3);
|
||||
expect(projection?.facts?.candidateSetStatus).toBe('frozen');
|
||||
expect(projection?.facts?.candidateSourceCodes).toEqual(['DBS_DUB']);
|
||||
expect(projection?.facts?.preparedSourceCodes).toEqual(['DBS_DUB']);
|
||||
expect(projection?.facts?.pendingSourceCodes).toEqual(['DBS_RTM']);
|
||||
expect(projection?.facts?.failedSourceCodes).toEqual(['DBS_SIN']);
|
||||
expect(projection?.facts?.sourceAttempts).toEqual({
|
||||
DBS_DUB: { status: 'consumed', attempt_no: 1 },
|
||||
});
|
||||
expect(projection?.blockingReason?.code).toBe('inventory_candidates_missing');
|
||||
});
|
||||
|
||||
it('returns null when work_item_no missing', () => {
|
||||
expect(normalizeShippingProcessingProjection({ status: 'processing' })).toBeNull();
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user