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

@@ -1,5 +1,10 @@
from fastapi import APIRouter
from app.api.v1.endpoints import auth
from app.api.v1.endpoints import auth, catalog # <--- Hozzáadtuk a catalog-ot
api_router = APIRouter()
api_router.include_router(auth.router, prefix="/auth", tags=["Authentication"])
# Autentikáció és KYC végpontok
api_router.include_router(auth.router, prefix="/auth", tags=["Authentication"])
# Jármű Katalógus és Robot kereső végpontok
api_router.include_router(catalog.router, prefix="/catalog", tags=["Vehicle Catalog"])

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
]