Files
SGF/scripts/industrial-cost-fixture.php
T
2026-10-27 13:57:09 +02:00

8 lines
988 B
PHP

<?php
require __DIR__.'/../vendor/autoload.php';$app=require __DIR__.'/../bootstrap/app.php';$app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap();
\App\Modules\Industry\IndustrialCosts::guard();$file='C:/laragon/data/sgf-tempo/secrets/browser-fixture.json';$base=json_decode(file_get_contents($file),true,32,JSON_THROW_ON_ERROR);
if(\Illuminate\Support\Facades\DB::table('ic_lots')->exists())throw new RuntimeException('Fresh synthetic proof required; nothing deleted.');
$f=\Tests\Support\IndustrialCostFixture::create($base+['manager'=>\App\Models\User::findOrFail($base['manager_id']),'reader'=>\App\Models\User::findOrFail($base['reader_id'])],false);
file_put_contents($file,json_encode($base+['industrial'=>array_intersect_key($f,array_flip(['lot','refs','criterionData']))],JSON_THROW_ON_ERROR));
echo "Industrial synthetic lot and seven validated origins/rates prepared; criterion and calculations remain for browser demonstration. No workshop events created.\n";