feat: add models and enum

This commit is contained in:
firedotguy
2026-01-30 20:49:49 +03:00
parent 1a606da55f
commit c7e3812ee8
17 changed files with 210 additions and 5 deletions

View File

@@ -0,0 +1,22 @@
from uuid import UUID
from datetime import datetime
from pydantic import BaseModel, Field
from itd.enums import NotificationType, NotificationTargetType
from itd.models.user import UserNotification
class Notification(BaseModel):
id: UUID
type: NotificationType
target_type: NotificationTargetType | None = Field(None, alias='targetType') # none - follows, other - NotificationTragetType.POST
target_id: int | None = Field(None, alias='targetId') # none - follows
preview: str | None = None # follow - none, comment/reply - content, repost - original post content, like - post content, wall_post - wall post content
read: bool = False
read_at: datetime | None = Field(None, alias='readAt')
created_at: datetime = Field(alias='createdAt')
actor: UserNotification