feat(campaign): restore operations table signals
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
OoO
2026-05-01 20:43:46 +08:00
parent 4e853a233f
commit bb99dfeab6
4 changed files with 178 additions and 17 deletions

View File

@@ -75,6 +75,27 @@ def test_campaign_v2_uses_latest_warm_hero_without_fake_data():
assert "假商品" not in template
def test_campaign_v2_product_table_keeps_real_operations_columns():
template = (ROOT / "templates/edm_dashboard_v2.html").read_text(encoding="utf-8")
route_source = (ROOT / "routes/edm_routes.py").read_text(encoding="utf-8")
assert "分類 / 狀態" in template
assert "銷售 / 庫存" in template
assert "追蹤資訊" in template
assert "data-campaign-copy=\"{{ item.i_code }}\"" in template
assert "copyCampaignProductId" in template
assert "campaign-change-pct" in template
assert "item.total_sold" in template
assert "item.days_on_shelf" in template
assert "item.qty_history" in template
assert "當日銷售歷程" in template
assert "item.crawled_at.strftime('%m/%d %H:%M')" in template
assert "data-bs-toggle=\"tooltip\"" in template
assert "item.total_sold = total_sold_map.get(item.i_code, 0)" in route_source
assert "item.days_on_shelf = days_on_shelf_map.get(item.i_code, 1)" in route_source
assert "item.qty_history = history_map.get((item.i_code, item.time_slot), [])" in route_source
def test_dashboard_v2_is_production_default_and_uses_real_dashboard_data():
route_source = (ROOT / "routes/dashboard_routes.py").read_text(encoding="utf-8")
dashboard = (ROOT / "templates/dashboard_v2.html").read_text(encoding="utf-8")