src.offers.offers_repository_port

 1from abc import ABC, abstractmethod
 2
 3from src.offers.models import Offer
 4
 5
 6class OffersRepositoryPort(ABC):
 7    """Port: repository interface for persisting and retrieving offers."""
 8
 9    @abstractmethod
10    def store(self, offer: Offer) -> None:
11        """Persist an offer.
12
13        Args:
14            offer: The offer to store.
15        """
16        ...
17
18    @abstractmethod
19    def get(self, offer_id: str) -> Offer:
20        """Retrieve an offer by its identifier.
21
22        Args:
23            offer_id: The unique offer identifier.
24
25        Returns:
26            The matching Offer.
27
28        Raises:
29            OfferNotFound: When no offer with the given id exists.
30        """
31        ...
class OffersRepositoryPort(abc.ABC):
 7class OffersRepositoryPort(ABC):
 8    """Port: repository interface for persisting and retrieving offers."""
 9
10    @abstractmethod
11    def store(self, offer: Offer) -> None:
12        """Persist an offer.
13
14        Args:
15            offer: The offer to store.
16        """
17        ...
18
19    @abstractmethod
20    def get(self, offer_id: str) -> Offer:
21        """Retrieve an offer by its identifier.
22
23        Args:
24            offer_id: The unique offer identifier.
25
26        Returns:
27            The matching Offer.
28
29        Raises:
30            OfferNotFound: When no offer with the given id exists.
31        """
32        ...

Port: repository interface for persisting and retrieving offers.

@abstractmethod
def store(self, offer: src.offers.models.Offer) -> None:
10    @abstractmethod
11    def store(self, offer: Offer) -> None:
12        """Persist an offer.
13
14        Args:
15            offer: The offer to store.
16        """
17        ...

Persist an offer.

Args: offer: The offer to store.

@abstractmethod
def get(self, offer_id: str) -> src.offers.models.Offer:
19    @abstractmethod
20    def get(self, offer_id: str) -> Offer:
21        """Retrieve an offer by its identifier.
22
23        Args:
24            offer_id: The unique offer identifier.
25
26        Returns:
27            The matching Offer.
28
29        Raises:
30            OfferNotFound: When no offer with the given id exists.
31        """
32        ...

Retrieve an offer by its identifier.

Args: offer_id: The unique offer identifier.

Returns: The matching Offer.

Raises: OfferNotFound: When no offer with the given id exists.