make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();App\Modules\Purchasing\BudgetAdapter::guard(); $n=json_decode(file_get_contents($s['root'].'/native-fixture.json'),true);config(['database.connections.integrated_setup'=>$s['nativeConnection']]);$db=DB::connection('integrated_setup');$counts=[]; foreach(['requisitions','quotations','purchase_awards','purchase_orders','goods_receipts','invoices','budget_consumptions','pa_proposals','pa_obligations','external_payments']as$t){$counts[$t]=$db->table($t)->where('tenant_id',$n['tenant'])->count();if($counts[$t]!==0)throw new LogicException('Integrated main book must start empty: '.$t);} if((int)$db->table('budget_entries')->where('tenant_id',$n['tenant'])->sum('reserved_minor')!==0||(int)$db->table('budget_entries')->where('tenant_id',$n['tenant'])->sum('committed_minor')!==0)throw new LogicException('No main reservation or commitment before request'); foreach(['request','supplier','sourcing','order','geography','invoice','obligation']as$mode)if(!is_file($s['root'].'/'.$mode.'-baseline.json'))throw new LogicException('Composition missing '.$mode); file_put_contents($s['root'].'/integrated-baseline.json',json_encode(['passed'=>true,'main_counts'=>$counts,'native_reserved_minor'=>0,'native_committed_minor'=>0,'prepared_suppliers'=>3,'geography_rows'=>DB::table('geo_territories')->count(),'automatic_localisations'=>DB::table('geo_locations')->count(),'new_permission_names'=>[],'same_native_book'=>true,'previous_fixtures_upgraded'=>false,'visual_review'=>false],JSON_PRETTY_PRINT|JSON_THROW_ON_ERROR));