Add notification settings
This commit is contained in:
@@ -9,6 +9,8 @@ from app.schemas.user import (
|
||||
PasswordChange,
|
||||
UserStats,
|
||||
UserProfilePublic,
|
||||
NotificationSettings,
|
||||
NotificationSettingsUpdate,
|
||||
)
|
||||
from app.schemas.marathon import (
|
||||
MarathonCreate,
|
||||
@@ -115,6 +117,8 @@ __all__ = [
|
||||
"PasswordChange",
|
||||
"UserStats",
|
||||
"UserProfilePublic",
|
||||
"NotificationSettings",
|
||||
"NotificationSettingsUpdate",
|
||||
# Marathon
|
||||
"MarathonCreate",
|
||||
"MarathonUpdate",
|
||||
|
||||
@@ -47,6 +47,10 @@ class UserPrivate(UserPublic):
|
||||
telegram_username: str | None = None
|
||||
telegram_first_name: str | None = None
|
||||
telegram_last_name: str | None = None
|
||||
# Notification settings
|
||||
notify_events: bool = True
|
||||
notify_disputes: bool = True
|
||||
notify_moderation: bool = True
|
||||
|
||||
|
||||
class TokenResponse(BaseModel):
|
||||
@@ -83,3 +87,20 @@ class UserProfilePublic(BaseModel):
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class NotificationSettings(BaseModel):
|
||||
"""Notification settings for Telegram bot"""
|
||||
notify_events: bool = True
|
||||
notify_disputes: bool = True
|
||||
notify_moderation: bool = True
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class NotificationSettingsUpdate(BaseModel):
|
||||
"""Update notification settings"""
|
||||
notify_events: bool | None = None
|
||||
notify_disputes: bool | None = None
|
||||
notify_moderation: bool | None = None
|
||||
|
||||
Reference in New Issue
Block a user