feat(shipping-notice): 新增货代客户管理功能,支持客户导入、识别证据管理与客户确认

This commit is contained in:
hugo committed 2026-07-16 08:16:19 +08:00
1 parent b595e157e9
commit 4fbaed2b4c
176 files changed
+14011 -994

No files matched your search

@@ -36,6 +36,7 @@ vi.mock('../shipping/shippingNoticeBatchIdempotency', () => ({
const createConversationContext = () => {
const conversationId = ref<string | null>('conv-a');
const messages = ref([]);
const loadConversationState = vi.fn();
const createNewChatView = vi.fn(() => {
conversationId.value = null;
messages.value = [];
@@ -44,6 +45,7 @@ const createConversationContext = () => {
return {
conversationId,
messages,
loadConversationState,
createNewChatView,
api: createChatPageConversationApi({
deps: { t: (key: string) => key, msg: { warning: vi.fn() } },
@@ -54,7 +56,7 @@ const createConversationContext = () => {
activeRunId: ref(null),
messages,
isThinking: ref(false),
loadConversationState: vi.fn(),
loadConversationState,
createNewChatView,
clearPendingNoticeBatchRetry,
onConversationIdChanging: vi.fn(),
@@ -163,4 +165,32 @@ describe('useChatPageConversation', () => {
expect(secondKey).toBeTruthy();
expect(secondKey).not.toBe(firstKey);
});
it('loadConversation keeps attachment-only history snapshots intact', async () => {
const { api, loadConversationState } = createConversationContext();
listChatMessages.mockResolvedValue([{
role: 'user',
content: '',
attachments: [{
id: 'attachment-only-1',
name: 'notice.eml',
type: 'document',
source: 'shipping_notice',
}],
}]);
await api.loadConversation('conv-attachment-only', { force: true });
expect(listChatMessages).toHaveBeenCalledWith('conv-attachment-only', 42);
expect(loadConversationState).toHaveBeenCalledWith('conv-attachment-only', [{
role: 'user',
content: '',
attachments: [{
id: 'attachment-only-1',
name: 'notice.eml',
type: 'document',
source: 'shipping_notice',
}],
}]);
});
});