Files
pocketpaw/ee/cloud/models/notification.py
Rohit Kushwaha ff5bb0350a fix: resolve all 394 ruff lint errors
- 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>
2026-04-11 10:08:58 +05:30

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)],
]