- Replace deprecated datetime.utcnow() with datetime.now(UTC) in model and repository - Add listing_type validation to decision_service (RENT/BUY only) - Fix decision filtering tests failing due to rate limiting by patching _match_endpoint - Add SwipeCard component test suite (11 tests covering rendering, interactions, and POI distances) - Add test for invalid listing_type validation
13 lines
595 B
Python
13 lines
595 B
Python
from datetime import datetime, UTC
|
|
|
|
from sqlmodel import SQLModel, Field
|
|
|
|
|
|
class ListingDecision(SQLModel, table=True):
|
|
id: int | None = Field(default=None, primary_key=True)
|
|
user_id: int = Field(nullable=False, foreign_key="user.id", index=True)
|
|
listing_id: int = Field(nullable=False, index=True)
|
|
listing_type: str = Field(nullable=False) # "RENT" or "BUY"
|
|
decision: str = Field(nullable=False) # "liked" or "disliked"
|
|
created_at: datetime = Field(default_factory=lambda: datetime.now(UTC))
|
|
updated_at: datetime = Field(default_factory=lambda: datetime.now(UTC))
|