"""DispatchResult: nove ekonomicke sloupce (cashflow/arbitraz/penalty/bonus)."""
from __future__ import annotations

import unittest
from dataclasses import fields

from services.planning_engine import DispatchResult


class DispatchResultEconomicsFieldsTests(unittest.TestCase):
    def test_has_new_economics_fields(self) -> None:
        names = {f.name for f in fields(DispatchResult)}
        for required in (
            "cashflow_czk",
            "battery_arbitrage_czk",
            "penalty_czk",
            "green_bonus_czk",
        ):
            self.assertIn(required, names, f"DispatchResult missing field {required}")

    def test_legacy_expected_cost_czk_kept(self) -> None:
        names = {f.name for f in fields(DispatchResult)}
        self.assertIn("expected_cost_czk", names)


if __name__ == "__main__":
    unittest.main()
