refactor(shipping-notice): 统一料号字段,移除过时的 SKU 相关字段,更新相关逻辑以支持新字段命名
This commit is contained in:
1 parent
dde25344ca
commit
46eb63f5bb
111 files changed
+3116
-1250
No files matched your search
@@ -28,6 +28,7 @@ from app.services.shipping_notice.inventory_rpa_workflow import (
|
||||
)
|
||||
from app.services.shipping_notice.inventory_workflow import ensure_inventory, parse_inventory, upload_inventory_file
|
||||
from app.services.shipping_notice.progress_workflow import auto_progress
|
||||
from app.services.shipping_notice.task_workflow import retry_task
|
||||
|
||||
|
||||
def _seed_task(*, with_case: bool = True) -> tuple[ShippingTask, ShippingCustomer, User]:
|
||||
@@ -46,7 +47,8 @@ def _seed_task(*, with_case: bool = True) -> tuple[ShippingTask, ShippingCustome
|
||||
task_no=f'SN-GATE-{user.id}', user_id=user.id,
|
||||
shipping_case_id=case.id if case else None,
|
||||
customer_resolution_status='pending' if case else None,
|
||||
process_status='parsed', lines_json=[{'sku': 'A001', 'quantity': 1}],
|
||||
process_status='parsed',
|
||||
lines_json=[{'part_number': 'A001', 'reservation_id': '1000140351', 'quantity': 1}],
|
||||
inventory_source_status='user_confirmed', inventory_source_code='DSV',
|
||||
)
|
||||
db.session.add(task)
|
||||
@@ -92,6 +94,22 @@ def test_pending_customer_blocks_every_downstream_entry(app):
|
||||
assert task.upload_status is None
|
||||
|
||||
|
||||
def test_pending_customer_blocks_retry_before_clearing_review_state(app):
|
||||
"""重试入口必须保留 customer_review,不能先清除人工检查点再异步阻断。"""
|
||||
with app.app_context():
|
||||
task, _customer, _user = _seed_task()
|
||||
task.pending_human_reason = 'customer_unconfirmed'
|
||||
task.error_message = '标准客户尚未确认'
|
||||
db.session.commit()
|
||||
|
||||
result = retry_task({'task_id': task.task_no})
|
||||
|
||||
_assert_customer_gate_response(result)
|
||||
db.session.refresh(task)
|
||||
assert task.pending_human_reason == 'customer_unconfirmed'
|
||||
assert task.error_message == '标准客户尚未确认'
|
||||
|
||||
|
||||
def test_confirm_customer_syncs_revision_chain_and_assigns_number(app):
|
||||
"""客户确认同步同业务单全部任务,并在同事务生成正式业务号。"""
|
||||
with app.app_context():
|
||||
|
||||
Reference in new issue
Block a user