"""BarRecord — a canonical daily bar (close/high/low) keyed by epoch-second ts, written to the
warehouse as point-in-time feature rows. open/volume are omitted: neither bronze source supplies a
real open, and nothing consumes volume in this increment."""
from __future__ import annotations

from dataclasses import dataclass


@dataclass(frozen=True)
class BarRecord:
    symbol: str
    ts: int                    # epoch seconds, 00:00:00 UTC of the bar day
    close: float
    high: float
    low: float

    def as_feature_row(self) -> tuple[int, dict[str, float]]:
        return (self.ts, {"close": self.close, "high": self.high, "low": self.low})
