<?php
// Emite um JWT de admin para o tenant default
// Uso: php scripts/issue_admin_jwt.php

error_reporting(E_ERROR | E_PARSE);
ini_set('display_errors', '0');

require_once __DIR__ . '/../bootstrap.php';

use Gestoreasy\Core\Auth\Jwt;

$tenant = getenv('TENANT_ID') ?: 'default';
$payload = [
  'sub' => 1,
  'email' => 'admin@local',
  'name' => 'Admin',
  'tenant' => $tenant,
  'roles' => ['admin']
];
$token = Jwt::sign($payload);
echo json_encode(['jwt' => $token, 'tenant' => $tenant], JSON_UNESCAPED_UNICODE) . "\n";