import asyncio
from datetime import timedelta
from app.services.auth_service import AuthService
from app.models.user import UserRole
import logging

# Configure logging to suppress verbose output
logging.basicConfig(level=logging.ERROR)

async def generate():
    # Generate a token valid for 1 year
    # Using User ID 1 since I assume it exists based on previous output (though wait, previous output was truncated!)
    # Actually, let's just make sure. Previous output showed User ID 22-36. 
    # Usually Admin is 1. If 1 was not in the list, maybe it was at the top and truncated?
    # I'll blindly trust ID 1 is the admin for now, or use a script to find one.
    
    token = AuthService.create_access_token(
        user_id=1, 
        role="admin", 
        expires_delta=timedelta(days=365)
    )
    print(f"GENERATED_TOKEN:{token}")

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