29 lines
625 B
Python
29 lines
625 B
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
from models.notification import NotificationType
|
|
|
|
class NotificationResponse(BaseModel):
|
|
id: int
|
|
type: NotificationType
|
|
title: str
|
|
message: str
|
|
link: Optional[str]
|
|
is_read: bool
|
|
created_at: datetime
|
|
read_at: Optional[datetime]
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
class PushSubscriptionKeys(BaseModel):
|
|
p256dh: str
|
|
auth: str
|
|
|
|
class PushSubscriptionCreate(BaseModel):
|
|
endpoint: str
|
|
keys: PushSubscriptionKeys
|
|
|
|
class VapidPublicKeyResponse(BaseModel):
|
|
public_key: str
|