feat: multi-robot architecture, car-robot rename, and credit-based OCR logic spec

This commit is contained in:
2026-02-07 02:20:04 +00:00
parent cab8706980
commit d3ce60d69b
17 changed files with 223 additions and 412 deletions

View File

@@ -0,0 +1,37 @@
from fastapi import APIRouter, Depends, Query
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select, or_
from app.db.session import get_db
from app.models.vehicle import VehicleCatalog
from typing import List
router = APIRouter()
@router.get("/search")
async def search_catalog(
q: str = Query(..., min_length=2, description="Márka vagy típus keresése"),
category: str = None,
db: AsyncSession = Depends(get_db)
):
"""Keresés a Robot által feltöltött katalógusban."""
stmt = select(VehicleCatalog).where(
or_(
VehicleCatalog.brand.ilike(f"%{q}%"),
VehicleCatalog.model.ilike(f"%{q}%")
)
)
if category:
stmt = stmt.where(VehicleCatalog.category == category)
result = await db.execute(stmt.limit(20))
items = result.scalars().all()
return [
{
"id": i.id,
"full_name": f"{i.brand} {i.model}",
"category": i.category,
"status": i.verification_status,
"specs": i.factory_specs
} for i in items
]