2024-05-01 21:11:12 +03:00
|
|
|
from datetime import datetime
|
2023-09-07 14:22:06 +03:00
|
|
|
from enum import Enum
|
|
|
|
from typing import Optional
|
|
|
|
from uuid import UUID
|
|
|
|
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
class NotificationsStatusEnum(str, Enum):
|
2024-05-01 21:11:12 +03:00
|
|
|
INFO = "info"
|
|
|
|
SUCCESS = "success"
|
|
|
|
WARNING = "warning"
|
|
|
|
ERROR = "error"
|
2023-09-07 14:22:06 +03:00
|
|
|
|
|
|
|
|
|
|
|
class Notification(BaseModel):
|
|
|
|
id: UUID
|
2024-05-01 21:11:12 +03:00
|
|
|
user_id: UUID
|
2023-09-07 14:22:06 +03:00
|
|
|
status: NotificationsStatusEnum
|
2024-05-01 21:11:12 +03:00
|
|
|
title: str
|
|
|
|
description: Optional[str]
|
|
|
|
archived: Optional[bool] = False
|
|
|
|
read: Optional[bool] = False
|
|
|
|
datetime: Optional[datetime] # timestamp
|