}
''');p.write_text(s,'utf-8')
change('resources/js/layouts/portal-navigation.tsx',"import { JourneyCompanion } from '@/components/journey-companion';","import { NavigationContextProvider, NavigationContextSummary } from '@/components/navigation-context';")
change('resources/js/layouts/portal-navigation.tsx'," 'portal/',"," 'qa/',\n 'portal/',")
change('resources/js/layouts/portal-navigation.tsx','','')
change('resources/js/layouts/portal-navigation.tsx','','')
change('resources/js/layouts/portal-navigation.tsx','','')
# A public prototype controller supplies only the same published masters; all dossier reads use the existing authorized endpoint.
p=qa/'routes/web.php';s=p.read_text('utf-8');s+='''
// QA-only navigation preview; no business write route and no new permissions.
if (app()->environment('testing') && config('database.connections.pgsql.host') === '127.0.0.1' && (int) config('database.connections.pgsql.port') === 55441 && str_ends_with(config('database.connections.pgsql.database'), '_test')) {
Route::get('/qa/navegacao', function (\\Illuminate\\Http\\Request $request) {
$input=$request->validate(['area'=>'nullable|in:inicio,porque,licenciamento', 'entrada'=>'nullable|in:ideia,oportunidade,sector,localizacao', 'context'=>'nullable|uuid']);
$sources=[];
foreach(\\App\\Models\\Opportunity::published()->with('sector:id,name,slug')->orderBy('title')->get() as $o){
$values=['title'=>$o->title];if($o->sector){$values['sector']=$o->sector->name;}
if($o->province){$values['province']=$o->province;}if($o->district){$values['district']=$o->district;}
$sources[]=['key'=>'opportunity:'.$o->id,'kind'=>'oportunidade','title'=>$o->title,'href'=>'/oportunidades/'.$o->slug,'version'=>$o->version_no ?? $o->updated_at?->toIso8601String(),'values'=>$values];
}
foreach(\\App\\Models\\Sector::where('is_active',true)->orderBy('name')->get() as $s){$sources[]=['key'=>'sector:'.$s->id,'kind'=>'sector','title'=>$s->name,'href'=>'/sectores/'.$s->slug,'version'=>$s->updated_at?->toIso8601String(),'values'=>['sector'=>$s->name]];}
foreach(app(\\App\\Services\\InvestmentZones::class)->visible()->where('category','industrial_park')->orderBy('name')->get() as $z){$sources[]=['key'=>'zone:'.$z->id,'kind'=>'localizacao','title'=>$z->name,'href'=>'/zonas/'.$z->id,'version'=>$z->version_no,'values'=>['province'=>$z->province ?? '', 'district'=>$z->district ?? '']];}
return Inertia::render('qa/navigation',['sources'=>$sources,'area'=>$input['area'] ?? 'inicio']);
});
}
''';p.write_text(s,'utf-8')
print('QA navigation shell/context and prototype route prepared; no business mutation added')