feat(shipping-notice): 新增临时库存管理功能,支持创建会话、获取分析结果及字段映射建议
This commit is contained in:
1 parent
46eb63f5bb
commit
e9bdd81f1a
320 files changed
+28361
-10487
No files matched your search
@@ -7,11 +7,17 @@ from app.services.shipping_notice.reservation_id import (
|
||||
|
||||
|
||||
def test_match_numeric_reservation_id():
|
||||
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)
|
||||
notice = [{"order-part": "D4-A08AR12000002", "order-reservation": "1000140351", "__required_qty": 2}]
|
||||
inventory = [{"101": "D4-A08AR12000002", "102": "1000140351", "103": 3}]
|
||||
status, results, _ = match_notice_lines(
|
||||
notice, inventory,
|
||||
match_keys=[
|
||||
{'order_field_id': 'order-part', 'inventory_field_id': '101'},
|
||||
{'order_field_id': 'order-reservation', 'inventory_field_id': '102'},
|
||||
],
|
||||
quantity_field_id='103',
|
||||
)
|
||||
assert status == "fulfillable"
|
||||
assert results[0]["reservation_id"] == "1000140351"
|
||||
assert results[0]["available_qty"] == 3
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user