feat(backend): watches report alert counts, alerts carry watch params and time away, webhooks their last delivery

This commit is contained in:
hh committed 2026-10-19 02:57:27 +00:00
1 parent 9da0c06ac1
commit 6a4fd6ad47
4 files changed
+76 -37

No files matched your search

+16 -11
View File
@@ -546,6 +546,8 @@ class PersonRef(BaseModel):
class WatchItem(WatchView):
chat: ChatRef | None
person: PersonRef | None
alert_count: int
last_alert_at: datetime | None
class AlertView(BaseModel):
@@ -562,6 +564,7 @@ class AlertWatch(BaseModel):
id: int
kind: str
name: str | None
params: dict[str, Any]
class AlertMessage(BaseModel):
@@ -583,6 +586,7 @@ class AlertItem(BaseModel):
chat: ChatRef | None
message: AlertMessage | None
peer: PersonRef | None
away_since: datetime | None
path: str
@@ -592,17 +596,6 @@ class AlertPage(BaseModel):
unseen: int
class WebhookView(BaseModel):
id: int
account_id: int
url: str
secret: str
enabled: bool
watch_ids: list[int] | None
created_at: datetime
updated_at: datetime
class DeliveryView(BaseModel):
id: int
webhook_id: int
@@ -617,6 +610,18 @@ class DeliveryView(BaseModel):
finished_at: datetime | None
class WebhookView(BaseModel):
id: int
account_id: int
url: str
secret: str
enabled: bool
watch_ids: list[int] | None
created_at: datetime
updated_at: datetime
last_delivery: DeliveryView | None
class FileShareView(BaseModel):
id: int
account_id: int