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

@@ -170,12 +170,15 @@ def test_workspace_customer_search_and_confirmation_api(app, client):
db.session.commit()
task_no = task.task_no
customer_id = customer.id
short_code = customer.short_code
username = user.username
headers = {'X-Username': username, 'X-Role': 'user', 'Content-Type': 'application/json'}
options_response = client.get('/api/workspace/shipping-customers?q=GAA', headers=headers)
options_response = client.get(f'/api/workspace/shipping-customers?q={short_code}', headers=headers)
assert options_response.status_code == 200
assert options_response.get_json()[0]['short_code'] == 'GAA'
options_payload = options_response.get_json()
assert options_payload['success'] is True
assert options_payload['data'][0]['short_code'] == short_code
confirm_response = client.post(
f'/api/workspace/shipping-tasks/{task_no}/confirm-customer',
@@ -183,10 +186,12 @@ def test_workspace_customer_search_and_confirmation_api(app, client):
headers=headers,
)
assert confirm_response.status_code == 200
payload = confirm_response.get_json()
envelope = confirm_response.get_json()
assert envelope['success'] is True
payload = envelope['data']
assert payload['customer_resolution_status'] == 'confirmed'
assert payload['customer_id'] == customer_id
assert payload['business_no'].startswith('GAA')
assert payload['business_no'].startswith(short_code)
other_headers = {'X-Username': 'gate-other-user', 'X-Role': 'user', 'Content-Type': 'application/json'}
forbidden_response = client.post(