feat(api): SessionRepository, session/song schemas with tags

Adds RehearsalSessionRepository (get_or_create, list_for_band with
counts, get_with_songs). Adds RehearsalSession schemas (Read, Detail,
Update). Extends SongRead/SongUpdate with tags and session_id fields.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Steffen Schuhmann
2026-03-29 13:36:52 +02:00
parent f1f4dc5a88
commit f930bb061c
3 changed files with 99 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import uuid
from datetime import datetime
from pydantic import BaseModel, ConfigDict
from rehearsalhub.schemas.song import SongRead
class RehearsalSessionRead(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: uuid.UUID
band_id: uuid.UUID
date: datetime
nc_folder_path: str | None = None
label: str | None = None
notes: str | None = None
created_at: datetime
recording_count: int = 0
class RehearsalSessionDetail(RehearsalSessionRead):
songs: list[SongRead] = []
class RehearsalSessionUpdate(BaseModel):
label: str | None = None
notes: str | None = None