diff --git a/src/dispatch/participant_activity/models.py b/src/dispatch/participant_activity/models.py index 442fc232561e..79e76c4d98f7 100644 --- a/src/dispatch/participant_activity/models.py +++ b/src/dispatch/participant_activity/models.py @@ -3,6 +3,7 @@ from sqlalchemy.orm import relationship from typing import Optional +from dispatch.case.models import CaseRead from dispatch.database.core import Base from dispatch.incident.models import IncidentRead from dispatch.models import DispatchBase, PrimaryKey @@ -26,14 +27,18 @@ class ParticipantActivity(Base): incident_id = Column(Integer, ForeignKey("incident.id")) incident = relationship("Incident", foreign_keys=[incident_id]) + case_id = Column(Integer, ForeignKey("case.id")) + case = relationship("Case", foreign_keys=[case_id]) + # Pydantic Models class ParticipantActivityBase(DispatchBase): plugin_event: PluginEventRead - started_at: Optional[datetime] = None - ended_at: Optional[datetime] = None + started_at: datetime | None + ended_at: datetime | None participant: ParticipantRead - incident: IncidentRead + incident: IncidentRead | None + case: CaseRead class ParticipantActivityRead(ParticipantActivityBase):