"""
Test script to verify custom task status manager data
"""
import sys
sys.path.insert(0, '.')

from database import SessionLocal
from models.project import Project
from models.user import User

db = SessionLocal()
try:
    # Check if we have any projects
    projects = db.query(Project).all()
    print(f'Found {len(projects)} projects')
    if projects:
        project = projects[0]
        print(f'\nFirst project: ID={project.id}, Name={project.name}')
        print(f'Custom statuses: {project.custom_task_statuses}')
        print(f'Type: {type(project.custom_task_statuses)}')
    
    # Check if we have any admin users
    admin_user = db.query(User).filter(User.is_admin == True).first()
    if admin_user:
        print(f'\nFound admin user: {admin_user.email}')
    else:
        print('\nNo admin users found')
        
    # Check coordinator users
    coordinator = db.query(User).filter(User.role == 'coordinator').first()
    if coordinator:
        print(f'Found coordinator: {coordinator.email}')
    else:
        print('No coordinators found')
        
finally:
    db.close()

print('\n✅ Database check complete')
