feat(shipping-notice): 增强订单抽取与审计功能,支持取消与保留策略
- 在环境配置中新增进度细化、订单提取取消与审计导出相关的开关 - 实现订单抽取运行的取消功能,允许管理员在运行中进行操作 - 引入审计事件的保留策略,支持三年保留期的自动清理 - 更新相关模型与服务,确保新功能的完整性与可追溯性 - 增强文档与代码注释,反映新的业务逻辑与审计要求
This commit is contained in:
1 parent
c85997884b
commit
95cdfe66b0
158 files changed
+19005
-1201
No files matched your search
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* features/chat/e2e/shipping-order-extraction-progress.spec.ts
|
||||
* 用途:阶段 5 用户进度卡契约冒烟——取消/刷新仅依赖后端 availableActions,不发明阶段。
|
||||
* 依赖:Vitest、orderExtractionProgressDisplay、ShippingOrderExtractionCard 映射约定。
|
||||
* 逻辑:模拟后端关闭取消开关后的投影;断言前端展示入口只读服务端动作列表。
|
||||
*/
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import {
|
||||
formatOrderExtractionElapsed,
|
||||
resolveOrderExtractionUserStageKey,
|
||||
} from '@/features/chat/shipping/orderExtractionProgressDisplay';
|
||||
|
||||
describe('shipping order extraction progress e2e contract', () => {
|
||||
it('never invents ETA and maps only backend user_visible_stage', () => {
|
||||
// 关键断言:无百分比/ETA;阶段文案 key 完全由后端阶段码驱动。
|
||||
expect(formatOrderExtractionElapsed(null)).toBe('');
|
||||
expect(resolveOrderExtractionUserStageKey('cancellation_requested', 'extracting')).toBe(
|
||||
'chat.shippingOrderExtractionUserStage.cancellation_requested',
|
||||
);
|
||||
});
|
||||
|
||||
it('hides cancel when availableActions omit cancel_run (feature flag rollback)', () => {
|
||||
const availableActions = ['view_details', 'refresh_status'] as const;
|
||||
const showCancel = availableActions.includes('cancel_run');
|
||||
const showRefresh = availableActions.includes('refresh_status');
|
||||
// 关键断言:灰度关闭取消后前端不得本地补按钮。
|
||||
expect(showCancel).toBe(false);
|
||||
expect(showRefresh).toBe(true);
|
||||
});
|
||||
|
||||
it('treats review_required as business review, not technical failure', () => {
|
||||
const stageKey = resolveOrderExtractionUserStageKey('review_required', 'failed');
|
||||
expect(stageKey).toBe('chat.shippingOrderExtractionUserStage.review_required');
|
||||
expect(stageKey.includes('failed')).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user