make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap(); \App\Modules\Workshop\WorkshopCorrections::guard();$in=json_decode(stream_get_contents(STDIN),true,32,JSON_THROW_ON_ERROR);app(\App\Shared\Context\CompanyContext::class)->selectFor($in['actor'],$in['tenant'],$in['company'],$in['unit']); if($in['pause']??false){$paused=false;\Illuminate\Support\Facades\DB::listen(function($q)use(&$paused){if(!$paused&&str_contains($q->sql,'"companies"')&&str_contains($q->sql,'for update')){$paused=true;echo "LOCK_HELD\n";flush();usleep(1200000);}});} try{$out=$in['method']==='b1'?app(\App\Modules\Services\InternalConfirmation::class)->confirm($in['input']['billing_id'],$in['actor'],1,$in['key']):app(\App\Modules\Workshop\WorkshopCorrections::class)->{$in['method']}($in['generation'],$in['actor'],$in['input'],$in['key']);echo json_encode(['status'=>200,'result'=>$out],JSON_THROW_ON_ERROR).PHP_EOL;} catch(\Symfony\Component\HttpKernel\Exception\HttpExceptionInterface $e){echo json_encode(['status'=>$e->getStatusCode()],JSON_THROW_ON_ERROR).PHP_EOL;}