Add update song review model

This commit is contained in:
Esa Kataja
2025-02-28 12:42:28 +02:00
parent 7ef953e491
commit 595cc07673
+58 -11
View File
@@ -3,18 +3,65 @@ from uuid import UUID, uuid4
class SongBase(BaseModel):
id: uuid4 = Field(default_factory=uuid4, description="Song ID. Required.", examples=["3a4c5f1d-3a4c-4f1d-3a4c-5f1d3a4c5f1d"])
id: uuid4 = Field(
default_factory=uuid4,
description="Song ID. Required.",
examples=["3a4c5f1d-3a4c-4f1d-3a4c-5f1d3a4c5f1d"],
)
class SongIn(SongBase):
artist: str = Field(..., description="Artist of the song. Required.", examples=["Matti Meikäläinen"])
song_name: str = Field(..., description="Name of the song. Required.", examples=["Moi"])
country: str = Field(..., description="Country where the song is from. Required.", examples=["Finland"])
artist: str = Field(
..., description="Artist of the song. Required.", examples=["Matti Meikäläinen"]
)
song_name: str = Field(
..., description="Name of the song. Required.", examples=["Moi"]
)
country: str = Field(
...,
description="Country where the song is from. Required.",
examples=["Finland"],
)
class SongReview(SongBase):
contest_id: UUID = Field(..., description="Contest ID. Required.", examples=["3a4c5f1d-3a4c-4f1d-3a4c-5f1d3a4c5f1d"])
song_id: UUID = Field(..., description="Song ID. Required.", examples=["3a4c5f1d-3a4c-4f1d-3a4c-5f1d3a4c5f1d"])
reviewer_id: UUID = Field(..., description="Reviewer ID. Required.", examples=["3a4c5f1d-3a4c-4f1d-3a4c-5f1d3a4c5f1d"])
class SongReview(BaseModel):
contest_id: UUID = Field(
...,
description="Contest ID. Required.",
examples=["3a4c5f1d-3a4c-4f1d-3a4c-5f1d3a4c5f1d"],
)
song_id: UUID = Field(
...,
description="Song ID. Required.",
examples=["3a4c5f1d-3a4c-4f1d-3a4c-5f1d3a4c5f1d"],
)
song_score: int = Field(..., description="Song score. Required.", examples=[50])
wardrobe_score: int = Field(..., description="Wardrobe score. Required.", examples=[50])
stage_show_score: int = Field(..., description="Stage show score. Required.", examples=[50])
review_text: str | None = Field(None, description="Review text. Optional.", examples=["Great song!"])
wardrobe_score: int = Field(
..., description="Wardrobe score. Required.", examples=[50]
)
stage_show_score: int = Field(
..., description="Stage show score. Required.", examples=[50]
)
review_text: str | None = Field(
None, description="Review text. Optional.", examples=["Great song!"]
)
class UpdateSongReview(BaseModel):
review_id: UUID = Field(
...,
description="Review ID. Required.",
examples=["3a4c5f1d-3a4c-4f1d-3a4c-5f1d3a4c5f1d"],
)
song_score: int | None = Field(
None, description="Song score. Optional.", examples=[50]
)
wardrobe_score: int | None = Field(
None, description="Wardrobe score. Optional.", examples=[50]
)
stage_show_score: int | None = Field(
None, description="Stage show score. Optional.", examples=[50]
)
review_text: str | None = Field(
None, description="Review text. Optional.", examples=["Great song!"]
)