Skip to content

Commit

Permalink
add cases to participant activity
Browse files Browse the repository at this point in the history
  • Loading branch information
metroid-samus committed Jun 28, 2024
1 parent 2e28250 commit 25991f0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/dispatch/participant_activity/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down

0 comments on commit 25991f0

Please sign in to comment.