# /opt/docker/dev/service_finder/backend/app/seed_catalog.py
import asyncio
import logging
from app.database import AsyncSessionLocal
from app.models.asset import AssetCatalog
from app.models.staged_data import DiscoveryParameter

logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("Seed-Catalog")

async def quick_seed():
    async with AsyncSessionLocal() as db:
        logger.info("🌱 MB2.0 Katalógus alapozás indul...")
        
        # 1. Alap Márkák a Robotoknak (Discovery Queue)
        # Ezeket fogja a Robot 0 és Robot 1 elkezdeni feldolgozni
        makes = [
            ("SUZUKI", "car"), ("TOYOTA", "car"), ("SKODA", "car"), 
            ("VOLKSWAGEN", "car"), ("HONDA", "motorcycle"), ("YAMAHA", "motorcycle")
        ]
        
        for m_name, v_class in makes:
            db.add(DiscoveryParameter(
                make=m_name,
                city="BUDAPEST", # Teszt város
                keyword="repair",
                vehicle_class=v_class,
                is_active=True
            ))

        # 2. Arany rekordok (Példa adatok, amik már 'készen' vannak)
        gold_assets = [
            AssetCatalog(make="SUZUKI", model="VITARA", generation="LY (2015-)", fuel_type="petrol"),
            AssetCatalog(make="SKODA", model="OCTAVIA", generation="IV (2020-)", fuel_type="diesel")
        ]
        db.add_all(gold_assets)
        
        await db.commit()
        logger.info("✅ Katalógus és Discovery paraméterek feltöltve.")

if __name__ == "__main__":
    asyncio.run(quick_seed())