"""
=========================================
CV6 AI Trading OS
Decision Validator
=========================================
"""

from app.decision.decision_models import DecisionRequest


class DecisionValidator:

    @staticmethod
    def validate(request: DecisionRequest):

        if request.confidence < 0:
            raise ValueError(
                "Confidence cannot be negative."
            )

        if request.confidence > 100:
            raise ValueError(
                "Confidence cannot exceed 100."
            )

        if request.strategy.upper() not in [
            "BUY",
            "SELL",
            "HOLD"
        ]:
            raise ValueError(
                "Strategy must be BUY, SELL or HOLD."
            )

        return True