feat: Implement favorites management API; add endpoints for adding, removing, and retrieving favorites for sounds and playlists

feat: Create Favorite model and repository for managing user favorites in the database
feat: Add FavoriteService to handle business logic for favorites management
feat: Enhance Playlist and Sound response schemas to include favorite indicators and counts
refactor: Update API routes to include favorites functionality in playlists and sounds
This commit is contained in:
JSC
2025-08-16 21:16:02 +02:00
parent 5e6cc04ad2
commit a947fd830b
14 changed files with 1005 additions and 13 deletions

View File

@@ -6,6 +6,7 @@ from app.models.base import BaseModel
if TYPE_CHECKING:
from app.models.extraction import Extraction
from app.models.favorite import Favorite
from app.models.playlist_sound import PlaylistSound
from app.models.sound_played import SoundPlayed
@@ -36,3 +37,4 @@ class Sound(BaseModel, table=True):
playlist_sounds: list["PlaylistSound"] = Relationship(back_populates="sound")
extractions: list["Extraction"] = Relationship(back_populates="sound")
play_history: list["SoundPlayed"] = Relationship(back_populates="sound")
favorites: list["Favorite"] = Relationship(back_populates="sound")