feat(shipping-notice): 新增临时库存管理功能,支持创建会话、获取分析结果及字段映射建议
This commit is contained in:
1 parent
46eb63f5bb
commit
e9bdd81f1a
320 files changed
+28361
-10487
No files matched your search
@@ -70,7 +70,9 @@ describe('attachment card utils', () => {
|
||||
});
|
||||
|
||||
it('preserves shipping parsing, failure and duplicate attention states', () => {
|
||||
expect(getAttachmentCardStatus(shippingAttachment({ parseStatus: 'parsing' })).state).toBe('processing');
|
||||
expect(getAttachmentCardStatus(shippingAttachment({ parseStatus: 'parsing' }))).toEqual({
|
||||
state: 'processing', labelKey: 'chat.attachment.parsing',
|
||||
});
|
||||
expect(getAttachmentCardStatus(shippingAttachment({ parseStatus: 'failed' }))).toEqual({
|
||||
state: 'failed', labelKey: 'chat.attachment.parseFailed',
|
||||
});
|
||||
@@ -83,7 +85,9 @@ describe('attachment card utils', () => {
|
||||
allowedActions: [],
|
||||
},
|
||||
})).state).toBe('attention');
|
||||
expect(getAttachmentCardStatus(shippingAttachment()).state).toBe('ready');
|
||||
expect(getAttachmentCardStatus(shippingAttachment())).toEqual({
|
||||
state: 'ready', labelKey: 'chat.attachment.parseSucceeded',
|
||||
});
|
||||
});
|
||||
|
||||
it('shows the order extraction lifecycle separately from attachment parsing', () => {
|
||||
|
||||
@@ -67,7 +67,7 @@ export function getAttachmentCardStatus(attachment: PendingAttachment): Attachme
|
||||
if (attachment.uploadStatus === 'uploading') return { state: 'uploading', labelKey: 'chat.attachment.uploading' };
|
||||
if (attachment.uploadStatus === 'failed') return { state: 'failed', labelKey: 'chat.attachment.uploadFailed' };
|
||||
if (attachment.parseStatus === 'queued' || attachment.parseStatus === 'parsing') {
|
||||
return { state: 'processing', labelKey: 'chat.attachment.processing' };
|
||||
return { state: 'processing', labelKey: 'chat.attachment.parsing' };
|
||||
}
|
||||
if (attachment.parseStatus === 'failed') return { state: 'failed', labelKey: 'chat.attachment.parseFailed' };
|
||||
const extractionStatus = String(attachment.orderExtractionStatus || '').trim().toLowerCase();
|
||||
@@ -92,7 +92,7 @@ export function getAttachmentCardStatus(attachment: PendingAttachment): Attachme
|
||||
}
|
||||
}
|
||||
if (attachment.parseStatus === 'parsed' || attachment.parseStatus === 'consumed') {
|
||||
return { state: 'ready', labelKey: 'chat.attachment.ready' };
|
||||
return { state: 'ready', labelKey: 'chat.attachment.parseSucceeded' };
|
||||
}
|
||||
return { state: 'pending', labelKey: 'chat.attachment.pending' };
|
||||
}
|
||||
@@ -129,9 +129,7 @@ function getSnapshotAttachmentName(attachment: PendingAttachment): string {
|
||||
return basename.replace(/[\u0000-\u001f\u007f]/g, '').trim().slice(0, 255) || 'attachment';
|
||||
}
|
||||
|
||||
/**
|
||||
* 鐢熸垚鍙寔涔呭寲鐨勯檮浠跺揩鐓?ID锛屼紭鍏堝鐢ㄥ緟鍙戦€侀檮浠剁殑鏈湴鏍囪瘑锛岄伩鍏嶅紩鍏?File 鎴栧唴閮ㄨ祫浜ф寚閽堛€?
|
||||
*/
|
||||
/** 生成可持久化的附件快照 ID,避免引入 File 或内部资产指针。 */
|
||||
function getSnapshotAttachmentId(attachment: PendingAttachment, index: number): string {
|
||||
const candidate = String(attachment.id || '')
|
||||
.replace(/[\u0000-\u001f\u007f]/g, '')
|
||||
|
||||
Reference in new issue
Block a user