細分 PChome 配對拒絕狀態
All checks were successful
CD Pipeline / deploy (push) Successful in 1m4s

This commit is contained in:
OoO
2026-05-19 23:31:44 +08:00
parent d20615992a
commit 645cd397c2
3 changed files with 51 additions and 14 deletions

View File

@@ -63,3 +63,23 @@ def test_dashboard_match_status_distinguishes_expired_and_legacy_rows():
assert expired["tone"] == "watch"
assert legacy["label"] == "舊版配對待重驗"
assert "identity_v2" in legacy["summary"]
def test_dashboard_match_status_explains_identity_veto_reason():
from routes.dashboard_routes import _build_pchome_match_status
bundle = _build_pchome_match_status({
"attempt_status": "identity_veto",
"best_match_score": 0.32,
"error_message": "score=0.32; reasons=bundle_offer_conflict,product_line_conflict",
})
refill = _build_pchome_match_status({
"attempt_status": "identity_veto",
"best_match_score": 0.32,
"error_message": "score=0.32; reasons=refill_pack_conflict",
})
assert bundle["label"] == "組合差異待審"
assert "組合包/多件組" in bundle["summary"]
assert refill["label"] == "補充包差異待審"
assert "補充瓶/補充包" in refill["summary"]