Make notification data column a string

This commit is contained in:
Peter Vacho 2024-12-29 15:00:50 +01:00
parent dc18c86057
commit 8000087896
Signed by: school
GPG key ID: 8CFC3837052871B4

View file

@ -1,5 +1,5 @@
from datetime import UTC, datetime
from typing import Annotated, Any, ClassVar, Literal, final
from typing import Annotated, ClassVar, Literal, final
from beanie import Document, Indexed
from pydantic import Field
@ -15,7 +15,7 @@ class Notification(Document):
user: Annotated[BeanieLink[User], Indexed()]
event_type: Annotated[Literal["reminder", "invitation"], Indexed()]
message: str
data: Any
data: str
read: bool
created_at: datetime = Field(default_factory=lambda: datetime.now(UTC))
read_at: datetime | None = None