from enum import IntEnum

from ldnode.calculator.schemas import (
    CBBacktestParameters as CBBacktestModel,
)
from ldnode.calculator.schemas import (
    ETFBacktestParameters as ETFBacktestModel,
)
from ldnode.calculator.schemas import (
    STKBacktestParameters as STKBacktestModel,
)

from .common import TaskBaseParameters


class BacktestType(IntEnum):
    """回测类型"""

    VECTOR = 1  # 向量回测
    EVENT = 2  # 事件驱动回测


class CBBacktestStrategyConfig(CBBacktestModel):
    """回测策略配置"""

    backtest_type: BacktestType  # 回测类型


class STKBacktestStrategyConfig(STKBacktestModel):
    """股票回测策略配置"""

    backtest_type: BacktestType  # 回测类型


class ETFBacktestStrategyConfig(ETFBacktestModel):
    """基金回测策略配置"""

    backtest_type: BacktestType  # 回测类型


class CBBacktestParameters(TaskBaseParameters):
    """转债回测参数"""

    strategy_config: CBBacktestStrategyConfig


class STKBacktestParameters(TaskBaseParameters):
    """股票回测参数"""

    strategy_config: STKBacktestStrategyConfig


class ETFBacktestParameters(TaskBaseParameters):
    """基金回测参数"""

    strategy_config: ETFBacktestStrategyConfig


class CBEvalutionParameters(CBBacktestParameters):
    """转债评价参数"""

    test_begin_date: str


class STKEvalutionParameters(STKBacktestParameters):
    """股票评价参数"""

    test_begin_date: str


class ETFEvalutionParameters(ETFBacktestParameters):
    """基金评价参数"""

    test_begin_date: str
