"""Team model - pure data container for team information. This model contains only data fields and relationships. All business logic has been extracted to services (UIService for formatting, etc.). """ import datetime from sqlmodel import SQLModel, Field, Relationship from sqlalchemy import Column, BigInteger class TeamBase(SQLModel): """Base team data fields.""" id: int = Field(sa_column=Column(BigInteger(), primary_key=True, autoincrement=False, unique=True)) abbrev: str = Field(index=True) sname: str lname: str gmid: int = Field(sa_column=Column(BigInteger(), autoincrement=False, index=True)) gmname: str gsheet: str wallet: int team_value: int collection_value: int logo: str | None = Field(default=None) color: str season: int career: int ranking: int has_guide: bool is_ai: bool created: datetime.datetime = Field(default_factory=datetime.datetime.now, nullable=True) @property def description(self) -> str: """Simple description property - kept as it's pure data formatting.""" return f'{self.id}. {self.abbrev} {self.lname}, {"AI" if self.is_ai else "Human"}' class Team(TeamBase, table=True): """Team model with relationships.""" # Note: Relationships to cards, lineups commented out until those models are migrated # cards: list['Card'] = Relationship(back_populates='team', cascade_delete=True) # lineups: list['Lineup'] = Relationship(back_populates='team', cascade_delete=True) pass