name('home'); Route::get('/', [PortalServicesController::class, 'home'])->name('home'); foreach (['sectores' => 'sectors', 'como-investir' => 'procedures', 'legislacao' => 'legislation', 'documentos' => 'documents', 'apoio' => 'support', 'parcerias' => 'partnerships', 'simulador-fiscal' => 'simulator', 'formularios/investidor' => 'investor', 'formularios/empresa' => 'company'] as $path => $page) { Route::get('/'.$path, [PortalServicesController::class, 'page'])->defaults('page', $page)->name('services.'.$page); } Route::get('/documentos/{id}/download', [PortalServicesController::class, 'download'])->whereNumber('id')->name('services.download'); Route::post('/apoio', [PortalServicesController::class, 'submit'])->middleware('throttle:10,1')->name('services.submit'); Route::middleware(['auth', 'verified'])->group(function () { Route::get('/balcao-virtual', [PortalServicesController::class, 'page'])->defaults('page', 'desk')->name('services.desk'); Route::post('/parcerias', [PortalServicesController::class, 'partnership'])->middleware('throttle:10,1')->name('services.partnership'); }); Route::middleware(['auth', 'verified', 'can:manage-portal'])->group(function () { Route::get('/management/portal-services', [PortalServicesController::class, 'manage'])->name('services.manage'); Route::post('/management/portal-services/upload', [PortalServicesController::class, 'upload'])->middleware('throttle:10,1')->name('services.upload'); Route::post('/management/portal-services/resources', [PortalServicesController::class, 'resource'])->name('services.resource'); Route::post('/management/portal-services/{type}/{id}', [PortalServicesController::class, 'moderate'])->whereIn('type', ['resources', 'partnerships'])->whereNumber('id')->name('services.moderate'); }); Route::get('/carteira', [InvestmentPortfolioController::class, 'index'])->name('portfolio.index'); Route::get('/carteira/{id}', [InvestmentPortfolioController::class, 'show'])->whereUuid('id')->name('portfolio.show'); Route::get('/oportunidades', [InvestmentDiscoveryController::class, 'index'])->name('portal.opportunities'); Route::get('/oportunidades/{slug}', [InvestmentDiscoveryController::class, 'detail'])->name('portal.opportunity'); Route::get('/sectores/{slug}', [PublicPortalController::class, 'sector'])->name('portal.sector'); Route::get('/manifestar-interesse/{slug?}', [PublicPortalController::class, 'interest'])->name('portal.interest'); Route::get('/acesso-gestao', fn () => Inertia::render('management-access', [ 'registrationEnabled' => Features::enabled(Features::registration()), ]))->name('management.access'); Route::middleware(['auth', 'verified'])->group(function () { Route::get('/investidor', [InvestorWorkspaceController::class, 'index'])->name('investor.workspace'); Route::post('/investidor/guardar/{id}', [InvestorWorkspaceController::class, 'start'])->whereUuid('id')->name('investor.start'); Route::post('/investidor/{id}/interesse', [InvestorWorkspaceController::class, 'submit'])->whereUuid('id')->middleware('throttle:10,1')->name('investor.submit'); Route::get('dashboard', DashboardController::class)->name('dashboard'); }); require __DIR__.'/settings.php'; require __DIR__.'/investment.php'; Route::middleware(['auth', 'verified', 'can:manage-portal', AiEnabled::class])->group(function () { Route::get('/management/ai', [AiController::class, 'index'])->name('ai.index'); Route::get('/management/ai/runs/{id}', [AiController::class, 'show'])->whereUuid('id')->name('ai.show'); foreach (['api/v1/ai', 'management/ai'] as $prefix) { Route::post($prefix.'/controls/{capability}', [AiController::class, 'control']); Route::prefix($prefix)->middleware('throttle:20,1')->group(function () { Route::post('runs', [AiController::class, 'run']); Route::get('runs/{id}', [AiController::class, 'show'])->whereUuid('id'); Route::post('runs/{id}/feedback', [AiController::class, 'feedback'])->whereUuid('id'); Route::post('runs/{id}/review', [AiController::class, 'review'])->whereUuid('id'); Route::post('sources', [AiController::class, 'source']); Route::post('documents', [AiController::class, 'document']); Route::post('sources/{id}/review', [AiController::class, 'reviewSource'])->whereUuid('id'); }); } }); Route::get('/api/v1/investment/territory-options', [PublicGeographyController::class, 'options'])->middleware('throttle:api'); Route::middleware(['auth', 'verified', 'can:manage-portal'])->prefix('management')->name('management.')->group(function () { Route::get('opportunities/{id}/coordinates', [InvestmentCoordinatesController::class, 'show'])->whereNumber('id'); Route::post('opportunities/{id}/coordinates', [InvestmentCoordinatesController::class, 'save'])->whereNumber('id'); Route::get('territory-options', [InvestmentTerritoryController::class, 'options'])->middleware('throttle:api'); Route::get('territory-subjects', [InvestmentTerritoryController::class, 'subjects'])->middleware('throttle:api'); Route::get('territory-associations', fn () => Inertia::render('management/territory-associations')); Route::get('territories/{kind}/{id}', [InvestmentTerritoryController::class, 'show']); Route::post('territories/{kind}/{id}', [InvestmentTerritoryController::class, 'save']); $controller = PortalManagementController::class; Route::prefix('education')->name('education.')->middleware(EducationEnabled::class)->group(function () { Route::get('/', [EducationController::class, 'index'])->name('index'); Route::post('catalog/{kind}', [EducationController::class, 'catalog'])->whereIn('kind', ['skills', 'occupations', 'providers', 'courses'])->name('catalog'); Route::post('{kind}', [EducationController::class, 'store'])->whereIn('kind', ['demands', 'capacities'])->name('store'); Route::post('{kind}/{id}/review', [EducationController::class, 'review'])->whereIn('kind', ['demands', 'capacities'])->whereUuid('id')->name('review'); Route::get('demands/{id}/analysis', [EducationController::class, 'analysis'])->whereUuid('id')->name('analysis'); Route::post('demands/{id}/investment', [EducationInvestmentController::class, 'store'])->whereUuid('id')->name('investment'); }); Route::get('portfolio', [InvestmentPortfolioController::class, 'index'])->name('portfolio.index'); Route::get('portfolio/{id}', [InvestmentPortfolioController::class, 'show'])->whereUuid('id')->name('portfolio.show'); Route::put('portfolio/{dossier}', [InvestmentPortfolioController::class, 'save'])->name('portfolio.save'); Route::post('portfolio/{dossier}/publish', [InvestmentPortfolioController::class, 'publish'])->name('portfolio.publish'); Route::post('clusters/{cluster}/chain-links', [ClusterValueChainController::class, 'link'])->name('clusters.chain-links.store'); Route::delete('clusters/{cluster}/chain-links/{link}', [ClusterValueChainController::class, 'removeLink'])->name('clusters.chain-links.delete'); Route::post('clusters/{cluster}/gaps', [ClusterValueChainController::class, 'gap'])->name('clusters.gaps.store'); Route::put('clusters/{cluster}/gaps/{gap}', [ClusterValueChainController::class, 'gap'])->name('clusters.gaps.update'); Route::get('{structure}', [InvestmentStructureController::class, 'index'])->whereIn('structure', ['projects', 'clusters'])->name('structures.index'); Route::get('{structure}/create', [InvestmentStructureController::class, 'edit'])->whereIn('structure', ['projects', 'clusters'])->name('structures.create'); Route::get('{structure}/{id}/edit', [InvestmentStructureController::class, 'edit'])->whereIn('structure', ['projects', 'clusters'])->whereUuid('id')->name('structures.edit'); Route::post('{structure}', [InvestmentStructureController::class, 'save'])->whereIn('structure', ['projects', 'clusters'])->name('structures.store'); Route::put('{structure}/{id}', [InvestmentStructureController::class, 'save'])->whereIn('structure', ['projects', 'clusters'])->whereUuid('id')->name('structures.update'); Route::post('clusters/{cluster}/projects', [InvestmentStructureController::class, 'linkProject'])->name('clusters.projects'); Route::post('clusters/{cluster}/chains', [InvestmentStructureController::class, 'saveChain'])->name('clusters.chains.store'); Route::put('clusters/{cluster}/chains/{chain}', [InvestmentStructureController::class, 'saveChain'])->name('clusters.chains.update'); Route::get('crm/investors', [CrmController::class, 'investors'])->name('crm.investors'); Route::get('crm/investors/{investor}', [CrmController::class, 'investor'])->name('crm.investor'); Route::patch('crm/investors/{investor}', [CrmController::class, 'saveInvestor'])->name('crm.investor-update'); Route::patch('crm/investors/{investor}/contacts/{contact}', [CrmController::class, 'saveContact'])->name('crm.contact-update'); Route::get('crm/leads', [CrmController::class, 'index'])->name('crm.leads'); Route::get('crm/convert/{interest}', [CrmController::class, 'prepare'])->name('crm.prepare'); Route::post('crm/convert/{interest}', [CrmController::class, 'convert'])->name('crm.convert'); Route::get('crm/leads/{lead}', [CrmController::class, 'show'])->name('crm.lead'); Route::patch('crm/leads/{lead}', [CrmController::class, 'update'])->name('crm.update'); Route::post('crm/leads/{lead}/tasks', [CrmController::class, 'task'])->name('crm.tasks'); Route::patch('crm/leads/{lead}/tasks/{task}', [CrmController::class, 'updateTask'])->name('crm.task-update'); Route::get('history', [$controller, 'history'])->name('history'); Route::get('interests', [$controller, 'interests'])->name('interests'); Route::get('interests/{interest}', [$controller, 'interest'])->name('interest'); Route::patch('interests/{interest}', [$controller, 'review'])->name('review'); Route::get('{resource}', [$controller, 'catalog'])->whereIn('resource', ['sectors', 'opportunities'])->name('catalog'); Route::get('{resource}/create', [$controller, 'edit'])->whereIn('resource', ['sectors', 'opportunities'])->name('create'); Route::get('{resource}/{id}/edit', [$controller, 'edit'])->whereIn('resource', ['sectors', 'opportunities'])->whereNumber('id')->name('edit'); Route::post('{resource}', [$controller, 'save'])->whereIn('resource', ['sectors', 'opportunities'])->name('store'); Route::put('{resource}/{id}', [$controller, 'save'])->whereIn('resource', ['sectors', 'opportunities'])->whereNumber('id')->name('update'); }); // Serialize management requests for the same session so background dropdown/coordinate // reads cannot overwrite validation feedback from a concurrent form submission. foreach (Route::getRoutes()->getRoutes() as $managementRoute) { if (str_starts_with($managementRoute->uri(), 'management/')) { $managementRoute->block(10, 10); } }