Coverage for middle_layer/allocate/domain_layer/repositories/proposal_disposition.py: 100.00%

13 statements  

« 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/>. 

17 

18"""Abstract Base Class for ProposalDisposition Repository""" 

19import abc 

20from abc import ABC 

21 

22from allocate.domain_layer.entities.proposal_disposition import ProposalDisposition 

23from allocate.domain_layer.entities.proposal_disposition_group import ProposalDispositionGroup 

24from common.domain_layer.repositories.sub_repository import MakeOnceRepository, SubRepository 

25 

26 

27class ProposalDispositionRepository(SubRepository[ProposalDisposition], ABC): 

28 @abc.abstractmethod 

29 def list_by_group_id(self, group_id: int) -> list[ProposalDisposition]: 

30 raise NotImplementedError 

31 

32 @abc.abstractmethod 

33 def list_by_solicitation_id( 

34 self, solicitation_id: int, author_user_id: int | None = None 

35 ) -> list[ProposalDisposition]: 

36 raise NotImplementedError 

37 

38 @abc.abstractmethod 

39 def by_proposal_code(self, proposal_code: str) -> ProposalDisposition: 

40 raise NotImplementedError 

41 

42 

43class ProposalDispositionGroupRepository(MakeOnceRepository[ProposalDispositionGroup], ABC): 

44 pass