feat(shipping-notice): 落地 XFA 拆分、版面签名、统一进度与处理域履约

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
hugoandCursor committed 2026-08-06 10:18:37 +08:00
1 parent 3a9fbac2fc
commit d2b3d74def
571 files changed
+78064 -24681

No files matched your search

@@ -12,7 +12,7 @@ import pytest
from app import db
from app.core.errors import ConflictError
from app.models import ShippingBusinessSequence, ShippingCase, ShippingCustomer, ShippingTask, ShippingTaskEvent
from app.models import ShippingBusinessSequence, ShippingCase, ShippingCustomer, ShippingNotice, ShippingTaskEvent
from app.services.shipping_notice.business_numbering_service import (
assign_business_number,
format_business_no,
@@ -32,7 +32,7 @@ def _seed_case(*, short_code: str = "WYC", task_no: str = "SN-NUMBER-001"):
case = ShippingCase(case_no=f"CASE-{task_no}", numbering_status="pending")
db.session.add_all([customer, case])
db.session.flush()
task = ShippingTask(
task = ShippingNotice(
task_no=task_no,
shipping_case_id=case.id,
customer_resolution_status="pending",
@@ -73,7 +73,7 @@ def test_revision_inherits_and_force_case_uses_next_sequence(app):
with app.app_context():
task, case, customer = _seed_case()
confirm_task_customer(task, customer_id=customer.id, actor_id=None)
revision = ShippingTask(
revision = ShippingNotice(
task_no="SN-NUMBER-REV",
shipping_case_id=case.id,
supersedes_task_id=task.id,
@@ -84,7 +84,7 @@ def test_revision_inherits_and_force_case_uses_next_sequence(app):
forced_case = ShippingCase(case_no="CASE-FORCE-NUMBER", numbering_status="pending")
db.session.add_all([revision, forced_case])
db.session.flush()
forced_task = ShippingTask(
forced_task = ShippingNotice(
task_no="SN-NUMBER-FORCED",
shipping_case_id=forced_case.id,
customer_resolution_status="pending",
@@ -139,7 +139,7 @@ def test_numbering_failure_rolls_back_customer_confirmation(app):
db.session.rollback()
db.session.expire_all()
persisted_case = db.session.get(ShippingCase, case.id)
persisted_task = db.session.get(ShippingTask, task.id)
persisted_task = db.session.get(ShippingNotice, task.id)
assert persisted_case.customer_id is None
assert persisted_case.business_no is None
assert persisted_task.customer_resolution_status == "pending"
@@ -150,7 +150,7 @@ def test_business_number_query_returns_latest_revision(app):
with app.app_context():
task, case, customer = _seed_case()
confirm_task_customer(task, customer_id=customer.id, actor_id=None)
revision = ShippingTask(
revision = ShippingNotice(
task_no="SN-NUMBER-QUERY-REV",
shipping_case_id=case.id,
supersedes_task_id=task.id,