from __future__ import annotations

from sqlalchemy import Boolean, Integer, String, Text
from sqlalchemy.orm import Mapped, mapped_column

from .base import Base


class TournamentPlayer(Base):
    """SQLAlchemy ORM model for TournamentPlayers"""

    __tablename__ = "TournamentPlayers"

    # Composite Primary Key
    OverviewPage: Mapped[str] = mapped_column(String, primary_key=True)
    Team: Mapped[str] = mapped_column(String, primary_key=True)
    N_PlayerInTeam: Mapped[int] = mapped_column(Integer, primary_key=True)

    # Team Information
    TeamOrder: Mapped[int | None] = mapped_column(Integer, default=None)
    PageAndTeam: Mapped[str | None] = mapped_column(String, default=None)

    # Player Information
    Link: Mapped[str | None] = mapped_column(String, default=None)
    Player: Mapped[str | None] = mapped_column(String, default=None)
    Role: Mapped[str | None] = mapped_column(String, default=None)

    # Additional Information
    Flag: Mapped[str | None] = mapped_column(Text, default=None)  # Wikitext
    Footnote: Mapped[str | None] = mapped_column(Text, default=None)  # Wikitext

    # Boolean Flags
    IsDistribution: Mapped[bool | None] = mapped_column(Boolean, default=None)
