"""BarRecord is a canonical daily bar that serializes to a warehouse feature row."""
from __future__ import annotations

from fxhnt.domain.warehouse.bar import BarRecord


def test_bar_record_as_feature_row() -> None:
    bar = BarRecord(symbol="ES", ts=1_577_836_800, close=100.0, high=101.0, low=99.0)
    ts, feats = bar.as_feature_row()
    assert ts == 1_577_836_800
    assert feats == {"close": 100.0, "high": 101.0, "low": 99.0}
