import uuid from sqlalchemy import JSON, String from sqlalchemy.orm import Mapped, mapped_column, relationship from app.models.base import Base, TimestampMixin, generate_uuid class Client(Base, TimestampMixin): __tablename__ = "clients" id: Mapped[uuid.UUID] = mapped_column( primary_key=True, default=generate_uuid ) name: Mapped[str] = mapped_column(String(255), nullable=False) settings: Mapped[dict | None] = mapped_column(JSON, nullable=True) # Relationships user_clients = relationship("UserClient", back_populates="client", lazy="selectin") jobs = relationship("Job", back_populates="client", lazy="selectin") tm_files = relationship("TMFileRegistry", back_populates="client", lazy="selectin") reference_files = relationship("ReferenceFile", back_populates="client", lazy="selectin")