"""Shared forward-tracking read-model DTOs. The state_reader produces these; ingest persists them; the
dashboard reads them back. One ForwardSummary per strategy is ALWAYS available; the per-day ForwardNavRow
series is only rich for trackers that record a days-list (others build it forward, one point per ingest)."""
from __future__ import annotations

from dataclasses import dataclass


@dataclass(frozen=True, slots=True)
class ForwardNavRow:
    strategy_id: str
    date: str          # ISO yyyy-mm-dd
    ret: float         # that day's fractional return (0.0 if unknown for snapshot-only trackers)
    nav: float         # cumulative NAV (1.0 base)


@dataclass(frozen=True, slots=True)
class ForwardSummary:
    strategy_id: str
    as_of: str         # last date represented
    days: int          # forward days elapsed
    nav: float
    total_return: float
    sharpe: float
    maxdd: float       # <= 0

    @property
    def total_return_pct(self) -> float:
        return 100.0 * self.total_return


@dataclass(frozen=True, slots=True)
class GateVerdict:
    status: str        # "WAIT" | "GO" | "NO_GO"
    reason: str
