from __future__ import annotations

from abc import ABC, abstractmethod

from .types import (
    MarketSnapshot,
    PortfolioStateView,
    StrategyInitContext,
    StrategyIntent,
    StrategyManifest,
    StrategyRiskOpinion,
)


class StrategyPlugin(ABC):
    @abstractmethod
    def manifest(self) -> StrategyManifest:
        raise NotImplementedError

    @abstractmethod
    def initialize(self, ctx: StrategyInitContext) -> None:
        raise NotImplementedError

    @abstractmethod
    def on_market_snapshot(self, snapshot: MarketSnapshot) -> StrategyIntent:
        raise NotImplementedError

    @abstractmethod
    def on_risk_check(
        self,
        intent: StrategyIntent,
        portfolio: PortfolioStateView,
    ) -> StrategyRiskOpinion:
        raise NotImplementedError

    @abstractmethod
    def shutdown(self) -> None:
        raise NotImplementedError
