Coverage for middle_layer/allocate/domain_layer/repositories/allocation_version.py: 100.00%
13 statements
« prev ^ index » next coverage.py v7.10.5, created at 2026-03-09 06:13 +0000
« prev ^ index » next coverage.py v7.10.5, created at 2026-03-09 06:13 +0000
1# Copyright 2024 Associated Universities, Inc.
2#
3# This file is part of Telescope Time Allocation Tools (TTAT).
4#
5# TTAT is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# any later version.
9#
10# TTAT is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with TTAT. If not, see <https://www.gnu.org/licenses/>.
18"""Abstract Base Class for AllocationVersion Repository"""
19import abc
20from abc import ABC
22from allocate.domain_layer.entities.allocation_version import AllocationVersion
23from allocate.domain_layer.entities.proposal_disposition_group import ProposalDispositionGroup
24from allocate.domain_layer.entities.publication_destination import PublicationDestination
25from common.domain_layer.repositories.sub_repository import SubRepository
26from solicit.domain_layer.entities.capability import Facility
27from solicit.domain_layer.entities.solicitation import Solicitation
30class AllocationVersionRepository(SubRepository[AllocationVersion], ABC):
31 @abc.abstractmethod
32 def list_currently_published(
33 self,
34 solicitation: Solicitation,
35 facility: Facility,
36 pdg: ProposalDispositionGroup,
37 destination: PublicationDestination,
38 ) -> AllocationVersion | None:
39 raise NotImplementedError
41 @abc.abstractmethod
42 def list_by_group_id(self, group_id: int) -> list[AllocationVersion]:
43 raise NotImplementedError