refaktorálás javításai
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# /opt/docker/dev/service_finder/backend/app/schemas/social.py
|
||||
import uuid # HOZZÁADVA
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from typing import Optional, List
|
||||
from datetime import datetime
|
||||
@@ -27,6 +27,28 @@ class ServiceProviderResponse(ServiceProviderBase):
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
# --- Értékelések (Reviews) - HOZZÁADVA ---
|
||||
|
||||
class ServiceReviewBase(BaseModel):
|
||||
price_rating: int
|
||||
quality_rating: int
|
||||
time_rating: int
|
||||
communication_rating: int
|
||||
comment: Optional[str] = None
|
||||
|
||||
class ServiceReviewCreate(ServiceReviewBase):
|
||||
pass
|
||||
|
||||
class ServiceReviewResponse(ServiceReviewBase):
|
||||
id: int
|
||||
user_id: int
|
||||
service_id: int
|
||||
transaction_id: uuid.UUID
|
||||
is_verified: bool
|
||||
created_at: datetime
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
# --- Gamifikáció és Szavazás (Voting & Gamification) ---
|
||||
|
||||
class VoteCreate(BaseModel):
|
||||
@@ -43,15 +65,15 @@ class BadgeSchema(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
description: str
|
||||
icon_url: Optional[str] = None # JAVÍTVA: icon_url a modell szerint
|
||||
icon_url: Optional[str] = None
|
||||
|
||||
model_config = ConfigDict(from_attributes=True) # Pydantic V2 kompatibilis
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
class UserStatSchema(BaseModel):
|
||||
user_id: int
|
||||
total_xp: int # JAVÍTVA: total_xp a modell szerint
|
||||
total_xp: int
|
||||
current_level: int
|
||||
penalty_points: int # JAVÍTVA: új mező
|
||||
penalty_points: int
|
||||
rank_title: Optional[str] = None
|
||||
badges: List[BadgeSchema] = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user