<?php

define('ROOT_PATH', dirname(__DIR__));
require_once ROOT_PATH . '/app/core/Autoloader.php';
\App\Core\Autoloader::register();

$bootstrap = new \App\Core\Bootstrap();
$bootstrap->init();

try {
    $db = \App\Core\Database::getConnection();
    $stmt = $db->query("SELECT u.id, u.username, u.email, u.role_id, u.workspace_id, r.slug as role_slug FROM users u JOIN roles r ON u.role_id = r.id");
    $users = $stmt->fetchAll(PDO::FETCH_ASSOC);
    print_r($users);
} catch (Throwable $e) {
    echo $e->getMessage() . "\n";
}
