<?php
require __DIR__ . '/../bootstrap.php';

use Gestoreasy\Core\Tenant\TenantAdmin;
use Gestoreasy\Core\Tenant\ConnectionManager;
use Gestoreasy\Core\Fiscal\VersionRouter;

$tenant = $argv[1] ?? 'default';
TenantAdmin::runMigrations($tenant);
$pdo = ConnectionManager::forTenant($tenant);

$items = [ ['descricao' => 'Item teste', 'quantidade' => 2, 'preco' => 50] ];
$cross = VersionRouter::crossValidatePreview($items);

echo json_encode(['ok' => true, 'cross' => $cross], JSON_UNESCAPED_UNICODE) . "\n";