STABLE: Final schema sync, optimized gitignore
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
# /opt/docker/dev/service_finder/backend/app/schemas/social.py
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from typing import Optional, List
|
||||
from datetime import datetime
|
||||
from app.models.social import ModerationStatus, SourceType
|
||||
|
||||
# --- Alap Sémák ---
|
||||
# --- Alap Sémák (Szolgáltatók) ---
|
||||
|
||||
class ServiceProviderBase(BaseModel):
|
||||
name: str
|
||||
@@ -19,42 +20,39 @@ class ServiceProviderCreate(BaseModel):
|
||||
class ServiceProviderResponse(ServiceProviderBase):
|
||||
id: int
|
||||
status: ModerationStatus
|
||||
validation_score: int # Látni kell a pontszámot
|
||||
validation_score: int
|
||||
evidence_image_path: Optional[str] = None
|
||||
added_by_user_id: Optional[int] = None
|
||||
created_at: datetime
|
||||
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
# --- Voting & Gamification Sémák ---
|
||||
# --- Gamifikáció és Szavazás (Voting & Gamification) ---
|
||||
|
||||
class VoteCreate(BaseModel):
|
||||
vote_value: int # Csak a +1 vagy -1 kell, a user_id jön a tokenből, a provider_id az URL-ből
|
||||
vote_value: int
|
||||
|
||||
class LeaderboardEntry(BaseModel):
|
||||
username: str
|
||||
points: int
|
||||
rank: int
|
||||
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
# --- GAMIFIKÁCIÓS SÉMÁK (Amiket a log keresett) ---
|
||||
|
||||
class BadgeSchema(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
description: str
|
||||
image_url: Optional[str] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
icon_url: Optional[str] = None # JAVÍTVA: icon_url a modell szerint
|
||||
|
||||
model_config = ConfigDict(from_attributes=True) # Pydantic V2 kompatibilis
|
||||
|
||||
class UserStatSchema(BaseModel):
|
||||
user_id: int
|
||||
total_points: int
|
||||
total_xp: int # JAVÍTVA: total_xp a modell szerint
|
||||
current_level: int
|
||||
rank_title: str
|
||||
penalty_points: int # JAVÍTVA: új mező
|
||||
rank_title: Optional[str] = None
|
||||
badges: List[BadgeSchema] = []
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
Reference in New Issue
Block a user