feat(shipping-notice): 实现滚动履约功能,优化发货通知流程与代码清理
清理废弃的ShippingCase相关代码与依赖,统一使用ShippingNotice直接关联客户数据。调整库存网关依赖规则,支持仅对库存满足或已人工放行的订单行生成发货Excel,实现滚动履约逻辑。
This commit is contained in:
1 parent
7cfd5d167e
commit
1e5aedb9ed
235 files changed
+11394
-9613
No files matched your search
@@ -14,7 +14,7 @@ import pytest
|
||||
from app import db
|
||||
from app.models import (
|
||||
ChatLog, ShippingCustomer, ShippingInventoryField, ShippingInventoryRoutingRule,
|
||||
ShippingCase, ShippingInventoryFile, ShippingInventoryRoutingRuleCondition, ShippingNotice,
|
||||
ShippingInventoryFile, ShippingInventoryRoutingRuleCondition, ShippingNotice,
|
||||
ShippingOrderExtraction, ShippingOrderField, ShippingOrderFieldDecision, ShippingOrderFieldValue,
|
||||
ShippingOrderLine, ShippingOrderSchema, ShippingOrderSchemaVersion,
|
||||
ShippingOrderSnapshot, ShippingOrderSnapshotLine,
|
||||
@@ -107,34 +107,6 @@ def _attach_dynamic_order(task: ShippingNotice, *, part_number: str, reservation
|
||||
db.session.flush()
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _confirmed_customer_for_legacy_tool_flows(app, monkeypatch):
|
||||
"""为本模块创建的业务单绑定测试客户,使既有用例继续聚焦客户 Gate 之后的流程。"""
|
||||
from app.services.shipping_notice import task_workflow
|
||||
|
||||
original = task_workflow.resolve_shipping_case_for_new_task
|
||||
|
||||
def _resolve_confirmed_case(**kwargs):
|
||||
case = original(**kwargs)
|
||||
if case.customer_id is not None:
|
||||
return case
|
||||
customer = db.session.query(ShippingCustomer).filter_by(short_code="TST").one_or_none()
|
||||
if customer is None:
|
||||
customer = ShippingCustomer(
|
||||
standard_name="Tool 流程测试客户",
|
||||
short_code="TST",
|
||||
status="active",
|
||||
)
|
||||
db.session.add(customer)
|
||||
db.session.flush()
|
||||
case.customer_id = customer.id
|
||||
case.customer_name_snapshot = customer.standard_name
|
||||
case.customer_short_code_snapshot = customer.short_code
|
||||
return case
|
||||
|
||||
monkeypatch.setattr(task_workflow, "resolve_shipping_case_for_new_task", _resolve_confirmed_case)
|
||||
|
||||
|
||||
def test_shipping_notice_tool_auth_accepts_dedicated_key(app, client):
|
||||
with app.app_context():
|
||||
app.config["SHIPPING_NOTICE_TOOL_API_KEY"] = "shipping-secret"
|
||||
|
||||
Reference in new issue
Block a user