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

from .base import Base


class ScoreboardTeam(Base):
    """SQLAlchemy ORM model for ScoreboardTeams"""

    __tablename__ = "ScoreboardTeams"

    # This ISNT a primary key ??
    # But we need one otherwise SQLAlchemy will complain
    # As this table is used for query only, this is fine.
    GameTeamId: Mapped[str] = mapped_column(String, primary_key=True)

    # Basic Information
    Team: Mapped[str | None] = mapped_column(String, default=None)
    Side: Mapped[str | None] = mapped_column(String, default=None)
    Number: Mapped[int | None] = mapped_column(Integer, default=None)
    IsWinner: Mapped[bool | None] = mapped_column(Boolean, default=None)
    Score: Mapped[int | None] = mapped_column(Integer, default=None)

    # Bans, Picks, and Roster (stored as comma-delimited strings)
    Bans: Mapped[str | None] = mapped_column(String, default=None)
    Picks: Mapped[str | None] = mapped_column(String, default=None)
    Roster: Mapped[str | None] = mapped_column(String, default=None)

    # Dragon Statistics
    Dragons: Mapped[int | None] = mapped_column(Integer, default=None)
    Clouds: Mapped[int | None] = mapped_column(Integer, default=None)
    Infernals: Mapped[int | None] = mapped_column(Integer, default=None)
    Mountains: Mapped[int | None] = mapped_column(Integer, default=None)
    Oceans: Mapped[int | None] = mapped_column(Integer, default=None)
    Hextechs: Mapped[int | None] = mapped_column(Integer, default=None)
    Chemtechs: Mapped[int | None] = mapped_column(Integer, default=None)
    Elders: Mapped[int | None] = mapped_column(Integer, default=None)

    # Objective Statistics
    Barons: Mapped[int | None] = mapped_column(Integer, default=None)
    Towers: Mapped[int | None] = mapped_column(Integer, default=None)
    Gold: Mapped[int | None] = mapped_column(Integer, default=None)
    Kills: Mapped[int | None] = mapped_column(Integer, default=None)
    RiftHeralds: Mapped[int | None] = mapped_column(Integer, default=None)
    VoidGrubs: Mapped[int | None] = mapped_column(Integer, default=None)
    Atakhans: Mapped[int | None] = mapped_column(Integer, default=None)
    Inhibitors: Mapped[int | None] = mapped_column(Integer, default=None)

    # References and Identifiers
    OverviewPage: Mapped[str | None] = mapped_column(String, default=None)
    StatsPage: Mapped[str | None] = mapped_column(String, default=None)
    UniqueGame: Mapped[str | None] = mapped_column(String, default=None)
    UniqueTeam: Mapped[str | None] = mapped_column(String, default=None)
    GameId: Mapped[str | None] = mapped_column(String, default=None)
    MatchId: Mapped[str | None] = mapped_column(String, default=None)
