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

23 lines
1.7 KiB
PHP

<?php
use Illuminate\Contracts\Console\Kernel;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
require dirname(__DIR__).'/vendor/autoload.php';
require __DIR__.'/portal-qa-environment.php';
$target = portalQaEnvironment();
$app = require dirname(__DIR__).'/bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
portalQaAssertTarget($target);
$name = '2026_10_09_190000_prepare_investor_path';
$columns = ['investor_journeys.path_definition_id' => Schema::hasColumn('investor_journeys', 'path_definition_id'), 'journey_steps.path_detail' => Schema::hasColumn('journey_steps', 'path_detail')];
$definitions = DB::table('questionnaire_versions')->where('code', 'investor-path-19')->get(['id', 'status', 'schema_snapshot'])->map(fn ($r) => ['id' => $r->id, 'status' => $r->status, 'sha256' => hash('sha256', $r->schema_snapshot)])->all();
$proof = ['captured_at' => gmdate('c'), 'target' => $target, 'active_writes' => 0, 'migration' => $name,
'ledger' => DB::table('migrations')->where('migration', $name)->exists(), 'columns' => $columns, 'definitions' => $definitions,
'resources_030000' => DB::table('migrations')->where('migration', '2026_10_09_030000_extend_opportunity_resources')->exists(),
'profiles_040000' => DB::table('migrations')->where('migration', '2026_10_10_040000_create_portal_profile_authorization')->exists(),
'authorities' => DB::table('authorities')->where('status', 'published')->get(['id', 'label_pt_mz'])->all()];
file_put_contents(dirname(__DIR__).'/storage/app/private/investmoz-v2/portal-audit/opportunity-semantic-environment-qa.json', json_encode($proof, JSON_PRETTY_PRINT | JSON_THROW_ON_ERROR));
echo json_encode($proof, JSON_THROW_ON_ERROR);