src.awards.award_service

Service for award operations.

 1"""Service for award operations."""
 2
 3from .awards_client_port import AwardsClientPort
 4from .models import Award
 5
 6
 7class AwardService:
 8    """Service that fetches awards from the awards client."""
 9
10    _client: AwardsClientPort
11
12    def __init__(self, client: AwardsClientPort) -> None:
13        """Initialize the service.
14
15        Args:
16            client: The port implementation for award operations.
17        """
18        self._client = client
19
20    def get(self, award_id: str) -> Award:
21        """Fetch an award by its identifier.
22
23        Args:
24            award_id: The unique award identifier.
25
26        Returns:
27            The matching Award.
28
29        Raises:
30            AwardNotFound: When the award does not exist.
31            AwardForbidden: When access is denied.
32            AwardsClientError: When the service errors.
33        """
34        return self._client.get(award_id)
class AwardService:
 8class AwardService:
 9    """Service that fetches awards from the awards client."""
10
11    _client: AwardsClientPort
12
13    def __init__(self, client: AwardsClientPort) -> None:
14        """Initialize the service.
15
16        Args:
17            client: The port implementation for award operations.
18        """
19        self._client = client
20
21    def get(self, award_id: str) -> Award:
22        """Fetch an award by its identifier.
23
24        Args:
25            award_id: The unique award identifier.
26
27        Returns:
28            The matching Award.
29
30        Raises:
31            AwardNotFound: When the award does not exist.
32            AwardForbidden: When access is denied.
33            AwardsClientError: When the service errors.
34        """
35        return self._client.get(award_id)

Service that fetches awards from the awards client.

AwardService(client: src.awards.awards_client_port.AwardsClientPort)
13    def __init__(self, client: AwardsClientPort) -> None:
14        """Initialize the service.
15
16        Args:
17            client: The port implementation for award operations.
18        """
19        self._client = client

Initialize the service.

Args: client: The port implementation for award operations.

def get(self, award_id: str) -> src.awards.models.Award:
21    def get(self, award_id: str) -> Award:
22        """Fetch an award by its identifier.
23
24        Args:
25            award_id: The unique award identifier.
26
27        Returns:
28            The matching Award.
29
30        Raises:
31            AwardNotFound: When the award does not exist.
32            AwardForbidden: When access is denied.
33            AwardsClientError: When the service errors.
34        """
35        return self._client.get(award_id)

Fetch an award by its identifier.

Args: award_id: The unique award identifier.

Returns: The matching Award.

Raises: AwardNotFound: When the award does not exist. AwardForbidden: When access is denied. AwardsClientError: When the service errors.