feat(shipping-notice): 增强发货通知与审计功能,支持敏感数据控制与哈希链校验
- 更新发货通知工具 API,剥离不可信的操作人身份字段,确保审计安全 - 引入审计事件的哈希链校验机制,支持数据完整性验证 - 增强订单抽取与审计功能,支持敏感快照的访问控制 - 更新相关模型与服务,确保新功能的完整性与可追溯性 - 完善文档与代码注释,反映新的业务逻辑与审计要求
This commit is contained in:
1 parent
95cdfe66b0
commit
d0fe084999
225 files changed
+25923
-6653
No files matched your search
@@ -38,6 +38,24 @@ def test_claim_next_returns_none_when_empty(app):
|
||||
assert store.claim_next(queues=['kb']) is None
|
||||
|
||||
|
||||
def test_claim_next_shipping_recovers_stale_layout_jobs(app, monkeypatch):
|
||||
"""Shipping worker 认领前必须回收卡住的版面解析任务。"""
|
||||
from app.jobs import store
|
||||
from app.services.shipping_notice import queue_service
|
||||
|
||||
recovered = []
|
||||
monkeypatch.setattr(
|
||||
queue_service,
|
||||
'recover_stale_shipping_notice_jobs',
|
||||
lambda: recovered.append(True) or (0, ''),
|
||||
)
|
||||
|
||||
with app.app_context():
|
||||
assert store.claim_next(queues=['shipping']) is None
|
||||
|
||||
assert recovered == [True]
|
||||
|
||||
|
||||
def test_find_shipping_notice_job_id_matches_task_no(app):
|
||||
from app import db
|
||||
from app.jobs.queue import _find_shipping_notice_job_id
|
||||
|
||||
Reference in new issue
Block a user