import sys, os
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/..'))

from app import create_app
from app.models.organization import Organization
from app.models.user import User

app = create_app()
with app.app_context():
    print("=== ORGANIZATIONS ===")
    for o in Organization.query.all():
        print(f"ID: {o.id} | Name: {o.name} | Slug: {o.slug} | Status: {o.status} | Plan: {o.plan.name if o.plan else None}")
    
    print("\n=== USERS ===")
    for u in User.query.all():
        print(f"ID: {u.id} | Name: {u.full_name} | Email: {u.email} | OrgID: {u.organization_id} | Role: {u.role.role_name if u.role else None} | IsSuper: {getattr(u, 'is_superadmin', False)}")
