feat(growth): close same-item reconciliation loop
This commit is contained in:
@@ -708,7 +708,8 @@ def search_momo_products_for_pchome_products(
|
||||
product_id = str(row.get("product_id") or row.get("goodsCode") or row.get("id") or "").strip()
|
||||
if not product_id:
|
||||
product_id = f"momo_candidate_{len(candidates_by_id)}"
|
||||
existing = candidates_by_id.get(product_id)
|
||||
candidate_key = f"{pchome_id}:{product_id}"
|
||||
existing = candidates_by_id.get(candidate_key)
|
||||
if existing and float(existing.get("target_match_score") or 0.0) >= score:
|
||||
continue
|
||||
|
||||
@@ -732,7 +733,7 @@ def search_momo_products_for_pchome_products(
|
||||
"target_review_status": review_status,
|
||||
"source_strategy": "pchome_targeted_momo_search",
|
||||
})
|
||||
candidates_by_id[product_id] = row
|
||||
candidates_by_id[candidate_key] = row
|
||||
|
||||
candidates = sorted(
|
||||
candidates_by_id.values(),
|
||||
|
||||
Reference in New Issue
Block a user