Add Profile model + migration + own-profile endpoints (US-3)
Implements user profile data model and own-profile management endpoints: - Profile and ProfileFavorites models in backend/app/models/profile.py - Migration 0010_add_profile_tables.py (profiles, profile_favorites) - Endpoints in backend/app/routers/profiles.py: - GET /api/profile/me (own profile with default fallback) - PUT /api/profile/me (upsert bio, avatar_asset_id, privacy settings) - GET /api/profile/me/favorites (list favorite world IDs) - PUT /api/profile/me/favorites (replace favorite world IDs) - Fixes values_callable on Asset.asset_type ENUM in app/models/asset.py - Added test_profile.py covering auth, validation, favorites, privacy Independently re-verified: 19/19 new profile tests pass, 258/258 full backend regression suite passes with zero regressions.
This commit is contained in:
@@ -35,6 +35,14 @@ class User(Base):
|
||||
cascade="all, delete-orphan",
|
||||
)
|
||||
|
||||
# Profile (app/models/profile.py): bio/avatar picture/privacy + favorites.
|
||||
profile = relationship(
|
||||
"Profile",
|
||||
back_populates="user",
|
||||
uselist=False,
|
||||
cascade="all, delete-orphan",
|
||||
)
|
||||
|
||||
# Social graph (docs/planning/social.md US-1; app/models/social.py)
|
||||
sent_friend_requests = relationship(
|
||||
"Friendship",
|
||||
|
||||
Reference in New Issue
Block a user