#!/usr/bin/env python3
"""Test vTiger account retrieval"""
import asyncio
import sys
sys.path.insert(0, '/app')

from app.services.vtiger_service import VTigerService
from app.core.config import settings
import json

async def main():
    vtiger = VTigerService()
    
    account_id = "3x957"
    
    # Fetch account
    print(f"\n=== Fetching account {account_id} ===")
    account = await vtiger.get_account_by_id(account_id)
    
    if account:
        print(f"\nAccount fields ({len(account)} total):")
        for key in sorted(account.keys()):
            value = account[key]
            if len(str(value)) > 100:
                value = str(value)[:100] + "..."
            print(f"  {key}: {value}")
    else:
        print("Account not found!")

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