from src.presentation.nlp.pipeline.base import PipelineStage, NLPContext
from src.presentation.nlp.validation_adapter import ValidationAdapter


class ValidationStage(PipelineStage):
    def __init__(self, validator: ValidationAdapter):
        super().__init__("validation")
        self.validator = validator

    def execute(self, context: NLPContext) -> NLPContext:
        context.validation = self.validator.validate(context.entities, context.intent)
        return context
