21 lines
559 B
Python
21 lines
559 B
Python
"""Схемы отзывов и рейтингов."""
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class ReviewCreate(BaseModel):
|
|
project_id: str = Field(..., description="ID проекта")
|
|
reviewee_id: str = Field(..., description="ID того кого оценивают")
|
|
rating: int = Field(..., ge=1, le=5)
|
|
comment: str | None = Field(default=None, max_length=2000)
|
|
|
|
|
|
class ReviewResponse(BaseModel):
|
|
id: str
|
|
project_id: str
|
|
reviewer_name: str
|
|
reviewee_name: str
|
|
rating: int
|
|
comment: str | None
|
|
created_at: str
|