Files
SGF/scripts/workshop-corrections-fixture.php
T
2026-10-29 18:43:29 +02:00

9 lines
1.4 KiB
PHP

<?php
require __DIR__.'/../vendor/autoload.php';$app=require __DIR__.'/../bootstrap/app.php';$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
\App\Modules\Workshop\WorkshopCorrections::guard();$path='C:/laragon/data/sgf-tempo/secrets/browser-fixture.json';$base=json_decode(file_get_contents($path),true,32,JSON_THROW_ON_ERROR);
if(\Illuminate\Support\Facades\DB::table('wo_orders')->exists())throw new RuntimeException('Fresh synthetic workshop required; nothing deleted.');
$f=\Tests\Support\WorkshopCorrectionFixture::create($base+['manager'=>\App\Models\User::findOrFail($base['manager_id']),'reader'=>\App\Models\User::findOrFail($base['reader_id'])]);
file_put_contents($path,json_encode($base+['workshop_corrections'=>array_intersect_key($f,array_flip(['order','time','material','service','client','generation','service_draft','billing_draft']))],JSON_THROW_ON_ERROR));
file_put_contents('C:/laragon/data/sgf-tempo/secrets/workshop-corrections-manual-entry.txt',"Synthetic SGF corrections proof only - http://127.0.0.1:8002\r\nPreparer/applicant: gestor@example.test\r\nReviewer: consulta@example.test\r\nTemporary synthetic password for these two accounts: ".$base['password']."\r\nNever paste credentials into chat, captures or reports.\r\n");
echo "Synthetic original 500 MZN prepared through existing workshop conversion with distinct review. No correction, cancellation or correction review prefilled.\n";