from typing import List
from abc import ABC, abstractmethod

from sator_core.models.product import Product
from sator_core.models.vulnerability.metadata import VulnerabilityMetadata
from sator_core.models.vulnerability.references import VulnerabilityReferences
from sator_core.models.vulnerability.description import VulnerabilityDescription


class VulnerabilityRepositoryPort(ABC):
    @abstractmethod
    def get_metadata(self, vulnerability_id: str) -> VulnerabilityMetadata | None:
        raise NotImplementedError

    @abstractmethod
    def get_description(self, vulnerability_id: str) -> VulnerabilityDescription | None:
        raise NotImplementedError

    @abstractmethod
    def get_affected_products(self, vulnerability_id: str) -> List[Product]:
        """
            Method for getting affected products by a vulnerability.
        """
        raise NotImplementedError

    @abstractmethod
    def get_references(self, vulnerability_id: str) -> VulnerabilityReferences | None:
        """
            Method for getting references for a vulnerability.
        """
        raise NotImplementedError
