Coverage for middle_layer/solicit/domain_layer/entities/technical_justification_question.py: 88.89%

18 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# pyright: reportImportCycles=false 

18 

19import typing 

20 

21from sqlalchemy import ForeignKey 

22from sqlalchemy.orm import Mapped, mapped_column, relationship 

23 

24from common.domain_layer.entities.base import Base 

25 

26if typing.TYPE_CHECKING: 

27 from solicit.domain_layer.entities.capability import Capability, Facility 

28 from solicit.domain_layer.entities.solicitation import Solicitation 

29 

30 

31class TechnicalJustificationQuestion(Base): 

32 __tablename__: str = "technical_justification_questions" 

33 

34 question_id: Mapped[int] = mapped_column(primary_key=True) 

35 solicitation_id: Mapped[int] = mapped_column(ForeignKey("solicitations.solicitation_id", ondelete="CASCADE")) 

36 solicitation: Mapped["Solicitation"] = relationship( 

37 back_populates="technical_justification_questions", 

38 ) 

39 sort_order: Mapped[int] = mapped_column() 

40 question: Mapped[str] = mapped_column() 

41 facility_id: Mapped[int] = mapped_column(ForeignKey("facilities.facility_id")) 

42 facility: Mapped["Facility"] = relationship() 

43 capability_id: Mapped[int] = mapped_column(ForeignKey("capabilities.capability_id")) 

44 capability: Mapped["Capability"] = relationship()