Files
security-alert-center/backend/app/models/mobile_settings.py
T
PTah 563b836acc feat: Seaca mobile API, enrollment, FCM push and admin UI (0.9.0)
Adds mobile device registration by admin codes, refresh tokens, push channel
in notification policy, and Settings section for managing Seaca clients.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-10 13:19:14 +10:00

22 lines
753 B
Python

from sqlalchemy import Boolean, Integer, String
from sqlalchemy.orm import Mapped, mapped_column
from app.database import Base
MOBILE_SETTINGS_ROW_ID = 1
LOGIN_MODE_PASSWORD = "password"
LOGIN_MODE_CODE_ONLY = "code_only"
LOGIN_MODES = frozenset({LOGIN_MODE_PASSWORD, LOGIN_MODE_CODE_ONLY})
class MobileSettings(Base):
"""Singleton: глобальные настройки мобильного клиента Seaca."""
__tablename__ = "mobile_settings"
id: Mapped[int] = mapped_column(primary_key=True)
devices_allowed: Mapped[bool] = mapped_column(Boolean, default=False)
max_devices_per_user: Mapped[int] = mapped_column(Integer, default=3)
min_app_version: Mapped[str | None] = mapped_column(String(32), nullable=True)