mirror of
https://github.com/pocketpaw/pocketpaw.git
synced 2026-05-20 08:49:49 +00:00
- Auto-fix 155 errors (import sorting, annotations, deprecated imports) - Format 87 files with ruff format for line length compliance - Fix 15 F401 unused imports (add __all__ for re-exports, remove truly unused) - Fix 7 F841 unused variables (prefix with _) - Fix 2 F821 undefined names (add missing imports) - Fix 3 E402 module-level imports not at top - Fix 2 UP042 str+Enum → StrEnum - Fix 1 E712 == False comparison - Fix remaining 51 E501 line-too-long in string literals and expressions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
873 B
Python
36 lines
873 B
Python
"""Notification document."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
|
|
from beanie import Indexed
|
|
from pydantic import BaseModel
|
|
|
|
from ee.cloud.models.base import TimestampedDocument
|
|
|
|
|
|
class NotificationSource(BaseModel):
|
|
type: str
|
|
id: str
|
|
pocket_id: str | None = None
|
|
|
|
|
|
class Notification(TimestampedDocument):
|
|
"""In-app notification for a user."""
|
|
|
|
workspace: Indexed(str) # type: ignore[valid-type]
|
|
recipient: Indexed(str) # type: ignore[valid-type]
|
|
type: str # mention, comment, reply, invite, agent_complete, pocket_shared
|
|
title: str
|
|
body: str = ""
|
|
source: NotificationSource | None = None
|
|
read: bool = False
|
|
expires_at: datetime | None = None
|
|
|
|
class Settings:
|
|
name = "notifications"
|
|
indexes = [
|
|
[("recipient", 1), ("read", 1), ("created_at", -1)],
|
|
]
|