feat(server): 归因v2——paid_social渠道与fb+付费medium优先规则

Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
浅念
2026-09-18 22:41:58 +08:00
parent be0b53bce4
commit 52a8a72e3a
4 changed files with 66 additions and 10 deletions
+1 -1
View File
@@ -408,7 +408,7 @@ def test_detail_attribution_block(client, member_user):
ft = attr["first_touch"]
assert ft["channel"] == "natural_search" and ft["platform"] == "Bing"
assert ft["search_term"] == "挖掘机" and ft["resolution"] == "resolved"
assert ft["evidence_kind"] == "observed_referrer" and ft["rule_version"] == "v1"
assert ft["evidence_kind"] == "observed_referrer" and ft["rule_version"] == "v2"
assert ft["computed_at"] and ft["detail"] == {}
assert [e["session_id"] for e in attr["session_entries"]] == ["s2", "s1"] # 最近在前
assert attr["session_entries"][0]["channel"] == "ai_referral"