feat(shipping-notice): 完善 XFA 模板映射与订单审核流程

- 统一 XFA 数据集、字段拆分、校验及运行时解析
- 完善订单模板管理、发布检查与迁移状态
- 优化订单审核草稿、预约回退及 STP 投影缓存
- 更新前端模板编辑器、映射组件与多语言错误文案
- 补充后端与前端测试,并更新本地集成启动配置
This commit is contained in:
hugo committed 2026-09-12 22:41:21 +08:00
1 parent 43a30a7489
commit 4ec436d44c
67 files changed
+5411 -528

No files matched your search

@@ -80,6 +80,34 @@ def test_tree_nodes_have_path_id_and_no_raw_paths_in_serialized_dto():
assert payload['data_path_hash'].startswith('sha256:')
assert 'data_path' not in payload
assert '4510039227' not in json.dumps(payload)
assert 'raw_value' not in json.dumps(payload)
def test_tree_nodes_can_reveal_full_sample_display_without_raw_value_key():
"""断言意图:reveal 路径可把完整样本写入 display,但仍禁止 raw_value 键。"""
analysis = parse_xfa_datasets(load_datasets_fixture())
root = analysis.nodes[0]
payload = serialize_tree_node(root, include_values=True, include_full_values=True)
dumped = json.dumps(payload)
assert 'raw_value' not in dumped
assert '4510039227' in dumped
assert 'data_path' not in payload
def find_leaf(node: dict):
if node.get('is_leaf'):
return node
for child in node.get('children') or []:
found = find_leaf(child)
if found:
return found
return None
leaf = find_leaf(payload)
assert leaf is not None
assert leaf.get('full_value_revealed') is True
assert leaf.get('display_policy') == 'full'
assert '•' not in str(leaf.get('sample_value_display') or '')
assert '…' not in str(leaf.get('sample_value_display') or '')
def test_mask_value_for_dto():