feat(shipping_notice): 新增货代订单全流程业务模块及配套基建
本次提交新增货代订单处理全流程的完整业务能力、数据库迁移与测试用例: 1. 统一追加式审计事件体系,支持全链路不可篡改的业务追溯 2. 货代任务撤销、版本替代管控逻辑,规范已上传订单的合规版本更替 3. 订单抽取路由审计、模板自动冻结资格、路由计数等核心业务基建 4. EML订单补充表解析契约与合并逻辑,完善订单补全能力 5. Chatflow只读能力令牌校验机制,保障工具调用安全 6. 人工复核证据校验服务,规范人工审核的证据留存 所有变更均配套完整的单元测试与迁移契约测试,支持受控回退
This commit is contained in:
1 parent
90f77634d6
commit
1f3ecb87b7
128 files changed
+3635
-2074
No files matched your search
@@ -36,7 +36,6 @@ 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 = [];
|
||||
@@ -45,7 +44,6 @@ const createConversationContext = () => {
|
||||
return {
|
||||
conversationId,
|
||||
messages,
|
||||
loadConversationState,
|
||||
createNewChatView,
|
||||
api: createChatPageConversationApi({
|
||||
deps: { t: (key: string) => key, msg: { warning: vi.fn() } },
|
||||
@@ -56,7 +54,7 @@ const createConversationContext = () => {
|
||||
activeRunId: ref(null),
|
||||
messages,
|
||||
isThinking: ref(false),
|
||||
loadConversationState,
|
||||
loadConversationState: vi.fn(),
|
||||
createNewChatView,
|
||||
clearPendingNoticeBatchRetry,
|
||||
onConversationIdChanging: vi.fn(),
|
||||
@@ -99,6 +97,7 @@ const createUploadContext = (
|
||||
shippingBatchTasks: ref([]),
|
||||
shippingInventorySelectionActive: ref(false),
|
||||
shippingInventorySelectionTaskId: ref(''),
|
||||
shippingInventorySchemaPreviewCache: ref({}),
|
||||
getActiveShippingTaskId: () => '',
|
||||
startChatTurn,
|
||||
refreshShippingActions: vi.fn(async () => undefined),
|
||||
@@ -164,32 +163,4 @@ 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',
|
||||
}],
|
||||
}]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user