fix: align pchome growth comparison and promo watch
All checks were successful
CD Pipeline / deploy (push) Successful in 1m9s

This commit is contained in:
ogt
2026-06-26 11:49:07 +08:00
parent 2144ef2102
commit 2888bac597
12 changed files with 508 additions and 35 deletions

View File

@@ -597,6 +597,11 @@ def test_price_comparison_page_is_action_oriented_and_plain_chinese():
assert "renderMomoReviewPanel" in template
assert "/api/price_comparison/fetch_momo_for_pchome" in template
assert "MOMO 候選待確認" in template
assert "待確認 ${momoReviewCandidates.length} 筆:先並排看兩家賣場" in template
assert "price-review-compare" in template
assert "price-review-store is-pchome" in template
assert "price-review-store is-momo" in template
assert "同時開兩家賣場" in template
assert "確認 MOMO 單品/組合候選" in template
assert "比價結果判讀" in template
assert "需檢查價格" in template

View File

@@ -492,14 +492,16 @@ def test_ai_intelligence_template_uses_pchome_growth_name_and_endpoint():
assert "MOMO 待確認候選" in template
assert "確認同款" in template
assert "不是同款" in template
assert "雙開賣場" in template
assert "同時開兩家賣場" in template
assert "並排看兩家賣場" in template
assert "review-candidate-flow" in template
assert "review-candidate-store is-pchome" in template
assert "review-candidate-store is-momo" in template
assert "openReviewCandidateStores" in template
assert "data-pchome-url" in template
assert "data-momo-url" in template
assert "PChome 賣場" in template
assert "MOMO 賣場" in template
assert "開 PChome" in template
assert "開 MOMO" in template
assert "row.match_reason_labels" in template
assert "row.match_reasons" not in template
assert "variant_selection_review" not in template
@@ -914,6 +916,7 @@ def test_visible_operations_pages_hide_internal_runtime_terms():
"templates/admin/agent_orchestration.html": ["AI 分工指揮台", "建議路徑、工具與知識命中矩陣", "工具協作明細", "工具協作 × 使用情境"],
"templates/admin/ai_calls_dashboard.html": ["用量", "最近作戰素材", "情境 × 知識命中矩陣"],
"templates/admin/observability_overview.html": ["用量", "知識與工具矩陣"],
"templates/admin/business_intel.html": ["外部促銷活動監控", "PChome 解法", "AI Agent 會持續觀察", "PChome 業績提升解法矩陣", "守價", "組合", "曝光", "會員"],
"templates/cicd_dashboard.html": ["最新更新流程", "更新歷史", "修復服務", "查看更新紀錄"],
"templates/admin/budget.html": ["Top 5 成本使用情境", "尚未建立預算線"],
"templates/ai_automation_smoke.html": ["下載檢查紀錄", "健康檢查服務"],
@@ -942,6 +945,7 @@ def test_visible_operations_pages_hide_internal_runtime_terms():
],
"templates/admin/ai_calls_dashboard.html": ["權杖量", "權杖/次", ">權杖<", "Agent 上下文", "RAG × MCP"],
"templates/admin/observability_overview.html": ["權杖量", "RAG × MCP"],
"templates/admin/business_intel.html": ["candidate queue", "資料表"],
"templates/cicd_dashboard.html": ["Pipeline Flow", "Pipeline History", "完整修復", "一鍵修復", "重啟 Registry", "舊叢集"],
"templates/admin/budget.html": ["燒錢呼叫端", "migrations/025", "<code>{{ c.caller }}</code>"],
"templates/ai_automation_smoke.html": ["JSONL", "健康檢查 API", "JSON.stringify(item.details"],

View File

@@ -141,8 +141,14 @@ def test_fetch_momo_for_pchome_endpoint_splits_auto_and_review_candidates(monkey
"name": "組合需確認商品",
"price": 468,
"product_id": "REVIEW-1",
"product_url": "https://www.momoshop.com.tw/goods/GoodsDetail.jsp?i_code=REVIEW-1",
"can_auto_compare": False,
"target_review_status": "需人工確認",
"target_pchome_product_id": "PCH-1",
"target_pchome_name": "PChome B5 修復霜",
"target_pchome_price": 920,
"target_match_score": 0.97,
"target_match_reasons": ["variant_selection_review"],
},
]
@@ -171,7 +177,14 @@ def test_fetch_momo_for_pchome_endpoint_splits_auto_and_review_candidates(monkey
assert payload["data"]["candidate_count"] == 3
assert payload["data"]["products"][0]["product_id"] == "AUTO-1"
assert payload["data"]["unit_compare_candidates"][0]["product_id"] == "UNIT-1"
assert payload["data"]["review_candidates"][0]["product_id"] == "REVIEW-1"
review_candidate = payload["data"]["review_candidates"][0]
assert review_candidate["product_id"] == "REVIEW-1"
assert review_candidate["target_pchome_product_id"] == "PCH-1"
assert review_candidate["target_pchome_name"] == "PChome B5 修復霜"
assert review_candidate["target_pchome_price"] == 920
assert review_candidate["target_pchome_url"] == "https://24h.pchome.com.tw/prod/PCH-1"
assert review_candidate["target_match_reason_labels"] == ["可信度 97%", "需確認色號"]
assert "target_match_reasons" not in review_candidate
assert payload["data"]["external_offer_sync"]["status"] == "not_requested"