"""Branding / company settings: a single row (id = 1) holding fields the whole
interface reads — the company name shown in the header and login screen, plus the
logo and favicon uploaded by an admin. Files are stored under UPLOAD_DIR and
referenced by their relative path.
"""
from sqlalchemy import String
from sqlalchemy.orm import Mapped, mapped_column

from app.db.base_class import Base, TimestampMixin


class Setting(Base, TimestampMixin):
    __tablename__ = "settings"

    id: Mapped[int] = mapped_column(primary_key=True)
    company_name: Mapped[str] = mapped_column(String(200), nullable=False, default="ISP Management System")
    # Relative paths under UPLOAD_DIR; empty string means "not set".
    logo_path: Mapped[str] = mapped_column(String(500), nullable=False, default="")
    logo_content_type: Mapped[str] = mapped_column(String(100), nullable=False, default="")
    favicon_path: Mapped[str] = mapped_column(String(500), nullable=False, default="")
    favicon_content_type: Mapped[str] = mapped_column(String(100), nullable=False, default="")
