<?php
declare(strict_types=1);

require_once __DIR__ . '/../app/Core/Autoloader.php';
App\Core\Autoloader::register();

use App\Config\Config;
use App\Core\DB;
use App\Services\NFePhpService;

Config::init();
DB::init();

$tenants = DB::pdo()->query("SELECT id FROM tenants WHERE status = 'ativo'")->fetchAll();
foreach ($tenants as $t) {
    NFePhpService::baixarNotasDestinadas((int)$t['id']);
}
