"""ComparisonResultIn 保留逐平台 skipped_dish_count(落库/回读用)。

记录页三平台网格要按逐平台缺菜数标"缺少 X 个菜品"; pricebot 现把 skipped_dish_count 冗余进
comparison_results 行。上报边界必须显式声明该字段, 否则 model_dump() 会静默丢弃(POST 路径),
记录页拿不到。纯 schema, 不碰 DB。
"""
from app.schemas.compare_record import ComparisonResultIn


def test_comparison_result_in_preserves_skipped_dish_count():
    r = ComparisonResultIn(platform_id="jd_waimai", price=25.0, skipped_dish_count=2)
    assert r.model_dump().get("skipped_dish_count") == 2


def test_comparison_result_in_skipped_defaults_none():
    r = ComparisonResultIn(platform_id="meituan", price=42.0, is_source=True)
    assert r.model_dump().get("skipped_dish_count") is None
