mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-18 20:01:52 +03:00
e1ad3dfb2a
This pull request adds the implementation of the notifications feature, including the ability to create, update, and delete notifications.
27 lines
782 B
Python
27 lines
782 B
Python
from typing import Optional
|
|
from uuid import UUID
|
|
|
|
from modules.notification.entity.notification import NotificationsStatusEnum
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class CreateNotification(BaseModel):
|
|
"""Properties that can be received on notification creation"""
|
|
|
|
user_id: UUID
|
|
status: NotificationsStatusEnum
|
|
title: str
|
|
description: Optional[str] = None
|
|
|
|
def model_dump(self, *args, **kwargs):
|
|
notification_dict = super().model_dump(*args, **kwargs)
|
|
notification_dict["user_id"] = str(notification_dict["user_id"])
|
|
return notification_dict
|
|
|
|
|
|
class NotificationUpdatableProperties(BaseModel):
|
|
"""Properties that can be received on notification update"""
|
|
|
|
status: Optional[NotificationsStatusEnum]
|
|
description: Optional[str]
|