"""Run one read-only BestWeb live-status reconciliation pass."""
import asyncio
from sqlalchemy import select
from app.core.database import AsyncSessionLocal
from app.core.onboarding import refresh_customer_online_status
from app.models.models import Customer


async def main():
    async with AsyncSessionLocal() as db:
        customers = (await db.execute(
            select(Customer).where(Customer.is_archived == False)
        )).scalars().all()
        for customer in customers:
            status = await refresh_customer_online_status(customer, db)
            print(f"{customer.id}: {status}")


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