refactor(shipping-notice): 统一料号字段,移除过时的 SKU 相关字段,更新相关逻辑以支持新字段命名
This commit is contained in:
1 parent
dde25344ca
commit
46eb63f5bb
111 files changed
+3116
-1250
No files matched your search
@@ -109,7 +109,7 @@ def test_candidate_review_duplicate_api_and_access_guards(app, client):
|
||||
structured_result_json={
|
||||
'business_summary': {
|
||||
'po_number': '7001',
|
||||
'lines': [{'reservation_id': 'R-1', 'sku': 'SKU-1', 'qty': 1}],
|
||||
'lines': [{'reservation_id': 'R-1', 'part_number': 'SKU-1', 'qty': 1}],
|
||||
},
|
||||
},
|
||||
validation_status='needs_review',
|
||||
@@ -131,7 +131,7 @@ def test_candidate_review_duplicate_api_and_access_guards(app, client):
|
||||
'selected': False,
|
||||
'business_summary': {
|
||||
'po_number': '7001',
|
||||
'lines': [{'reservation_id': 'R-1', 'sku': 'SKU-1', 'qty': 2}],
|
||||
'lines': [{'reservation_id': 'R-1', 'part_number': 'SKU-1', 'qty': 2}],
|
||||
},
|
||||
},
|
||||
headers=owner_headers,
|
||||
@@ -186,7 +186,7 @@ def test_candidate_review_duplicate_api_and_access_guards(app, client):
|
||||
|
||||
|
||||
def test_candidate_review_rejects_empty_or_invalid_order_lines(app, client):
|
||||
"""人工修订不得以空摘要或无效 SKU/Qty 绕过 Candidate 审核门禁。"""
|
||||
"""人工修订不得以空摘要或无效 part_number/Qty 绕过 Candidate 审核门禁。"""
|
||||
from app.core.auth.jwt import issue_local_access_token
|
||||
|
||||
with app.app_context():
|
||||
@@ -235,7 +235,7 @@ def test_candidate_review_rejects_empty_or_invalid_order_lines(app, client):
|
||||
intake_id=intake.id,
|
||||
primary_document_id=document.id,
|
||||
candidate_key='test:SNC-CANDIDATE-VALIDATION',
|
||||
structured_result_json={'business_summary': {'lines': [{'sku': 'SKU-1', 'qty': 1}]}},
|
||||
structured_result_json={'business_summary': {'lines': [{'part_number': 'SKU-1', 'qty': 1}]}},
|
||||
validation_status='needs_review',
|
||||
selected=True,
|
||||
)
|
||||
@@ -253,7 +253,7 @@ def test_candidate_review_rejects_empty_or_invalid_order_lines(app, client):
|
||||
|
||||
invalid_qty = client.patch(
|
||||
'/api/workspace/shipping-notice/candidates/SNC-CANDIDATE-VALIDATION',
|
||||
json={'business_summary': {'lines': [{'sku': 'SKU-1', 'qty': 0}]}},
|
||||
json={'business_summary': {'lines': [{'part_number': 'SKU-1', 'qty': 0}]}},
|
||||
headers=headers,
|
||||
)
|
||||
assert invalid_qty.status_code == 400
|
||||
@@ -264,7 +264,7 @@ def test_candidate_review_rejects_empty_or_invalid_order_lines(app, client):
|
||||
'business_summary': {
|
||||
'lines': [
|
||||
{
|
||||
'sku': 'SKU-1',
|
||||
'part_number': 'SKU-1',
|
||||
'qty': 1,
|
||||
'reservation_id': '1f1a682dfdc446a393415dee93eb36ce',
|
||||
}
|
||||
@@ -336,7 +336,7 @@ def test_candidate_batch_gate_rejects_incomplete_expired_and_selection_drift(app
|
||||
)
|
||||
db.session.add(document)
|
||||
db.session.flush()
|
||||
summary = {'po_number': f'PO-{index}', 'lines': [{'sku': f'SKU-{index}', 'qty': index}]}
|
||||
summary = {'po_number': f'PO-{index}', 'lines': [{'part_number': f'SKU-{index}', 'qty': index}]}
|
||||
candidate = ShippingNoticeCandidate(
|
||||
candidate_no=f'SNC-CANDIDATE-GATE-{index}',
|
||||
intake_id=intake.id,
|
||||
@@ -520,7 +520,7 @@ def test_one_eml_intake_candidates_create_one_batch_multiple_tasks(app, shipping
|
||||
'lines': [
|
||||
{
|
||||
'reservation_id': f'20004859{index:02d}',
|
||||
'sku': f'SKU-{index}',
|
||||
'part_number': f'SKU-{index}',
|
||||
'qty': index,
|
||||
'uom': 'EA',
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user