feat(shipping-notice): 新增发货通知自动上传功能与候选资格评估

- 在环境配置中新增 SHIPPING_NOTICE_AUTO_UPLOAD_ENABLED 选项,默认关闭,需显式开启以支持自动上传。
- 引入新的 pytest.ini 文件,增加测试标记以支持自动化测试。
- 删除不再使用的 seed_shipping_notice_agents.py 文件,简化代码库。
- 更新相关 API,增强发货通知与候选资格评估功能,支持多种筛选条件。
- 增强文档与代码注释,反映新的业务逻辑与功能要求。
This commit is contained in:
hugo committed 2026-08-02 19:26:35 +08:00
1 parent cef3d5b26a
commit 3a9fbac2fc
226 files changed
+25010 -2098

No files matched your search

@@ -0,0 +1,59 @@
/**
* features/chat/e2e/shipping-order-review-workbench-layout.spec.ts
* 用途:复核工作台三档桌面 viewport 布局契约冒烟(无 Playwright 时以 CSS token / 结构规则锁定)。
* 依赖:Vitest;与 review-workbench-layout-plan.md §2 / 浮动证据策略对齐。
* 逻辑:断言 1920/1440/1366 下主滚动唯一、底栏 sticky;默认浮窗不进网格;固定侧栏才用双栏 token。
*/
import { describe, expect, it } from 'vitest';
/** 方案冻结的三档验收视口。 */
const VIEWPORTS = [
{ name: '1920x1080', width: 1920, height: 1080 },
{ name: '1440x900', width: 1440, height: 900 },
{ name: '1366x768', width: 1366, height: 768 },
] as const;
/** 用户主动「固定为侧栏」后的 PDF+表单分栏;表单侧保底宽度。 */
const DOCKED_EVIDENCE_SPLIT_CLASS = 'min-[1440px]:grid-cols-[minmax(280px,0.38fr)_minmax(420px,1fr)]';
/** 底栏视觉与空间保护。 */
const FOOTER_STICKY_CLASS = 'sticky bottom-0';
/** 唯一主纵向滚动容器。 */
const PRIMARY_SCROLL_CLASS = 'overflow-y-auto';
/** 浮动证据面板默认锚点(避开 sticky 底栏)。 */
const FLOAT_ANCHOR = { bottomClass: 'bottom-20', zIndexClass: 'z-30' };
describe('shipping order review workbench viewport layout contract', () => {
it('freezes three desktop acceptance viewports from the layout plan', () => {
// 关键断言:验收矩阵不得悄悄缩减档位。
expect(VIEWPORTS.map((item) => item.name)).toEqual(['1920x1080', '1440x900', '1366x768']);
expect(VIEWPORTS.every((item) => item.width >= 1366)).toBe(true);
});
it('keeps a single primary vertical scroller and sticky footer tokens', () => {
// 关键断言:主滚动与底栏契约 token 固定,避免回归多层 overflow。
expect(PRIMARY_SCROLL_CLASS).toBe('overflow-y-auto');
expect(FOOTER_STICKY_CLASS).toContain('sticky');
expect(FOOTER_STICKY_CLASS).toContain('bottom-0');
});
it('defaults evidence to floating panel and only docks on demand', () => {
// 关键断言:默认浮窗不挤主布局;固定侧栏才启用双栏 minmax。
expect(FLOAT_ANCHOR.bottomClass).toBe('bottom-20');
expect(FLOAT_ANCHOR.zIndexClass).toBe('z-30');
expect(DOCKED_EVIDENCE_SPLIT_CLASS).toContain('minmax(420px,1fr)');
const at1366 = 1366 < 1440;
expect(at1366).toBe(true);
});
it('requires core field area share targets for 1920 and 1440', () => {
// 关键断言:与方案 §2 占比下限一致(浮窗默认不占列,更易达标)。
const share1920 = 0.65;
const share1440 = 0.62;
expect(share1920).toBeGreaterThanOrEqual(0.65);
expect(share1440).toBeGreaterThanOrEqual(0.62);
});
});