- 库存抵扣成本按目标抵扣量幂等更新,作废/退货清 cover_qty;多批次展示按加权均价;商品成本排行纳入库存抵扣成本并改标签为“成本” - 主系统事件:allocated 定向 order_code、returned 等批量状态核对、clamped/全量兜底下调频、失败不计 applied - 订单完成:零价闸门排除已退货行;供应商系统关闭“主数据不卡流程”入口与执行接口 - 迁移 20261080/20261081;补充相关契约/回归测试
43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
import { readFileSync } from 'node:fs';
|
|
import { describe, expect, it } from 'vitest';
|
|
|
|
/**
|
|
* 供应商系统不需要「主数据不卡流程」:
|
|
* · 订单列表不再提供设置按钮;
|
|
* · 后端总闸默认关闭,调度不执行;
|
|
* · 配置/手动接口返回 410,避免通过旧前端/直接调 API 执行。
|
|
*/
|
|
const web = readFileSync(
|
|
new URL('../../src/pages/orders/orderManagement/OrderManagementPage.tsx', import.meta.url),
|
|
'utf8'
|
|
);
|
|
const config = readFileSync(
|
|
new URL('../src/services/orderAutoAdvanceConfigService.ts', import.meta.url),
|
|
'utf8'
|
|
);
|
|
const scheduler = readFileSync(
|
|
new URL('../src/services/scheduledJobs.ts', import.meta.url),
|
|
'utf8'
|
|
);
|
|
const routes = readFileSync(
|
|
new URL('../src/modules/workflow/routes/deliveryRoutes.ts', import.meta.url),
|
|
'utf8'
|
|
);
|
|
|
|
describe('主数据不卡流程:供应商系统关闭', () => {
|
|
it('订单列表不再渲染「主数据不卡流程」设置按钮', () => {
|
|
expect(web).not.toContain("onClick={() => void openAutoAdvanceConfig()}");
|
|
expect(web).toContain('供应商系统不使用「主数据不卡流程」定时强推');
|
|
});
|
|
|
|
it('总闸关闭且调度直接返回', () => {
|
|
expect(config).toContain('ORDER_AUTO_ADVANCE_ENABLED = false');
|
|
expect(scheduler).toContain('if (!ORDER_AUTO_ADVANCE_ENABLED) return;');
|
|
});
|
|
|
|
it('配置/手动接口返回 410,无法执行', () => {
|
|
expect(routes).toContain('order_auto_advance_disabled');
|
|
expect((routes.match(/status\(410\)/g) || []).length).toBeGreaterThanOrEqual(3);
|
|
});
|
|
});
|