Files
Investidor-V2/tools/portal-revision-geo-actor-qa.php
nala 287e991486
tests / ci (push) Waiting to run
oportunidades 7
2026-10-13 11:40:29 +02:00

22 lines
1.0 KiB
PHP

<?php
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Support\Facades\DB;
$root = dirname(__DIR__);
require $root.'/vendor/autoload.php';
require __DIR__.'/portal-qa-environment.php';
$target = portalQaEnvironment();
$app = require $root.'/bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
$identity = portalQaAssertTarget($target);
$proof = DB::transaction(function () use ($identity) {
DB::statement('SET TRANSACTION READ ONLY');
$actor = DB::table('users')->where('email', 'geo-manager-qa@example.invalid')->firstOrFail();
throw_unless($actor->two_factor_confirmed_at !== null && $actor->two_factor_secret !== null, RuntimeException::class, 'Existing QA geomanager requires confirmed MFA.');
return ['target' => $identity, 'actor_id' => $actor->id, 'mfa_configured' => true, 'active_writes' => 0];
});
file_put_contents($root.'/storage/app/private/investmoz-v2/portal-audit/revision-geo-actor-qa.json', json_encode($proof, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
echo json_encode($proof, JSON_THROW_ON_ERROR).PHP_EOL;