- Fix TypeError in check_steal_opportunity by properly mocking catcher defense - Correct tag_from_third test calculation to account for all adjustment conditions - Fix pitcher replacement test by setting appropriate allowed runners threshold - Add comprehensive test coverage for AI service business logic - Implement VS Code testing panel configuration with pytest integration - Create pytest.ini for consistent test execution and warning management - Add test isolation guidelines and factory pattern implementation - Establish 102 passing tests with zero failures 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
44 lines
1.5 KiB
Python
44 lines
1.5 KiB
Python
"""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 |