This commit is contained in:
@@ -96,6 +96,52 @@ class EmergencyResponseResponse(BaseModel):
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class UserInfo(BaseModel):
|
||||
"""Базовая информация о пользователе для событий"""
|
||||
id: int
|
||||
username: str
|
||||
full_name: Optional[str] = None
|
||||
phone: Optional[str] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class EmergencyEventDetails(BaseModel):
|
||||
"""Полная детальная информация о событии экстренной помощи"""
|
||||
# Основная информация о событии
|
||||
id: int
|
||||
uuid: UUID
|
||||
user_id: int
|
||||
latitude: float
|
||||
longitude: float
|
||||
address: Optional[str] = None
|
||||
alert_type: AlertType
|
||||
message: Optional[str] = None
|
||||
status: AlertStatus
|
||||
created_at: datetime
|
||||
updated_at: Optional[datetime] = None
|
||||
resolved_at: Optional[datetime] = None
|
||||
|
||||
# Информация о пользователе, который создал событие
|
||||
user: UserInfo
|
||||
|
||||
# Все ответы на это событие
|
||||
responses: List[EmergencyResponseResponse] = []
|
||||
|
||||
# Статистика уведомлений
|
||||
notifications_sent: int = 0
|
||||
websocket_notifications_sent: int = 0
|
||||
push_notifications_sent: int = 0
|
||||
|
||||
# Дополнительная информация
|
||||
contact_emergency_services: bool = True
|
||||
notify_emergency_contacts: bool = True
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# Report schemas
|
||||
class EmergencyReportCreate(BaseModel):
|
||||
latitude: float = Field(..., ge=-90, le=90)
|
||||
|
||||
Reference in New Issue
Block a user