fix: QA fixes for property decisions feature
- 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
This commit is contained in:
parent
8452f65d25
commit
49280d9679
6 changed files with 149 additions and 7 deletions
|
|
@ -3,6 +3,7 @@ from models.decision import ListingDecision
|
|||
from repositories.decision_repository import DecisionRepository
|
||||
|
||||
VALID_DECISIONS = {"liked", "disliked"}
|
||||
VALID_LISTING_TYPES = {"RENT", "BUY"}
|
||||
|
||||
|
||||
def set_decision(
|
||||
|
|
@ -16,6 +17,10 @@ def set_decision(
|
|||
raise ValueError(
|
||||
f"Invalid decision '{decision}'. Must be one of: {VALID_DECISIONS}"
|
||||
)
|
||||
if listing_type not in VALID_LISTING_TYPES:
|
||||
raise ValueError(
|
||||
f"Invalid listing_type '{listing_type}'. Must be one of: {VALID_LISTING_TYPES}"
|
||||
)
|
||||
return repository.upsert_decision(
|
||||
user_id=user_id,
|
||||
listing_id=listing_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue