refaktor címjegyzék

This commit is contained in:
Roo
2026-07-02 11:52:22 +00:00
parent 7654913d21
commit 07b59032ce
192 changed files with 2936 additions and 1376 deletions

View File

@@ -38,7 +38,8 @@ from app.models.identity.social import (
SourceType,
ProviderValidation,
)
from app.models.marketplace.service import ServiceStaging, ServiceProfile
from app.models.marketplace.service import ServiceProfile
from app.models.marketplace.staged_data import ServiceStaging
from app.models.gamification.gamification import UserContribution
from app.models.vehicle.history import AuditLog
from app.services.gamification_service import gamification_service
@@ -82,10 +83,15 @@ class ProviderDetail(BaseModel):
contact_email: Optional[str] = None
website: Optional[str] = None
category: Optional[str] = None
description: Optional[str] = None
status: str
source: str
source_table: str = "service_providers"
validation_score: int = 0
trust_score: Optional[int] = None
rejection_reason: Optional[str] = None
raw_data: Optional[Dict[str, Any]] = None
audit_trail: Optional[Dict[str, Any]] = None
evidence_image_path: Optional[str] = None
added_by_user_id: Optional[int] = None
category_ids: Optional[List[int]] = None
@@ -564,13 +570,7 @@ async def get_provider_detail(
name=sp.name,
address=sp.address or "",
city=sp.city,
address_detail=AddressOut(
zip=sp.address_zip,
city=sp.city,
street_name=sp.address_street_name,
street_type=sp.address_street_type,
house_number=sp.address_house_number,
),
address_detail=None,
plus_code=sp.plus_code,
contact_phone=sp.contact_phone,
contact_email=sp.contact_email,
@@ -586,6 +586,9 @@ async def get_provider_detail(
supported_vehicle_classes=sp.supported_vehicle_classes or [],
specializations=sp.specializations or {},
opening_hours=opening_hours or {},
# P0 BUGFIX: Include raw_data for ServiceProvider records so the frontend
# "Nyers adatok / Crawler" tab shows actual data instead of empty/mock state
raw_data=sp.raw_data or {},
created_at=sp.created_at,
)
@@ -600,10 +603,21 @@ async def get_provider_detail(
name=ss.name,
address=ss.full_address or "",
city=ss.city,
contact_phone=ss.contact_phone,
contact_email=ss.contact_email,
website=ss.website,
description=ss.description,
status=ss.status,
source="bot",
source=ss.source or "bot",
source_table="service_staging",
validation_score=0,
# BUGFIX: Use trust_score from staging as validation_score instead of hardcoded 0
# The staging table doesn't have a separate validation_score column,
# but trust_score reflects the bot's confidence in the data quality
validation_score=ss.trust_score or 0,
trust_score=ss.trust_score,
rejection_reason=ss.rejection_reason,
raw_data=ss.raw_data or {},
audit_trail=ss.audit_trail or {},
created_at=ss.created_at,
)
@@ -1336,13 +1350,7 @@ async def update_provider(
name=provider.name,
address=provider.address or "",
city=provider.city,
address_detail=AddressOut(
zip=provider.address_zip,
city=provider.city,
street_name=provider.address_street_name,
street_type=provider.address_street_type,
house_number=provider.address_house_number,
),
address_detail=None,
plus_code=provider.plus_code,
contact_phone=provider.contact_phone,
contact_email=provider.contact_email,