feat: add models and enum
This commit is contained in:
22
itd/models/notification.py
Normal file
22
itd/models/notification.py
Normal 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
|
||||
Reference in New Issue
Block a user