31 lines
916 B
Python
Executable File
31 lines
916 B
Python
Executable File
from pydantic import BaseModel, ConfigDict
|
|
from typing import Optional
|
|
from datetime import datetime
|
|
from app.models.social import ModerationStatus, SourceType
|
|
|
|
# --- Alap Sémák ---
|
|
|
|
class ServiceProviderBase(BaseModel):
|
|
name: str
|
|
address: Optional[str] = None
|
|
# Fontos: Kisbetűs 'manual', ahogy a modellben is van!
|
|
source: SourceType = SourceType.manual
|
|
|
|
class ServiceProviderCreate(ServiceProviderBase):
|
|
pass
|
|
|
|
class ServiceProviderResponse(ServiceProviderBase):
|
|
id: int
|
|
status: ModerationStatus
|
|
validation_score: int # Ezt is visszaadjuk, hogy lássuk a pontokat
|
|
evidence_image_path: Optional[str] = None
|
|
added_by_user_id: Optional[int] = None
|
|
created_at: datetime
|
|
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
# --- EZ HIÁNYZOTT: A Szavazás Sémája ---
|
|
class VoteCreate(BaseModel):
|
|
user_id: int
|
|
provider_id: int
|
|
vote_value: int # +1 vagy -1 |