Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/api/endpoints/search/agency/models/response.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
from pydantic import BaseModel

from src.db.models.impl.agency.enums import AgencyType, JurisdictionType


class AgencySearchResponse(BaseModel):
agency_id: int
agency_name: str
jurisdiction_type: JurisdictionType | None
agency_type: AgencyType
location_display_name: str
2 changes: 2 additions & 0 deletions src/api/endpoints/search/agency/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ async def run(self, session: AsyncSession) -> list[AgencySearchResponse]:
select(
Agency.agency_id,
Agency.name.label("agency_name"),
Agency.jurisdiction_type,
Agency.agency_type,
LocationExpandedView.display_name.label("location_display_name")
)
)
Expand Down
6 changes: 5 additions & 1 deletion src/db/models/impl/agency/sqlalchemy.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ class Agency(
county = Column(String, nullable=True)
locality = Column(String, nullable=True)
agency_type = enum_column(AgencyType, name="agency_type_enum")
jurisdiction_type = enum_column(JurisdictionType, name="jurisdiction_type_enum")
jurisdiction_type = enum_column(
JurisdictionType,
name="jurisdiction_type_enum",
nullable=True,
)

# Relationships
automated_suggestions = relationship("AgencyIDSubtaskSuggestion")
Expand Down