refactor(shipping-notice): 统一料号字段,移除过时的 SKU 相关字段,更新相关逻辑以支持新字段命名
This commit is contained in:
1 parent
dde25344ca
commit
46eb63f5bb
111 files changed
+3116
-1250
No files matched your search
@@ -7,8 +7,8 @@ from app.services.shipping_notice.reservation_id import (
|
||||
|
||||
|
||||
def test_match_numeric_reservation_id():
|
||||
notice = [{"sku": "10-40594-001", "reservation_id": "1000140351", "qty": 2}]
|
||||
inventory = [{"sku": "10-40594-001", "reservation_id": 1000140351.0, "available_qty": 3}]
|
||||
notice = [{"part_number": "D4-A08AR12000002", "reservation_id": "1000140351", "qty": 2}]
|
||||
inventory = [{"part_number": "D4-A08AR12000002", "reservation_id": 1000140351.0, "available_qty": 3}]
|
||||
status, results, _ = match_notice_lines(notice, inventory)
|
||||
assert status == "fulfillable"
|
||||
assert results[0]["reservation_id"] == "1000140351"
|
||||
@@ -27,3 +27,11 @@ def test_reservation_contract_rejects_internal_hex_but_keeps_business_ids():
|
||||
assert is_valid_reservation_id("AWS-311")
|
||||
assert is_valid_reservation_id("R-1")
|
||||
assert not is_valid_reservation_id("AWS-311", numeric_only=True)
|
||||
|
||||
|
||||
def test_reservation_gate_blocks_empty_and_malformed_order_lines():
|
||||
"""空订单或畸形行都不能被视为 Reservation 门禁通过。"""
|
||||
from app.services.shipping_notice.reservation_gate import reservation_gate_issues
|
||||
|
||||
assert reservation_gate_issues([])[0]["reason"] == "missing_order_lines"
|
||||
assert reservation_gate_issues(["invalid-line"])[0]["reason"] == "invalid_order_line"
|
||||
Reference in new issue
Block a user