53 lines
1.4 KiB
Python
53 lines
1.4 KiB
Python
from pydantic import BaseModel
|
|
from datetime import datetime
|
|
from typing import Optional
|
|
from app.models.notification import NotificationType
|
|
|
|
|
|
class NotificationResponse(BaseModel):
|
|
id: int
|
|
recipient_id: int
|
|
sender_id: Optional[int] = None
|
|
type: NotificationType
|
|
title: str
|
|
message: str
|
|
data: Optional[str] = None
|
|
is_read: bool
|
|
created_at: datetime
|
|
read_at: Optional[datetime] = None
|
|
sender_name: Optional[str] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class NotificationSettingsResponse(BaseModel):
|
|
id: int
|
|
user_id: int
|
|
email_notifications: bool
|
|
push_notifications: bool
|
|
connection_requests: bool
|
|
post_interactions: bool
|
|
event_reminders: bool
|
|
prayer_requests: bool
|
|
ministry_updates: bool
|
|
donation_reminders: bool
|
|
birthday_reminders: bool
|
|
announcements: bool
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class NotificationSettingsUpdate(BaseModel):
|
|
email_notifications: Optional[bool] = None
|
|
push_notifications: Optional[bool] = None
|
|
connection_requests: Optional[bool] = None
|
|
post_interactions: Optional[bool] = None
|
|
event_reminders: Optional[bool] = None
|
|
prayer_requests: Optional[bool] = None
|
|
ministry_updates: Optional[bool] = None
|
|
donation_reminders: Optional[bool] = None
|
|
birthday_reminders: Optional[bool] = None
|
|
announcements: Optional[bool] = None
|