feat(shipping-notice): 增强发货通知与审计功能,支持敏感数据控制与哈希链校验

- 更新发货通知工具 API,剥离不可信的操作人身份字段,确保审计安全
- 引入审计事件的哈希链校验机制,支持数据完整性验证
- 增强订单抽取与审计功能,支持敏感快照的访问控制
- 更新相关模型与服务,确保新功能的完整性与可追溯性
- 完善文档与代码注释,反映新的业务逻辑与审计要求
This commit is contained in:
hugo committed 2026-07-31 08:59:44 +08:00
1 parent 95cdfe66b0
commit d0fe084999
225 files changed
+25923 -6653

No files matched your search

+20
View File
@@ -1,3 +1,12 @@
"""
tests/conftest.py
用途:Flask testing app、库存配置种子与测试隔离夹具。
依赖:pytest、app.create_app、shipping inventory 模型。
逻辑:各测试用例共享;Windows 下将 basetemp 固定到 backend/.pytest_tmp,
配合 pytest.ini 的 retention=0,避免 %TEMP%/pytest-current 清理 PermissionError。
"""
import pytest
from pathlib import Path
@@ -371,6 +380,12 @@ def rpa_callback_payload(
def pytest_configure(config):
"""
注册自定义 markers,并把临时目录固定到仓库内可写路径。
核心逻辑:未显式传 --basetemp 时使用 backend/.pytest_tmp/run,避免系统 TEMP
中 pytest-current 符号链接在 atexit 清理时触发 WinError 5,导致 exit code≠0。
"""
config.addinivalue_line(
"markers",
"auto_rpa: 发货通知测试启用 auto_progress + RPA 自动链",
@@ -379,6 +394,11 @@ def pytest_configure(config):
"markers",
"inventory_source_gate: 库存源门禁专项测试,跳过默认 Dublin 注入",
)
# [STEP] Windows 质量门禁:basetemp 落仓内 + retention=0(见 pytest.ini)。
if not getattr(config.option, 'basetemp', None):
basetemp = Path(__file__).resolve().parents[1] / '.pytest_tmp' / 'run'
basetemp.mkdir(parents=True, exist_ok=True)
config.option.basetemp = str(basetemp)
@pytest.fixture