Compare commits

...
Author SHA1 Message Date
paulomassigue ec4b2f2af2 organizacao da tela inicial 2026-10-23 14:51:34 +02:00
paulomassigue e2b0fb4b2d melhorias de home 1 2026-10-23 10:36:34 +02:00
nala f80d30f478 docs: record Tempo approval for catalogue selector integration
tests / ci (push) Canceled after 0s
2026-10-22 14:36:36 +02:00
nala 916819eb35 docs: record keyboard selector proof and mouse observation limit 2026-10-22 14:33:59 +02:00
nala 1d921c9d03 fix: keep public catalogue selectors independent of opportunity results 2026-10-22 14:28:40 +02:00
nala 7b1c35793c Fix Node navigation import and use Tempo commercial footer contact
tests / ci (push) Canceled after 0s
2026-10-22 13:54:20 +02:00
nala 1ec318561c docs: record authorised Inhambane preparation publication
tests / ci (push) Canceled after 0s
2026-10-22 13:47:50 +02:00
nala 9ac623a433 fix: preserve territorial search across investment catalogues 2026-10-22 12:52:52 +02:00
nala 5f4eb5cfaa Record authorized adaptive path deployment and enabled destination state 2026-10-22 10:18:38 +02:00
nala 042ffbde44 Preserve legacy draft shape when no compatible context is inherited
tests / ci (push) Canceled after 0s
2026-10-22 10:14:46 +02:00
nala 064296e1fb Record current v4 report proof and adaptive path integration dependencies
tests / ci (push) Canceled after 0s
2026-10-22 10:06:08 +02:00
nala a1fbda06ad Wire grounded private investment preparation into QA dossier path 2026-10-22 10:00:23 +02:00
nala 52fbb1468a Close context increment review and ground first adaptive investment path 2026-10-22 09:25:14 +02:00
106 changed files with 6820 additions and 541 deletions
+7
View File
@@ -39,3 +39,10 @@ Referenciar estas orientações nos requisitos correspondentes da matriz existen
- Preservar o ficheiro original, a proveniência, o identificador exacto, a edição/data, o hash e o histórico. Não marcar autenticidade, vigência, direitos ou scan como confirmados sem evidência. - Preservar o ficheiro original, a proveniência, o identificador exacto, a edição/data, o hash e o histórico. Não marcar autenticidade, vigência, direitos ou scan como confirmados sem evidência.
- Para fontes fiscais, inventariar também as fontes não analisadas e os diplomas/artigos sem correspondência documental. Parâmetros ausentes ou ambiguidades permanecem indeterminados; não usar zero nem a taxa mais recente como substituto. - Para fontes fiscais, inventariar também as fontes não analisadas e os diplomas/artigos sem correspondência documental. Parâmetros ausentes ou ambiguidades permanecem indeterminados; não usar zero nem a taxa mais recente como substituto.
- Antes de aplicar mudanças em dados activos, confirmar backup/restauro e a acção autenticada que continua necessária. Testes e migrações devem usar exclusivamente uma base QA isolada com guarda contra a base activa. - Antes de aplicar mudanças em dados activos, confirmar backup/restauro e a acção autenticada que continua necessária. Testes e migrações devem usar exclusivamente uma base QA isolada com guarda contra a base activa.
## Execução das fontes e decisões — orientação permanente da Tempo, 22/10/2026
A legislação, os formulários e os procedimentos oficiais disponibilizados são fontes válidas para implementar os requisitos. As decisões e procedimentos da Tempo orientam a sua utilização no portal. Traduzir essas fontes em campos, regras, documentos, cálculos e percursos executáveis com rastreabilidade, sem exigir nova validação jurídica genérica ou criar aprovadores, restrições ou condições por interpretação do Codex.
Uma divergência concreta deve identificar os trechos, períodos e comportamento afectados; prosseguir com os restantes requisitos. Uma decisão de implementação em falta deve ser apresentada especificamente à Tempo, sem a substituir por regra inventada. Rever e remover bloqueios anteriores sem fundamento numa fonte aplicável ou decisão expressa da Tempo, preservando dados e histórico. A rastreabilidade explica a execução e não constitui uma autoridade adicional. Mantêm-se os limites autorizados de QA e das alterações no activo.
+19 -19
View File
@@ -231,16 +231,25 @@ class InvestmentCatalogue
} elseif (in_array($relation, ['clusters', 'corridors'], true)) { } elseif (in_array($relation, ['clusters', 'corridors'], true)) {
$query->whereIn('id', $this->publicStructureIds($relation, $foreign)); $query->whereIn('id', $this->publicStructureIds($relation, $foreign));
} else { } else {
$query->whereIn('id', InvestmentPortfolioController::visible()->whereNotNull($foreign)->pluck($foreign)); $query->whereIn('id', app(OpportunityClassification::class)->targets('project')->select('id'));
} }
} }
if (! $management && $path !== [] && $relation !== 'locations') { if (! $management && $path !== [] && $relation !== 'locations') {
$dossiers = InvestmentPortfolioController::visible(); $dossiers = InvestmentPortfolioController::visible();
app(InvestmentGeography::class)->constrainDossiersToTerritories($dossiers, app(InvestmentGeography::class)->constrainDossiersToTerritories($dossiers,
app(InvestmentGeography::class)->descendants($path[array_key_last($path)]->id)); app(InvestmentGeography::class)->descendants($path[array_key_last($path)]->id));
$query->whereIn('id', $dossiers->whereNotNull($foreign)->select($foreign)); $territories = app(InvestmentGeography::class)->descendants($path[array_key_last($path)]->id);
$query->where(fn ($area) => $area->whereIn('primary_territory_id', $territories)
->orWhereIn('id', $dossiers->whereNotNull($foreign)->select($foreign)));
} }
$result[$relation] = $query->orderBy('name')->get(['id', 'name']); $result[$relation] = $query->orderBy('name')->get(['id', 'name']);
if (! $management && $relation !== 'locations') {
$dossiers = InvestmentPortfolioController::visible()->whereIn($foreign, $result[$relation]->pluck('id'))
->orderBy('id')->get(['id', $foreign])->unique($foreign)->keyBy($foreign);
$result[$relation]->each(function ($record) use ($dossiers): void {
$record->url = isset($dossiers[$record->id]) ? '/carteira/'.$dossiers[$record->id]->id : null;
});
}
} }
$zones = app(InvestmentZones::class)->visible(); $zones = app(InvestmentZones::class)->visible();
@@ -250,24 +259,15 @@ class InvestmentCatalogue
['province_id', 'district_id', 'admin_post_id', 'locality_id', 'province', 'district', 'geo_location_id'])); ['province_id', 'district_id', 'admin_post_id', 'locality_id', 'province', 'district', 'geo_location_id']));
} }
$result['zones'] = $zones->orderBy('name')->get(['id', 'name', 'category']); $result['zones'] = $zones->orderBy('name')->get(['id', 'name', 'category']);
if (! $management && ($path !== [] || ! empty($territoryFilters['sector']))) { if (! $management && $path !== []) {
$scope = \Illuminate\Support\Arr::only($territoryFilters, ['sector','province_id','district_id','admin_post_id','locality_id','include_national']); // A chain's documented scope comes from its public cluster, never
$available = ['chain' => [], 'activity' => []]; // from the opportunities surviving the current search.
$this->query($scope)->reorder()->chunkById(200, function ($records) use (&$available) { $ids = app(OpportunityClassification::class)->targets('chain')
foreach ($records as $record) { ->whereIn('cluster_id', $result['clusters']->pluck('id'))->pluck('id');
foreach (app(OpportunityClassification::class)->publicRows($record) as $row) { $result['classification']['targets']['chain'] = collect($result['classification']['targets']['chain'])->whereIn('id', $ids)->values();
if (isset($available[$row['target_type']])) $available[$row['target_type']][] = $row['target_id'];
}
foreach (['subsector_id','economic_activity_id'] as $key) {
$id = $record->workflow_context['publication']['taxonomy'][$key] ?? null;
if ($id) $available['activity'][] = $id;
}
}
}, 'opportunities.id', 'id');
foreach ($available as $kind => $ids) {
$result['classification']['targets'][$kind] = collect($result['classification']['targets'][$kind])->whereIn('id', $ids)->values();
}
} }
// Activities are a public classification catalogue, not evidence of
// investment availability in a territory or sector.
return $result; return $result;
} }
+54 -12
View File
@@ -13,6 +13,7 @@ use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Illuminate\Validation\Rule;
use Symfony\Component\HttpKernel\Exception\HttpException; use Symfony\Component\HttpKernel\Exception\HttpException;
/** Context belongs to the existing encrypted dossier. Sources remain read-only. */ /** Context belongs to the existing encrypted dossier. Sources remain read-only. */
@@ -22,7 +23,7 @@ final class InvestorContext
public const SOURCE = 'investor-context'; public const SOURCE = 'investor-context';
public const FIELDS = ['project_title', 'project_summary', 'sector_id', 'sector', 'province_id', 'district_id', 'admin_post_id', 'locality_id', 'province', 'district', 'location', 'currency', 'expected_start_date', 'fiscal_period', 'fiscal_periodicity', 'fiscal_month', 'investor_origin', 'person_type', 'entity_stage', 'tax_residency_country', 'fiscal_residency_country', 'activity_id', 'project_type', 'maturity_stage', 'special_zone_id', 'investment_regime']; public const FIELDS = ['project_title', 'project_summary', 'sector_id', 'sector', 'province_id', 'district_id', 'admin_post_id', 'locality_id', 'province', 'district', 'location', 'currency', 'expected_start_date', 'fiscal_period', 'fiscal_periodicity', 'fiscal_month', 'investor_origin', 'person_type', 'entity_stage', 'tax_residency_country', 'fiscal_residency_country', 'activity_id', 'project_type', 'maturity_stage', 'special_zone_id', 'investment_regime', ...PrivateInvestmentPreparation::FIELDS];
public function __construct(private readonly VirtualDesk $desk) {} public function __construct(private readonly VirtualDesk $desk) {}
@@ -267,10 +268,20 @@ final class InvestorContext
private function input(array $input): array private function input(array $input): array
{ {
abort_if(array_diff(array_keys($input), ['version', 'selection', 'declarations', 'replace_fields', 'preview_hash', 'operation_key', 'confirm', '_token']), 422, 'Campo de controlo desconhecido.'); abort_if(array_diff(array_keys($input), ['version', 'selection', 'declarations', 'replace_fields', 'preview_hash', 'operation_key', 'confirm', 'document_links', '_token']), 422, 'Campo de controlo desconhecido.');
return Validator::make($input, ['version' => 'required|integer|min:1', 'selection' => 'present|array:opportunity,sector,territory,park', abort_if(! app(PrivateInvestmentPreparation::class)->available() && (! empty($input['document_links']) || array_intersect(array_keys(is_array($input['declarations'] ?? null) ? $input['declarations'] : []), PrivateInvestmentPreparation::FIELDS)), 409, 'Esta preparação ainda não está disponível neste ambiente. As respostas foram preservadas.');
'selection.*' => 'nullable|string|max:100', 'declarations' => 'nullable|array:project_title,project_summary,currency,expected_start_date,investor_origin,person_type,entity_stage,tax_residency_country,fiscal_residency_country,project_type,maturity_stage', 'declarations.project_title' => 'nullable|string|max:200', 'declarations.project_summary' => 'nullable|string|max:5000',
$inputRules = [
'document_links' => 'sometimes|array:'.implode(',', PrivateInvestmentPreparation::DOCUMENTS),
'document_links.*' => 'nullable|uuid',
];
foreach (app(PrivateInvestmentPreparation::class)->questions() as $question) {
$inputRules['declarations.'.$question['key']] = isset($question['options']) ? ['nullable', Rule::in(array_keys($question['options']))] : ['nullable', 'regex:/^\d+(?:\.\d+)?$/D', 'numeric', 'min:0', 'max:999999999999999999'];
}
return Validator::make($input, [...$inputRules, 'version' => 'required|integer|min:1', 'selection' => 'present|array:opportunity,sector,territory,park',
'selection.*' => 'nullable|string|max:100', 'declarations' => 'nullable|array:project_title,project_summary,currency,expected_start_date,investor_origin,person_type,entity_stage,tax_residency_country,fiscal_residency_country,project_type,maturity_stage,'.implode(',', PrivateInvestmentPreparation::FIELDS), 'declarations.project_title' => 'nullable|string|max:200', 'declarations.project_summary' => 'nullable|string|max:5000',
'declarations.currency' => 'nullable|regex:/^[A-Z]{3}$/', 'declarations.expected_start_date' => 'nullable|date_format:Y-m-d', 'declarations.investor_origin' => 'nullable|in:national,foreign,mixed', 'declarations.person_type' => 'nullable|in:singular,collective,sole_trader,consortium', 'declarations.entity_stage' => 'nullable|in:existing,being_formed', 'declarations.tax_residency_country' => ['nullable', 'string', app(CountryCatalogue::class)->rule()], 'declarations.fiscal_residency_country' => ['nullable', 'string', app(CountryCatalogue::class)->rule()], 'declarations.project_type' => 'nullable|string|max:100', 'declarations.maturity_stage' => 'nullable|string|max:100', 'declarations.currency' => 'nullable|regex:/^[A-Z]{3}$/', 'declarations.expected_start_date' => 'nullable|date_format:Y-m-d', 'declarations.investor_origin' => 'nullable|in:national,foreign,mixed', 'declarations.person_type' => 'nullable|in:singular,collective,sole_trader,consortium', 'declarations.entity_stage' => 'nullable|in:existing,being_formed', 'declarations.tax_residency_country' => ['nullable', 'string', app(CountryCatalogue::class)->rule()], 'declarations.fiscal_residency_country' => ['nullable', 'string', app(CountryCatalogue::class)->rule()], 'declarations.project_type' => 'nullable|string|max:100', 'declarations.maturity_stage' => 'nullable|string|max:100',
'replace_fields' => 'nullable|array', 'replace_fields.*' => 'string|in:'.implode(',', self::FIELDS)])->validate(); 'replace_fields' => 'nullable|array', 'replace_fields.*' => 'string|in:'.implode(',', self::FIELDS)])->validate();
} }
@@ -283,6 +294,15 @@ final class InvestorContext
abort_unless((int) $case->version === $data['version'], 409, 'O dossier mudou; recupere a versão atual.'); abort_unless((int) $case->version === $data['version'], 409, 'O dossier mudou; recupere a versão atual.');
app(InvestorPath::class)->view($actor, $id); app(InvestorPath::class)->view($actor, $id);
$old = $this->state($case); $old = $this->state($case);
$links = $old['preparation_documents'] ?? [];
foreach ($data['document_links'] ?? [] as $key => $document) {
if ($document) {
abort_unless(DB::table('desk_documents as l')->join('documents as d', 'd.id', '=', 'l.document_id')->where('l.case_id', $id)->where('d.id', $document)->whereNull('d.deleted_at')->exists(), 422, 'Seleccione um documento já associado a este dossier; os dados anteriores foram preservados.');
$links[$key] = $document;
} else {
unset($links[$key]);
}
}
$selection = $old['selection']; $selection = $old['selection'];
foreach ($data['selection'] as $slot => $key) { foreach ($data['selection'] as $slot => $key) {
if ($key === null || $key === '') { if ($key === null || $key === '') {
@@ -353,16 +373,29 @@ final class InvestorContext
$changedFields = array_column($replaced, 'field'); $changedFields = array_column($replaced, 'field');
$conditionsChanged = (bool) array_intersect($changedFields, array_diff(self::FIELDS, ['project_title', 'project_summary'])); $conditionsChanged = (bool) array_intersect($changedFields, array_diff(self::FIELDS, ['project_title', 'project_summary']));
$dependencyChanged = $this->dependencyHash($old['selection']) !== $this->dependencyHash($selection) || $conditionsChanged; $dependencyChanged = $this->dependencyHash($old['selection']) !== $this->dependencyHash($selection) || $conditionsChanged;
$privateConditionsChanged = (bool) array_intersect($changedFields, PrivateInvestmentPreparation::FIELDS);
$calculationInputsChanged = $this->dependencyHash($old['selection']) !== $this->dependencyHash($selection) || (bool) array_intersect($changedFields, array_diff(self::FIELDS, ['project_title', 'project_summary', ...array_diff(PrivateInvestmentPreparation::FIELDS, ['total_investment', 'area_required', 'area_unit'])]));
$payload = $this->desk->decode($case->payload); $payload = $this->desk->decode($case->payload);
$results = $payload['investor_path']['results'] ?? []; $results = $payload['investor_path']['results'] ?? [];
$requests = DB::table('desk_requests')->where('case_id', $id)->orderBy('id')->get(['id', 'status', 'protocol', 'version'])->all(); $requests = DB::table('desk_requests')->where('case_id', $id)->orderBy('id')->get(['id', 'status', 'protocol', 'version'])->all();
$steps = $dependencyChanged ? array_values(array_unique([...(array_intersect($changed, ['opportunity', 'sector']) ? ['S02', 'S03', 'S04', 'S08', 'S12', 'S13', 'S14', 'S15', 'S17'] : []), ...(array_intersect($changed, ['territory', 'park']) ? ['S08', 'S09', 'S10', 'S11', 'S17'] : [])])) : []; $steps = $dependencyChanged ? array_values(array_unique([...(array_intersect($changed, ['opportunity', 'sector']) ? ['S02', 'S03', 'S04', 'S08', 'S12', 'S13', 'S14', 'S15', 'S17'] : []), ...(array_intersect($changed, ['territory', 'park']) ? ['S08', 'S09', 'S10', 'S11', 'S17'] : [])])) : [];
if ($conditionsChanged) { if (array_intersect($changedFields, array_diff(self::FIELDS, ['project_title', 'project_summary', ...PrivateInvestmentPreparation::FIELDS]))) {
$steps = array_values(array_unique([...$steps, 'S02', 'S03', 'S08', 'S12', 'S13', 'S17'])); $steps = array_values(array_unique([...$steps, 'S02', 'S03', 'S08', 'S12', 'S13', 'S17']));
} }
if ($privateConditionsChanged) {
$steps = array_values(array_unique([...$steps, 'S02', 'S05', 'S06', 'S07']));
}
$privatePreparation = null;
if (app(PrivateInvestmentPreparation::class)->available()) {
$docs = $this->preparationDocuments($id);
$beforePreparation = app(PrivateInvestmentPreparation::class)->assess($old, $docs);
$afterPreparation = app(PrivateInvestmentPreparation::class)->assess(['fields' => $fields, 'selection' => $selection, 'preparation_documents' => $links], $docs);
$privatePreparation = ['before' => $beforePreparation, 'after' => $afterPreparation];
}
$plan = ['case_id' => $id, 'version' => (int) $case->version, 'revision' => (int) $old['revision'], 'selection' => $selection, 'fields' => $fields, 'provenance' => $provenance, $plan = ['case_id' => $id, 'version' => (int) $case->version, 'revision' => (int) $old['revision'], 'selection' => $selection, 'fields' => $fields, 'provenance' => $provenance,
'updated' => $replaced, 'maintained' => $kept, 'changed_dimensions' => $changed, 'dependent_results' => (int) $case->user_id === $actor->id && $dependencyChanged ? array_map(fn ($r) => ['id' => $r['id'], 'engine' => $r['engine']], $results) : [], 'preparation_documents' => $links, 'private_investment' => $privatePreparation,
'requests' => $requests, 'review_steps' => $steps, 'dependency_changed' => $dependencyChanged, 'documents_preserved' => DB::table('desk_documents')->where('case_id', $id)->count(), 'updated' => $replaced, 'maintained' => $kept, 'changed_dimensions' => $changed, 'dependent_results' => (int) $case->user_id === $actor->id && $calculationInputsChanged ? array_map(fn ($r) => ['id' => $r['id'], 'engine' => $r['engine']], $results) : [],
'requests' => $requests, 'review_steps' => $steps, 'dependency_changed' => $dependencyChanged, 'calculation_inputs_changed' => $calculationInputsChanged, 'documents_preserved' => DB::table('desk_documents')->where('case_id', $id)->count(),
'notice' => 'Não confirma incentivos, licenças, disponibilidade de terra, reserva ou autorização. Submissões e decisões anteriores mantêm o conteúdo enviado.']; 'notice' => 'Não confirma incentivos, licenças, disponibilidade de terra, reserva ou autorização. Submissões e decisões anteriores mantêm o conteúdo enviado.'];
$hash = hash_hmac('sha256', json_encode(Arr::sortRecursive([$actor->id, $data, $plan]), JSON_THROW_ON_ERROR), config('app.key')); $hash = hash_hmac('sha256', json_encode(Arr::sortRecursive([$actor->id, $data, $plan]), JSON_THROW_ON_ERROR), config('app.key'));
@@ -390,7 +423,7 @@ final class InvestorContext
$before = $this->state($case); $before = $this->state($case);
$plan = $this->preview($actor, $id, $input); $plan = $this->preview($actor, $id, $input);
abort_unless(hash_equals($plan['preview_hash'], $control['preview_hash']), 409, 'O dossier ou uma fonte mudou desde a prévia; compare novamente.'); abort_unless(hash_equals($plan['preview_hash'], $control['preview_hash']), 409, 'O dossier ou uma fonte mudou desde a prévia; compare novamente.');
if (! $plan['changed_dimensions'] && ! $plan['updated'] && empty($input['declarations']) && empty($input['replace_fields'])) { if (! $plan['changed_dimensions'] && ! $plan['updated'] && empty($input['declarations']) && empty($input['replace_fields']) && empty($input['document_links'])) {
$result = ['case_id' => $id, 'version' => (int) $case->version, 'revision' => $before['revision'], 'changed' => false, 'replayed' => false]; $result = ['case_id' => $id, 'version' => (int) $case->version, 'revision' => $before['revision'], 'changed' => false, 'replayed' => false];
DB::table('audit_events')->insert(['source_system' => self::SOURCE, 'entity_type' => 'desk_cases', 'entity_id' => $id, 'actor_user_id' => $actor->id, 'correlation_id' => $control['operation_key'], 'action' => 'context_unchanged', 'data_classification' => 'restricted', 'after_data' => json_encode(['case_id' => $id, 'request_hash' => $requestHash, 'result' => $result], JSON_THROW_ON_ERROR)]); DB::table('audit_events')->insert(['source_system' => self::SOURCE, 'entity_type' => 'desk_cases', 'entity_id' => $id, 'actor_user_id' => $actor->id, 'correlation_id' => $control['operation_key'], 'action' => 'context_unchanged', 'data_classification' => 'restricted', 'after_data' => json_encode(['case_id' => $id, 'request_hash' => $requestHash, 'result' => $result], JSON_THROW_ON_ERROR)]);
@@ -402,9 +435,9 @@ final class InvestorContext
foreach ($plan['review_steps'] as $step) { foreach ($plan['review_steps'] as $step) {
$review[$step] = ['revision' => $revision, 'reason' => 'O contexto mudou; reveja os pressupostos e a evidência aplicável.']; $review[$step] = ['revision' => $revision, 'reason' => 'O contexto mudou; reveja os pressupostos e a evidência aplicável.'];
} }
$context = ['revision' => $revision, 'selection' => $plan['selection'], 'fields' => $plan['fields'], 'provenance' => $plan['provenance'], 'review_steps' => $review, $context = ['preparation_documents' => $plan['preparation_documents'], 'preparation_snapshot' => $plan['private_investment']['after'] ?? $before['preparation_snapshot'] ?? null, 'revision' => $revision, 'selection' => $plan['selection'], 'fields' => $plan['fields'], 'provenance' => $plan['provenance'], 'review_steps' => $review,
'dependency_hash' => $this->dependencyHash(['selection' => $plan['selection'], 'fields' => Arr::except($plan['fields'], ['project_title', 'project_summary'])]), 'updated_at' => now()->toIso8601String(), 'updated_by' => $actor->id]; 'dependency_hash' => $this->dependencyHash(['selection' => $plan['selection'], 'fields' => Arr::except($plan['fields'], ['project_title', 'project_summary'])]), 'updated_at' => now()->toIso8601String(), 'updated_by' => $actor->id];
if ($plan['dependency_changed']) { if ($plan['calculation_inputs_changed']) {
foreach ($payload['investor_path']['results'] ?? [] as $i => $r) { foreach ($payload['investor_path']['results'] ?? [] as $i => $r) {
$payload['investor_path']['results'][$i] = [...$r, 'context_state' => 'review_required', 'context_invalidated_revision' => $revision, 'context_invalidated_at' => now()->toIso8601String()]; $payload['investor_path']['results'][$i] = [...$r, 'context_state' => 'review_required', 'context_invalidated_revision' => $revision, 'context_invalidated_at' => now()->toIso8601String()];
} }
@@ -439,21 +472,30 @@ final class InvestorContext
} }
} }
return ['simulator_context_revision' => $simulatorRevision, 'case' => $path['case'], 'context' => $ctx, 'steps' => array_map(fn ($s) => Arr::only($s, ['code', 'title', 'state', 'context_review_required']), $path['steps']), $preparation = app(PrivateInvestmentPreparation::class)->available() ? app(PrivateInvestmentPreparation::class)->assess($ctx, $this->preparationDocuments($id)) : null;
$ctx['preparation_assessment'] = $preparation;
return ['private_investment' => $preparation, 'preparation_documents' => $this->preparationDocuments($id), 'simulator_context_revision' => $simulatorRevision, 'case' => $path['case'], 'context' => $ctx, 'steps' => array_map(fn ($s) => Arr::only($s, ['code', 'title', 'state', 'context_review_required']), $path['steps']),
'can_write' => $path['canWrite'], 'next' => $path['next'], 'results' => $path['results'], 'requests' => $path['requests'], 'can_write' => $path['canWrite'], 'next' => $path['next'], 'results' => $path['results'], 'requests' => $path['requests'],
'prefill' => $this->prefill($ctx), 'notice' => 'A seleção apoia a preparação e não confirma benefícios, licenças, direitos ou disponibilidade.']; 'prefill' => $this->prefill($ctx), 'notice' => 'A seleção apoia a preparação e não confirma benefícios, licenças, direitos ou disponibilidade.'];
} }
public function preparationDocuments(string $id): array
{
return DB::table('desk_documents as l')->join('documents as d', 'd.id', '=', 'l.document_id')->where('l.case_id', $id)->whereNull('d.deleted_at')->get(['l.id', 'l.document_id', 'd.file_name', 'd.status', 'd.malware_scan_status', 'd.version_no', 'd.sha256'])->map(fn ($row) => (array) $row)->all();
}
public function prefill(array $ctx): array public function prefill(array $ctx): array
{ {
$f = $ctx['fields']; $f = $ctx['fields'];
$sim = Arr::except(Arr::only($f, self::FIELDS), ['sector', 'province', 'district', 'location']); $sim = Arr::except(Arr::only($f, self::FIELDS), ['sector', 'province', 'district', 'location', ...array_diff(PrivateInvestmentPreparation::FIELDS, ['total_investment', 'area_required', 'area_unit'])]);
$zone = $ctx['selection']['park'] ?? null; $zone = $ctx['selection']['park'] ?? null;
$sim['context_applicability_snapshot'] = json_encode([ $sim['context_applicability_snapshot'] = json_encode([
'version' => 1, 'context_revision' => $ctx['revision'], 'version' => 1, 'context_revision' => $ctx['revision'],
'zone' => $zone ? Arr::only($zone, ['id', 'title', 'href', 'version', 'sha256', 'fields', 'analysis']) : null, 'zone' => $zone ? Arr::only($zone, ['id', 'title', 'href', 'version', 'sha256', 'fields', 'analysis']) : null,
'provenance' => $ctx['provenance'], 'provenance' => $ctx['provenance'],
'path' => $ctx['path_applicability'] ?? null, 'path' => $ctx['path_applicability'] ?? null,
'preparation' => isset($ctx['preparation_assessment']) ? Arr::except($ctx['preparation_assessment'], ['questions']) : null,
'fields' => Arr::only($f, ['investor_origin', 'tax_residency_country', 'entity_stage', 'currency', 'expected_start_date', 'investment_regime']), 'fields' => Arr::only($f, ['investor_origin', 'tax_residency_country', 'entity_stage', 'currency', 'expected_start_date', 'investment_regime']),
'notice' => 'Referências e declarações para preparação; sem reconhecimento automático de elegibilidade ou benefício.', 'notice' => 'Referências e declarações para preparação; sem reconhecimento automático de elegibilidade ou benefício.',
], JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE); ], JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE);
+8 -3
View File
@@ -136,7 +136,7 @@ final class InvestorPath
$documents = DB::table('desk_documents as l')->join('documents as d', 'd.id', '=', 'l.document_id') $documents = DB::table('desk_documents as l')->join('documents as d', 'd.id', '=', 'l.document_id')
->where('l.case_id', $id)->whereNull('d.deleted_at') ->where('l.case_id', $id)->whereNull('d.deleted_at')
->when(! $owner && ! $manager, fn ($q) => $q->where(fn ($p) => $p->whereNull('l.request_id')->orWhereIn('l.request_id', $requests->pluck('id')))) ->when(! $owner && ! $manager, fn ($q) => $q->where(fn ($p) => $p->whereNull('l.request_id')->orWhereIn('l.request_id', $requests->pluck('id'))))
->get(['l.id', 'l.document_id', 'd.file_name', 'd.status', 'd.malware_scan_status']); ->get(['l.id', 'l.document_id', 'd.file_name', 'd.status', 'd.malware_scan_status', 'd.version_no', 'd.sha256']);
// Only the private draft owner can receive the financial snapshot/result. Dossier access alone is insufficient. // Only the private draft owner can receive the financial snapshot/result. Dossier access alone is insufficient.
$results = (int) $case->user_id === $actor->id ? ($path['results'] ?? []) : []; $results = (int) $case->user_id === $actor->id ? ($path['results'] ?? []) : [];
$next = collect($steps)->first(fn ($step) => $step['preparation_allowed'] && ! in_array($step['state'], ['completed', 'approved', 'waiting_external', 'submitted', 'reviewing'], true)); $next = collect($steps)->first(fn ($step) => $step['preparation_allowed'] && ! in_array($step['state'], ['completed', 'approved', 'waiting_external', 'submitted', 'reviewing'], true));
@@ -145,12 +145,17 @@ final class InvestorPath
? LandAssistanceCase::where('user_id', $actor->id)->latest('updated_at')->get() ? LandAssistanceCase::where('user_id', $actor->id)->latest('updated_at')->get()
->first(fn ($land) => ($land->payload['investor_path_case_id'] ?? null) === $id) : null; ->first(fn ($land) => ($land->payload['investor_path_case_id'] ?? null) === $id) : null;
return ['case' => ['id' => $id, 'title' => $case->title, 'version' => $case->version, 'closed' => $case->closed_at !== null], $preparation = ($owner || $manager) && app(PrivateInvestmentPreparation::class)->available() ? app(PrivateInvestmentPreparation::class)->assess($context, $documents->map(fn ($d) => (array) $d)->all()) : null;
if ($preparation && $preparation['enabled']) {
$next = ['code' => 'S06', 'title' => $preparation['next'], 'action' => 'Preparar', 'href' => '/investimentos/'.$id.'/contexto/editar#preparation-questions'];
}
return ['private_investment' => $preparation, 'case' => ['id' => $id, 'title' => $case->title, 'version' => $case->version, 'closed' => $case->closed_at !== null],
'journey_id' => $journey->id, 'definition_id' => $version->id, 'definition_version' => $version->version_no, 'source_sha256' => $definition['source_sha256'], 'journey_id' => $journey->id, 'definition_id' => $version->id, 'definition_version' => $version->version_no, 'source_sha256' => $definition['source_sha256'],
'phases' => $definition['phases'], 'steps' => $steps, 'facts' => $facts, 'fact_reasons' => $path['fact_reasons'] ?? [], 'phases' => $definition['phases'], 'steps' => $steps, 'facts' => $facts, 'fact_reasons' => $path['fact_reasons'] ?? [],
'fintech' => ($owner || $manager) && (isset($path['fintech']) || collect($path['sector_contexts'] ?? [])->contains(fn ($s) => in_array($s['slug'], ['fintech', 'tecnologias-de-informacao', 'mercado-financeiro'], true)) || collect($path['content_sources'] ?? [])->contains('return_href', '/tech-fintech')) ? app(FintechInvestment::class)->view($payload, $steps) : null, 'fintech' => ($owner || $manager) && (isset($path['fintech']) || collect($path['sector_contexts'] ?? [])->contains(fn ($s) => in_array($s['slug'], ['fintech', 'tecnologias-de-informacao', 'mercado-financeiro'], true)) || collect($path['content_sources'] ?? [])->contains('return_href', '/tech-fintech')) ? app(FintechInvestment::class)->view($payload, $steps) : null,
'canWrite' => $owner && ! $case->closed_at, 'canReview' => $manager && (int) $case->user_id !== $actor->id && ! $case->closed_at, 'canWrite' => $owner && ! $case->closed_at, 'canReview' => $manager && (int) $case->user_id !== $actor->id && ! $case->closed_at,
'next' => $next ? ['code' => $next['code'], 'title' => $next['title'], 'action' => 'Preparar', 'href' => '#'.$next['code']] : null, 'next' => $next ? ['code' => $next['code'], 'title' => $next['title'], 'action' => 'Preparar', 'href' => $next['href'] ?? '#'.$next['code']] : null,
'investment_context' => ($owner || $manager) ? $context : null, 'investment_context' => ($owner || $manager) ? $context : null,
'results' => $results, 'requests' => $requests, 'documents' => $documents, 'results' => $results, 'requests' => $requests, 'documents' => $documents,
'zone_contexts' => ($owner || $manager) ? ($path['zone_contexts'] ?? []) : [], 'zone_contexts' => ($owner || $manager) ? ($path['zone_contexts'] ?? []) : [],
@@ -0,0 +1,189 @@
<?php
namespace App\Services;
use Brick\Math\BigDecimal;
/** Adapter of the dossier's declared context to preparation of a private-investment request. No tax or entitlement decision. */
final class PrivateInvestmentPreparation
{
public const VERSION = 'private-investment-preparation-2026-v1';
public const SOURCE = 'https://pt.apiex.gov.mz/wp-content/uploads/2025/02/LEGISLACAO-DE-INVESTIMENTOS-EM-MOCAMBIQUE.pdf';
public const HASH = 'ba1e9eaabfec5d0c4cb2d9f2444a6860f7a90f222034764197829be402d408ed';
public const FIELDS = ['investment_form', 'investment_preparation', 'investment_activity_scope', 'implementation_mode', 'capital_origin', 'site_tenure', 'project_concession', 'significant_implications', 'land_extension', 'forest_concession', 'forest_concession_hectares', 'total_investment', 'area_required', 'area_unit'];
public const DOCUMENTS = ['identity', 'registration', 'name_reservation', 'site_plan', 'lease', 'duat', 'representation_license', 'feasibility', 'financial_capacity', 'foreign_capital'];
public function available(): bool
{
return (bool) config('investor-path.private_preparation', false);
}
public function questions(): array
{
$tri = ['unknown' => 'Por determinar', 'yes' => 'Sim', 'no' => 'Não'];
return [
['key' => 'investment_preparation', 'label' => 'Pretende preparar o pedido de garantias/incentivos ao investimento privado?', 'options' => $tri, 'source' => 'Lei 8/2023, artigo 2'],
['key' => 'investment_activity_scope', 'label' => 'Natureza efectiva da actividade do projecto', 'options' => ['unknown' => 'Por determinar', 'general' => 'Outra actividade económica', 'extractive' => 'Prospecção, pesquisa ou produção extractiva', 'processing' => 'Processamento industrial mineiro/petrolífero', 'public_nonprofit' => 'Investimento público ou exclusivamente social/sem fins lucrativos'], 'source' => 'Lei 8/2023, artigos 2 e 22'],
['key' => 'investment_form', 'label' => 'Tipo deste investimento', 'options' => ['unknown' => 'Por determinar', 'direct' => 'Directo', 'indirect' => 'Indirecto'], 'source' => 'Lei 8/2023, artigo 14(b); Regulamento, artigo 13', 'help' => 'O limiar monetário do artigo 13 aplica-se ao investimento directo. A forma indirecta não é convertida silenciosamente em directa.'],
['key' => 'implementation_mode', 'label' => 'Modalidade da empresa implementadora', 'options' => ['unknown' => 'Por determinar', 'domestic_entity' => 'Empresa constituída/em constituição em Moçambique', 'foreign_representation' => 'Representação comercial estrangeira'], 'source' => 'Regulamento 8/2024, artigo 9(2)'],
['key' => 'capital_origin', 'label' => 'Origem dos capitais/recursos deste investimento', 'options' => ['unknown' => 'Por determinar', 'national' => 'Nacionais', 'external' => 'Provenientes do exterior', 'mixed' => 'Mistos'], 'source' => 'Lei 8/2023, glossário; Regulamento, artigos 4–6'],
['key' => 'site_tenure', 'label' => 'Fundamento declarado da utilização das instalações', 'options' => ['unknown' => 'Por determinar', 'lease' => 'Arrendamento', 'duat' => 'DUAT'], 'source' => 'Regulamento, artigos 9(1)(d) e 14(1)(d)'],
['key' => 'project_concession', 'label' => 'O empreendimento é PPP ou concessão empresarial?', 'options' => $tri, 'source' => 'Lei 8/2023, artigo 22(1)(b)(ii)'],
['key' => 'significant_implications', 'label' => 'Existem previsíveis implicações económicas, ambientais, de segurança ou saúde pública que exijam autorização?', 'options' => $tri, 'source' => 'Lei 8/2023, artigo 22(1)(b)(i)', 'help' => 'Declare o enquadramento conhecido; o nome do sector não responde a esta pergunta. Sem fundamento suficiente, mantenha por determinar.'],
['key' => 'land_extension', 'label' => 'O projecto requer extensão de terra?', 'options' => $tri, 'source' => 'Lei 8/2023, artigo 22(1)(b)(iii)'],
['key' => 'forest_concession', 'label' => 'O projecto requer concessão florestal?', 'options' => $tri, 'source' => 'Lei 8/2023, artigo 22(1)(b)(iv)'],
['key' => 'forest_concession_hectares', 'label' => 'Área da concessão florestal (hectares)', 'type' => 'number', 'when' => ['field' => 'forest_concession', 'equals' => 'yes'], 'source' => 'Lei 8/2023, artigo 22(1)(b)(iv)'],
['key' => 'total_investment', 'label' => 'Valor total do investimento na moeda do projecto', 'type' => 'number', 'source' => 'Regulamento, artigo 13(2)'],
['key' => 'area_required', 'label' => 'Área de terra requerida', 'type' => 'number', 'when' => ['field' => 'land_extension', 'equals' => 'yes'], 'source' => 'Lei 8/2023, artigo 22(1)(b)(iii)'],
['key' => 'area_unit', 'label' => 'Unidade da área requerida', 'options' => ['ha' => 'Hectares', 'm2' => 'Metros quadrados'], 'when' => ['field' => 'land_extension', 'equals' => 'yes'], 'source' => 'Conversão de unidade exacta; não é benefício ou condição adicional'],
];
}
private function number(array $f, string $key): ?BigDecimal
{
$value = $f[$key] ?? '';
return is_scalar($value) && preg_match('/^\d+(?:\.\d+)?$/D', (string) $value) ? BigDecimal::of((string) $value) : null;
}
public function assess(array $context, array $documents = []): array
{
$f = $context['fields'] ?? [];
$missing = [];
$answer = function (string $key) use ($f, &$missing): ?bool {
if (! in_array($f[$key] ?? '', ['yes', 'no'], true)) {
$missing[] = $key;
return null;
}
return $f[$key] === 'yes';
};
$enabled = ($f['investment_preparation'] ?? '') === 'yes';
$date = $f['expected_start_date'] ?? '';
$period = preg_match('/^2026-\d{2}-\d{2}$/D', $date) === 1;
$scope = $f['investment_activity_scope'] ?? 'unknown';
$covered = in_array($scope, ['general', 'processing'], true);
$mode = 'indeterminate';
$reasons = [];
if ($enabled) {
if (! $date) {
$missing[] = 'expected_start_date';
}
if ($scope === 'unknown' || $scope === '') {
$missing[] = 'investment_activity_scope';
}
if (empty($f['currency'])) {
$missing[] = 'currency';
}
if ($covered && $period) {
$triggers = [];
if ($scope === 'processing') {
$triggers['processing'] = true;
$reasons[] = 'Processamento industrial mineiro/petrolífero: Lei 8/2023, artigo 22(1)(b)(v).';
}
$amount = $this->number($f, 'total_investment');
$triggers['amount'] = $amount && ($f['currency'] ?? '') === 'MZN' && ($f['investment_form'] ?? '') === 'direct' ? $amount->isGreaterThan('32000000000') : null;
if (! in_array($f['investment_form'] ?? '', ['direct', 'indirect'], true)) {
$missing[] = 'investment_form';
}
if (($f['investment_form'] ?? '') === 'indirect') {
$reasons[] = 'Investimento indirecto: a classificação pela dimensão e o encaminhamento monetário não são determinados por este lote. As restantes condições documentadas continuam avaliadas.';
}
if (! $amount) {
$missing[] = 'total_investment';
}
if (($f['currency'] ?? '') !== 'MZN') {
$reasons[] = 'A condição monetária não é determinada noutra moeda: não se fez conversão.';
}
foreach (['project_concession', 'significant_implications'] as $key) {
$triggers[$key] = $answer($key);
}
$land = $answer('land_extension');
if ($land === true) {
$area = $this->number($f, 'area_required');
$unit = $f['area_unit'] ?? '';
if (! $area) {
$missing[] = 'area_required';
}if (! in_array($unit, ['ha', 'm2'], true)) {
$missing[] = 'area_unit';
}
$triggers['land_extension'] = $area && in_array($unit, ['ha', 'm2'], true) ? $area->isGreaterThanOrEqualTo($unit === 'ha' ? '10000' : '100000000') : null;
} else {
$triggers['land_extension'] = $land;
}
$forest = $answer('forest_concession');
if ($forest === true) {
$area = $this->number($f, 'forest_concession_hectares');
if (! $area) {
$missing[] = 'forest_concession_hectares';
}$triggers['forest_concession'] = $area ? $area->isGreaterThan('100000') : null;
} else {
$triggers['forest_concession'] = $forest;
}
foreach (['amount' => 'Valor superior a 32 mil milhões MZN — R13(2), R21(2)(a)', 'project_concession' => 'PPP/concessão empresarial — Lei 8/2023, art. 22(1)(b)(ii), R21(2)(b)', 'significant_implications' => 'Implicações significativas declaradas — Lei 8/2023, art. 22(1)(b)(i), R21(1)', 'land_extension' => 'Extensão de terra igual/superior a 10 mil hectares — Lei 8/2023, art. 22(1)(b)(iii), R21(2)(c)', 'forest_concession' => 'Concessão florestal superior a 100 mil hectares — Lei 8/2023, art. 22(1)(b)(iv), R21(2)(d)'] as $condition => $description) {
if (($triggers[$condition] ?? null) === true) {
$reasons[] = $description.'.';
}
}
$mode = in_array(true, $triggers, true) ? 'authorization' : (in_array(null, $triggers, true) ? 'indeterminate' : 'registration');
$reasons[] = $mode === 'authorization' ? 'Foi identificada uma condição de autorização; as restantes condições desconhecidas não foram presumidas negativas.' : ($mode === 'registration' ? 'As condições de autorização deste lote foram declaradas negativas e o montante não ultrapassa o limite.' : 'Falta resolver pelo menos uma condição de autorização.');
}
foreach (['implementation_mode', 'capital_origin', 'site_tenure', 'entity_stage'] as $key) {
if (empty($f[$key]) || $f[$key] === 'unknown') {
$missing[] = $key;
}
}
}
if ($mode === 'authorization' && in_array(true, array_intersect_key($triggers, array_flip(['amount', 'project_concession', 'land_extension', 'forest_concession'])), true)) {
$missing = array_values(array_diff($missing, ['investment_form', 'project_concession', 'significant_implications', 'land_extension', 'forest_concession', 'forest_concession_hectares', 'area_required', 'area_unit', 'total_investment']));
}
$base = $enabled && $covered && $period ? true : null;
if (! $enabled || in_array($scope, ['extractive', 'public_nonprofit'], true) || ($date && ! $period)) {
$base = false;
}
$rules = [
['identity', 'Identificação do investidor', $base, 'S06', 'R9(1)(a) / R14(1)(a)', 41, 'Identificação do proponente do pedido.'],
['registration', 'Certidão de registo comercial', $base === true ? (($f['entity_stage'] ?? '') === 'existing' ? true : (($f['entity_stage'] ?? '') === 'being_formed' ? false : null)) : $base, 'S05', 'R9(1)(b) / R14(1)(b)', 41, 'Alternativa para empresa já registada.'],
['name_reservation', 'Reserva da denominação social', $base === true ? (($f['entity_stage'] ?? '') === 'being_formed' ? true : (($f['entity_stage'] ?? '') === 'existing' ? false : null)) : $base, 'S05', 'R9(1)(b) / R14(1)(b)', 41, 'Alternativa para empresa em constituição.'],
['site_plan', 'Planta ou esboço do local', $base, 'S06', 'R9(1)(c) / R14(1)(c)', 42, 'Local de implantação identificado; não certifica disponibilidade.'],
];
foreach (['lease' => 'Contrato de arrendamento', 'duat' => 'Título DUAT'] as $key => $label) {
$rules[] = [$key, $label, $base === true ? (($f['site_tenure'] ?? 'unknown') === 'unknown' ? null : ($f['site_tenure'] ?? '') === $key) : $base, 'S06', 'R9(1)(d) / R14(1)(d)', 42, 'Alternativa correspondente à utilização declarada das instalações.'];
}
$rules[] = ['representation_license', 'Licença de representação comercial', $base === true ? (($f['implementation_mode'] ?? 'unknown') === 'unknown' ? null : ($f['implementation_mode'] ?? '') === 'foreign_representation') : $base, 'S06', 'R9(2)', 42, 'Só para a modalidade representação comercial estrangeira; não decorre da nacionalidade.'];
foreach (['feasibility' => 'Estudo de viabilidade técnica e económico-financeira', 'financial_capacity' => 'Comprovação da capacidade financeira'] as $key => $label) {
$rules[] = [$key, $label, $base === true ? ($mode === 'indeterminate' ? null : $mode === 'authorization') : $base, 'S02', 'R14(1)–(2)', 45, 'Integra a preparação do pedido de autorização.'];
}
$rules[] = ['foreign_capital', 'Prova de realização/registo do aporte externo', $base === true ? (($f['capital_origin'] ?? 'unknown') === 'unknown' ? null : in_array($f['capital_origin'] ?? '', ['external', 'mixed'], true)) : $base, 'S06', 'R5(1)–(5)', 39, 'Preparação específica do aporte externo; formalidades cambiais concretas não calculadas.'];
$links = $context['preparation_documents'] ?? [];
$requirements = [];
foreach ($rules as [$key,$label,$applies,$stage,$article,$page,$reason]) {
$doc = isset($links[$key]) ? collect($documents)->firstWhere('document_id', $links[$key]) : null;
$requirements[] = ['key' => $key, 'label' => $label, 'state' => $applies === false ? 'not_applicable' : ($applies === null ? 'indeterminate' : ($doc ? 'associated' : 'missing')), 'required' => $applies === true, 'document_id' => $links[$key] ?? null, 'document' => $doc, 'stage' => $stage, 'reason' => $reason, 'source' => ['reference' => $article, 'url' => self::SOURCE.'#page='.$page, 'sha256' => self::HASH, 'period' => '2026; Regulamento desde 07/03/2024'], 'legal_verification' => 'not_inferred'];
}
$authoritySource = ['reference' => 'R13(1)', 'url' => self::SOURCE.'#page=45'];
$zone = $context['selection']['park'] ?? null;
$amount = $this->number($f, 'total_investment');
$authority = 'Por determinar neste lote';
if ($base === true && $mode === 'registration' && $amount && ($f['currency'] ?? '') === 'MZN') {
$special = in_array($zone['fields']['investment_regime'] ?? '', ['zee', 'zfi'], true);
$authority = $special ? ($amount->isLessThanOrEqualTo('6500000000') ? 'APIEX — condicionado ao enquadramento ZEE/ZFI efectivamente reconhecido' : 'Ministro que superintende Finanças') : ($amount->isLessThanOrEqualTo('3500000000') ? 'Governador da Província' : ($amount->isLessThanOrEqualTo('6500000000') ? 'APIEX' : 'Ministro que superintende Finanças'));
}
if ($base === true && $mode === 'authorization') {
$council = array_intersect_key($triggers, array_flip(['amount', 'project_concession', 'land_extension', 'forest_concession']));
$authority = in_array(true, $council, true) ? 'Conselho de Ministros' : (in_array(null, $council, true) ? 'Autorização identificada; completar as condições em falta para distinguir a entidade decisória' : 'Ministro que superintende Finanças; eventual submissão ao Conselho de Ministros nos termos do R21(3)');
$authoritySource = ['reference' => 'R21(1)–(3)', 'url' => self::SOURCE.'#page=50'];
}
$labels = array_column($this->questions(), 'label', 'key') + ['currency' => 'Moeda do projecto', 'expected_start_date' => 'Data prevista de início', 'entity_stage' => 'Situação da entidade'];
$missingLabels = array_map(fn ($key) => $labels[$key] ?? $key, array_values(array_unique($missing)));
return ['version' => self::VERSION, 'enabled' => $enabled, 'period_covered' => $period, 'scope_covered' => $covered, 'mode' => $mode, 'reason' => $reasons, 'missing_fields' => array_values(array_unique($missing)), 'missing_labels' => $missingLabels, 'questions' => $this->questions(), 'requirements' => $requirements, 'authority' => $authority, 'authority_source' => $authoritySource, 'next' => $base === false ? 'Rever o âmbito/período; este lote não cobre o pedido' : ($mode === 'indeterminate' ? 'Completar condições do enquadramento' : ($mode === 'authorization' ? 'Preparar estudo e documentos do pedido de autorização' : 'Preparar documentos do pedido de mero registo')), 'calculation_notice' => 'O regime procedimental não altera a taxa de IVA. Reutilize a simulação geral apenas no seu âmbito e período; benefícios, apuramento final e conversão cambial não são presumidos.', 'source' => ['url' => self::SOURCE, 'sha256' => self::HASH], 'notice' => 'Preparação informativa baseada em declarações; documentos associados não constituem validação jurídica, certificado ou submissão à Administração.'];
}
}
+1
View File
@@ -2,6 +2,7 @@
return [ return [
// Explicit opt-in after authenticated installation; never infer activation from schema/ready. // Explicit opt-in after authenticated installation; never infer activation from schema/ready.
'private_preparation' => env('PRIVATE_INVESTMENT_PREPARATION_ENABLED', false),
'enabled' => env('INVESTOR_PATH_ENABLED', false), 'enabled' => env('INVESTOR_PATH_ENABLED', false),
'definition_id' => '61000919-0000-4000-8000-000000000001', 'definition_id' => '61000919-0000-4000-8000-000000000001',
]; ];
+1 -1
View File
@@ -23,7 +23,7 @@ return [
'opportunity_other_qa_subtypes' => [], 'opportunity_other_qa_subtypes' => [],
'operator_name' => env('PORTAL_OPERATOR_NAME'), 'operator_name' => env('PORTAL_OPERATOR_NAME'),
// Tempo, 19/10/2026: institutional contact; commercial department remains separate. // Tempo, 19/10/2026: institutional contact; commercial department remains separate.
'institutional_contact_email' => env('PORTAL_INSTITUTIONAL_CONTACT_EMAIL', 'info@tempo.co.mz'), 'institutional_contact_email' => env('PORTAL_INSTITUTIONAL_CONTACT_EMAIL', 'comercial@tempo.co.mz'),
'support' => [ 'support' => [
'email' => env('PORTAL_SUPPORT_EMAIL'), 'email' => env('PORTAL_SUPPORT_EMAIL'),
'phone' => env('PORTAL_SUPPORT_PHONE'), 'phone' => env('PORTAL_SUPPORT_PHONE'),
@@ -0,0 +1,710 @@
{
"date": "2026-10-23",
"decision": "Pedido expresso da Tempo: aplicar o anexo de identidade visual aos cinco cartões de Encontre o contexto do seu investimento.",
"instructionSource": {
"path": "C:\\Users\\jorge\\.codex\\attachments\\637b878f-1f58-490d-bd07-d5cd10ae2377\\Pasted text.txt",
"sha256": "fcc24dcce4b5df3f10e29add48052808d48ddcf674d052287854e11910e01d69"
},
"source": {
"type": "AI-generated photorealistic illustrative images",
"tool": "image_gen, built-in mode",
"skill": "C:/Users/jorge/.codex/skills/.system/imagegen/SKILL.md",
"externalPhotographsUsed": false,
"namedRealLocationsDepicted": false,
"note": "Cenas ilustrativas plausíveis, sem atribuição a instalações, pessoas, instituições ou projectos reais."
},
"analysisAndPlan": "docs/investmoz/public-portal-sections.md#fotografias-nos-cartões-de-contexto-do-investimento--23102026",
"filesChanged": [
"resources/js/pages/PortalInvestidor.tsx",
"resources/js/components/investment-context-cards.tsx",
"tools/portal-context-cards-qa.mjs",
"docs/investmoz/public-portal-sections.md",
"docs/investmoz/v2/auditoria-portal/matriz-requisitos.csv",
"docs/investmoz/public-portal-context-images.json"
],
"images": [
{
"key": "clusters-agroindustria",
"prompt": "Use case: photorealistic-natural. Asset type: an individual navigation card photograph for a professional investment portal. Generate ONE clean, realistic editorial photograph in horizontal 16:9 composition. Natural daylight, realistic restrained colours, excellent photographic detail, balanced uncluttered framing, one clear subject readable at a small thumbnail size. Contemporary setting plausible in Mozambique in southern Africa. This is a generic illustrative scene, NOT a depiction or claim about any named real facility, project, landmark or institution. No text, lettering, titles, captions, logos, brands, watermarks, flags, official emblems, maps, diagrams, graphical overlays, UI elements, collages, artificial colour filters, futuristic architecture or advertising poster treatment. Realistic people, hands, equipment and perspective; dignified candid activity instead of posed stock photography. Subject: a modest, well maintained agro-processing packing facility linking commercial agriculture to local industry. Wide three-quarter view into an airy open-sided processing shed with pale walls and a few orderly wooden or reusable produce crates, stainless processing/sorting benches and an unobtrusive commercial agricultural field visible beyond. Two Black southern African workers in clean practical workwear sorting harvested vegetables naturally, faces not prominent. Show production and transformation together in ONE genuine-looking continuous scene, no montage. Clear simple geometry, warm-neutral sunlight, subtle vegetation.",
"source": "C:\\Users\\jorge\\.codex\\generated_images\\01a167bd-3f26-71a0-8ec3-3f17519d2bfd\\exec-f72e66b0-d788-4476-8b20-c39b22d5d6dc.png",
"original": "outputs/investment-context-20261023/originals/clusters-agroindustria.png",
"originalSha256": "75e04a694081ab757831fc9b37323949d09806e622c83d07588fc47c423c9033",
"originalDimensions": {
"width": 1672,
"height": 941
},
"derivatives": [
{
"file": "public/images/investment-context/clusters-agroindustria.webp",
"width": 960,
"height": 540,
"bytes": 116796,
"sha256": "12494b31ab551cffb79f81c7d1519c0c4a2d4236e7f129bec1ce32251b39d847"
},
{
"file": "public/images/investment-context/clusters-agroindustria-480.webp",
"width": 480,
"height": 270,
"bytes": 42060,
"sha256": "76e3152c99ed188f748542dcf0464787307dbdc1c6299e7264dfd1bd86ad75e3"
},
{
"file": "public/images/investment-context/clusters-agroindustria-fallback.webp",
"width": 240,
"height": 135,
"bytes": 9596,
"sha256": "9f668da50f7d64955b31940d239b420ac18dbb76a8120c8bedab3f2c04710288"
}
]
},
{
"key": "corredores-logisticos",
"prompt": "Use case: photorealistic-natural. Asset type: an individual navigation card photograph for a professional investment portal. Generate ONE clean, realistic editorial photograph in horizontal 16:9 composition. Natural daylight, realistic restrained colours, excellent photographic detail, balanced uncluttered framing, one clear subject readable at a small thumbnail size. Contemporary setting plausible in Mozambique in southern Africa. This is a generic illustrative scene, NOT a depiction or claim about any named real facility, project, landmark or institution. No text, lettering, titles, captions, logos, brands, watermarks, flags, official emblems, maps, diagrams, graphical overlays, UI elements, collages, artificial colour filters, futuristic architecture or advertising poster treatment. Realistic people, hands, equipment and perspective; dignified candid activity instead of posed stock photography. Subject: a commercial freight terminal serving a southern African logistics corridor. Elevated medium-wide viewpoint showing an orderly short line of unbranded freight containers, one realistic container-handling crane and a freight truck on a paved lane, with a calm strip of water and low coastal industrial vegetation in the distance. Infrastructure of credible modest contemporary scale, generic and unidentifiable; do not reproduce or name Maputo, Beira, Nacala or any real port. Spatially coherent containers, road and handling equipment; clean clear subject with no excessive machinery.",
"source": "C:\\Users\\jorge\\.codex\\generated_images\\01a167bd-3f26-71a0-8ec3-3f17519d2bfd\\exec-0363da23-f9cb-413b-bb64-024539085c4b.png",
"original": "outputs/investment-context-20261023/originals/corredores-logisticos-v2.png",
"originalSha256": "2151d1a59265c6f7151d18af6ef6ad78f9fc6e0cd58ac9cc5c64b50a25c5058e",
"originalDimensions": {
"width": 1672,
"height": 941
},
"derivatives": [
{
"file": "public/images/investment-context/corredores-logisticos-v2.webp",
"width": 960,
"height": 540,
"bytes": 85184,
"sha256": "1939c26df297588b6c3e5ea08b700d4cda5d1183cf3e5faed06a1ca060d2475e"
},
{
"file": "public/images/investment-context/corredores-logisticos-v2-480.webp",
"width": 480,
"height": 270,
"bytes": 26222,
"sha256": "06dc0e7126cb2c13eb3f9a98f6ee58f5d64f9d07c28620975f744f263744fe15"
},
{
"file": "public/images/investment-context/corredores-logisticos-v2-fallback.webp",
"width": 240,
"height": 135,
"bytes": 5334,
"sha256": "f9fd6e6c3a2d4654df1a8fdb287e122f1889b5d318c104c4816ee393c793e242"
}
],
"selectedSource": "C:\\Users\\jorge\\.codex\\generated_images\\01a167bd-3f26-71a0-8ec3-3f17519d2bfd\\exec-c2cff7da-d602-4191-9aca-380918a09619.png",
"editPrompt": "Edit the provided photograph: REMOVE THE ENTIRE FOREGROUND TRUCK, including cab, wheels, long trailer and the red freight container on that trailer. The big truck at lower left/centre must be completely gone. Replace the removed truck's area with a continuous empty realistic paved road surface matching the surrounding pavement and road markings. Leave the stacked stationary freight containers along the quay, the water, the large port crane, the lifted container and workers. All remaining equipment and containers should have plain surfaces without readable lettering, logos, numbers or brands. No new truck, vehicle, symbol, text or overlay. Keep a single clean editorial photograph, natural lighting and horizontal 16:9 framing. Generic commercial port scene, not a named real facility."
},
{
"key": "projectos-ancora",
"prompt": "Use case: photorealistic-natural. Asset type: an individual navigation card photograph for a professional investment portal. Generate ONE clean, realistic editorial photograph in horizontal 16:9 composition. Natural daylight, realistic restrained colours, excellent photographic detail, balanced uncluttered framing, one clear subject readable at a small thumbnail size. Contemporary setting plausible in Mozambique in southern Africa. This is a generic illustrative scene, NOT a depiction or claim about any named real facility, project, landmark or institution. No text, lettering, titles, captions, logos, brands, watermarks, flags, official emblems, maps, diagrams, graphical overlays, UI elements, collages, artificial colour filters, futuristic architecture or advertising poster treatment. Realistic people, hands, equipment and perspective; dignified candid activity instead of posed stock photography. Subject: a small team of two Black southern African engineering professionals, one woman and one man, in realistic hard hats and restrained protective workwear, seen candidly from a three-quarter rear angle reviewing an unmarked folded technical plan at a utility-scale solar installation. Low rows of realistic blue solar panels and a simple low service building recede into a dry green southern African landscape. No readable drawing or numbers on the plan. Focus on credible engineering and investment project scale; clean composition, quiet professional atmosphere, no landmark or company identifiers.",
"source": "C:\\Users\\jorge\\.codex\\generated_images\\01a167bd-3f26-71a0-8ec3-3f17519d2bfd\\exec-19fcd882-542b-43c9-81e7-593fd75083f6.png",
"original": "outputs/investment-context-20261023/originals/projectos-ancora.png",
"originalSha256": "f23cf6e64307a280f3aa58741454a23480ac28fcae01a0810adf134b783a3a74",
"originalDimensions": {
"width": 1672,
"height": 941
},
"derivatives": [
{
"file": "public/images/investment-context/projectos-ancora.webp",
"width": 960,
"height": 540,
"bytes": 77114,
"sha256": "de0b59774246fee982761de59618b3e7707c3fe30f2b1bcbb6017d4dce53c4dc"
},
{
"file": "public/images/investment-context/projectos-ancora-480.webp",
"width": 480,
"height": 270,
"bytes": 29484,
"sha256": "268e405112ed341fce3c9792c3caa47053984100cd4a204453e31bbe5db6e890"
},
{
"file": "public/images/investment-context/projectos-ancora-fallback.webp",
"width": 240,
"height": 135,
"bytes": 6750,
"sha256": "db7e4b4382e09eb6b4f9f2a4603ccac4b4eacc53ba0f6776429e33dbf5131954"
}
]
},
{
"key": "educacao-formacao",
"prompt": "Use case: photorealistic-natural. Asset type: an individual navigation card photograph for a professional investment portal. Generate ONE clean, realistic editorial photograph in horizontal 16:9 composition. Natural daylight, realistic restrained colours, excellent photographic detail, balanced uncluttered framing, one clear subject readable at a small thumbnail size. Contemporary setting plausible in Mozambique in southern Africa. This is a generic illustrative scene, NOT a depiction or claim about any named real facility, project, landmark or institution. No text, lettering, titles, captions, logos, brands, watermarks, flags, official emblems, maps, diagrams, graphical overlays, UI elements, collages, artificial colour filters, futuristic architecture or advertising poster treatment. Realistic people, hands, equipment and perspective; dignified candid activity instead of posed stock photography. Subject: a candid technical training classroom with three Black southern African young adult students of different genders and one instructor working together at a practical electronics and computing workbench. Bright modest well maintained vocational classroom, natural window light, simple laboratory equipment and unbranded closed or angled laptops whose screens have no visible interface or text. Focus on two students engaged in a realistic small hands-on electronics exercise with normal anatomy and correct equipment proportions. Dignified contemporary clothing, natural concentration, professional skills and human capital investment, no posed smiles or stereotypes.",
"source": "C:\\Users\\jorge\\.codex\\generated_images\\01a167bd-3f26-71a0-8ec3-3f17519d2bfd\\exec-d21314d7-c726-41ad-862c-3c8b64df6b53.png",
"original": "outputs/investment-context-20261023/originals/educacao-formacao.png",
"originalSha256": "e59ec599e8c64ab84195d0cb37871d3102df178a13275806ca3b7f98e6bfa895",
"originalDimensions": {
"width": 1672,
"height": 941
},
"derivatives": [
{
"file": "public/images/investment-context/educacao-formacao.webp",
"width": 960,
"height": 540,
"bytes": 68224,
"sha256": "e3e5dbd292cac555a45bcbd94a0fa6b60e6b710debc0c827c68603f40bfb8a28"
},
{
"file": "public/images/investment-context/educacao-formacao-480.webp",
"width": 480,
"height": 270,
"bytes": 27384,
"sha256": "d3b743fbba7a8cb40e45999ee8c345cbfc0332cf85f5c5c2d6a5cf1240a395e4"
},
{
"file": "public/images/investment-context/educacao-formacao-fallback.webp",
"width": 240,
"height": 135,
"bytes": 7156,
"sha256": "0b2a12898043c57cf4354b54ebcba8adec8d41b3886bc574584ccc12af7b1e4c"
}
]
},
{
"key": "documentos-formularios",
"prompt": "Use case: photorealistic-natural. Asset type: an individual navigation card photograph for a professional investment portal. Generate ONE clean, realistic editorial photograph in horizontal 16:9 composition. Natural daylight, realistic restrained colours, excellent photographic detail, balanced uncluttered framing, one clear subject readable at a small thumbnail size. Contemporary setting plausible in Mozambique in southern Africa. This is a generic illustrative scene, NOT a depiction or claim about any named real facility, project, landmark or institution. No text, lettering, titles, captions, logos, brands, watermarks, flags, official emblems, maps, diagrams, graphical overlays, UI elements, collages, artificial colour filters, futuristic architecture or advertising poster treatment. Realistic people, hands, equipment and perspective; dignified candid activity instead of posed stock photography. Subject: a close-medium editorial photograph of a tidy modern administrative office desk where a Black southern African professional in a plain light blue shirt is naturally reviewing organised business documentation. Frame hands, desk and partial torso, no prominent portrait. Neat neutral folders, a few sheets with only faint out-of-focus non-readable printing, a pen and an unbranded laptop angled away with no visible UI. Soft window light, white and pale neutral surfaces with subtle blue accents. Absolutely no readable personal data, invented official seals or highlighted fake text; realistic fingers and documents, calm minimal composition.",
"source": "C:\\Users\\jorge\\.codex\\generated_images\\01a167bd-3f26-71a0-8ec3-3f17519d2bfd\\exec-f1c8e22e-6885-4578-ac7d-02692c5cc071.png",
"original": "outputs/investment-context-20261023/originals/documentos-formularios.png",
"originalSha256": "cfbd38a9cc9b9acf35f38220f5bd9c1ab1feafe411bc1d4bbdb3658de557e052",
"originalDimensions": {
"width": 1672,
"height": 941
},
"derivatives": [
{
"file": "public/images/investment-context/documentos-formularios.webp",
"width": 960,
"height": 540,
"bytes": 43002,
"sha256": "70ddea3256e6a8d981b1fae5ee7b4de6c910d757137b79a59306c268c278402f"
},
{
"file": "public/images/investment-context/documentos-formularios-480.webp",
"width": 480,
"height": 270,
"bytes": 17996,
"sha256": "436865c948acbb7b6e9e482bef8f5bd626c6960f2f155608e40dfcd0e76b84cb"
},
{
"file": "public/images/investment-context/documentos-formularios-fallback.webp",
"width": 240,
"height": 135,
"bytes": 4958,
"sha256": "fad6a6ab825a82ec2541d2e0c6de9d85486e4bbca159b912f87bec9cc0aeeba5"
}
]
}
],
"primaryImagesBytesTotal": 390320,
"responsive480ImagesBytesTotal": 143146,
"implementation": {
"gridColumns": [
1,
2,
4
],
"aspectRatio": "16:9",
"responsiveImages": true,
"lazyLoading": true,
"altLanguage": "pt",
"fallback": "Derivado pequeno da própria imagem; se também falhar, estado acessível Imagem indisponível, com dimensão reservada e link mantido.",
"globalCSSChanged": false,
"businessLogicChanged": false,
"databaseChanged": false,
"heroChanged": false
},
"visualReview": "Cinco composições individuais distintas, cores naturais e luz editorial; sem títulos/colagens ou mapas. A composição de Corredores foi revista para remover o camião com marca. Capturas em computador e telemóvel inspeccionadas.",
"verification": {
"browser": {
"results": [
{
"width": 320,
"dpr": 1,
"columns": 1,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria-480.webp",
"width": 320,
"height": 180
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2-480.webp",
"width": 320,
"height": 180
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora-480.webp",
"width": 320,
"height": 180
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao-480.webp",
"width": 320,
"height": 180
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios-480.webp",
"width": 320,
"height": 180
}
],
"status": "passed"
},
{
"width": 390,
"dpr": 2,
"columns": 1,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria.webp",
"width": 389,
"height": 219
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2.webp",
"width": 389,
"height": 219
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora.webp",
"width": 389,
"height": 219
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao.webp",
"width": 389,
"height": 219
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios.webp",
"width": 389,
"height": 219
}
],
"status": "passed"
},
{
"width": 768,
"dpr": 1,
"columns": 2,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria-480.webp",
"width": 384,
"height": 216
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2-480.webp",
"width": 384,
"height": 216
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora-480.webp",
"width": 384,
"height": 216
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao-480.webp",
"width": 384,
"height": 216
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios-480.webp",
"width": 384,
"height": 216
}
],
"status": "passed"
},
{
"width": 1024,
"dpr": 1,
"columns": 4,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria-480.webp",
"width": 256,
"height": 144
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2-480.webp",
"width": 256,
"height": 144
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora-480.webp",
"width": 256,
"height": 144
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao-480.webp",
"width": 256,
"height": 144
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios-480.webp",
"width": 256,
"height": 144
}
],
"status": "passed"
},
{
"width": 1440,
"dpr": 2,
"columns": 4,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios.webp",
"width": 266,
"height": 149
}
],
"status": "passed"
},
{
"width": 1920,
"dpr": 1,
"columns": 4,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria-480.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2-480.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora-480.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao-480.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios-480.webp",
"width": 266,
"height": 149
}
],
"status": "passed"
},
{
"fail": "primary",
"status": "passed"
},
{
"fail": "all",
"status": "passed"
}
],
"errors": [],
"navigation": [
"/clusters",
"/corredores",
"/projectos-ancora",
"/educacao",
"/documentos"
],
"databaseAccess": false
},
"script": "tools/portal-context-cards-qa.mjs",
"screenshots": [
"outputs/investment-context-20261023/cards-1024-dpr1.png",
"outputs/investment-context-20261023/cards-1440-dpr2.png",
"outputs/investment-context-20261023/cards-1920-dpr1.png",
"outputs/investment-context-20261023/cards-320-dpr1.png",
"outputs/investment-context-20261023/cards-390-dpr2.png",
"outputs/investment-context-20261023/cards-768-dpr1.png",
"outputs/investment-context-20261023/fallback-all.png",
"outputs/investment-context-20261023/fallback-primary.png"
],
"types": {
"command": "npm run types:check",
"exitCode": 0
},
"lint": {
"files": [
"resources/js/components/investment-context-cards.tsx",
"resources/js/pages/PortalInvestidor.tsx",
"tools/portal-context-cards-qa.mjs"
],
"exitCode": 0
},
"build": {
"command": "npm run build",
"exitCode": 0,
"pageAsset": "assets/PortalInvestidor-fh5VZanx.js",
"log": "outputs/investment-context-20261023/build-local.log"
}
},
"scope": "Aplicado no código e pacote locais. API e navegação simuladas na verificação visual; sem dados activos ou publicação externa.",
"matrixReferences": [
"MASTER-efd550fd-0104",
"MASTER-55050f60-0001"
],
"acceptanceLimit": "Prova restrita à apresentação e navegação dos cinco cartões; não encerra critérios funcionais mais amplos da matriz.",
"layoutRevision": {
"date": "2026-10-23",
"decision": "Pedido expresso da Tempo: título a vermelho e menos espaço em branco dentro dos cartões.",
"changes": "Título no vermelho #ed1c24; removidas alturas mínimas de título e descrição; preenchimento 20→16 px, intervalo 8→6 px e entrelinhas 28/24→24/20 px. Mantidos imagens, conteúdos, links e alinhamento por linha da grelha.",
"browser": {
"results": [
{
"width": 320,
"dpr": 1,
"columns": 1,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria-480.webp",
"width": 320,
"height": 180
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2-480.webp",
"width": 320,
"height": 180
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora-480.webp",
"width": 320,
"height": 180
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao-480.webp",
"width": 320,
"height": 180
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios-480.webp",
"width": 320,
"height": 180
}
],
"status": "passed"
},
{
"width": 390,
"dpr": 2,
"columns": 1,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria.webp",
"width": 389,
"height": 219
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2.webp",
"width": 389,
"height": 219
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora.webp",
"width": 389,
"height": 219
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao.webp",
"width": 389,
"height": 219
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios.webp",
"width": 389,
"height": 219
}
],
"status": "passed"
},
{
"width": 768,
"dpr": 1,
"columns": 2,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria-480.webp",
"width": 384,
"height": 216
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2-480.webp",
"width": 384,
"height": 216
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora-480.webp",
"width": 384,
"height": 216
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao-480.webp",
"width": 384,
"height": 216
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios-480.webp",
"width": 384,
"height": 216
}
],
"status": "passed"
},
{
"width": 1024,
"dpr": 1,
"columns": 4,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria-480.webp",
"width": 256,
"height": 144
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2-480.webp",
"width": 256,
"height": 144
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora-480.webp",
"width": 256,
"height": 144
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao-480.webp",
"width": 256,
"height": 144
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios-480.webp",
"width": 256,
"height": 144
}
],
"status": "passed"
},
{
"width": 1440,
"dpr": 2,
"columns": 4,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios.webp",
"width": 266,
"height": 149
}
],
"status": "passed"
},
{
"width": 1920,
"dpr": 1,
"columns": 4,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-context/clusters-agroindustria-480.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/corredores-logisticos-v2-480.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/projectos-ancora-480.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/educacao-formacao-480.webp",
"width": 266,
"height": 149
},
{
"src": "http://127.0.0.1:5174/images/investment-context/documentos-formularios-480.webp",
"width": 266,
"height": 149
}
],
"status": "passed"
},
{
"fail": "primary",
"status": "passed"
},
{
"fail": "all",
"status": "passed"
}
],
"errors": [],
"navigation": [
"/clusters",
"/corredores",
"/projectos-ancora",
"/educacao",
"/documentos"
],
"databaseAccess": false
},
"lintExitCode": 0,
"buildExitCode": 0,
"pageAsset": "assets/PortalInvestidor-CYCMhSzW.js",
"screenshots": [
"outputs/investment-context-compact-20261023/cards-1024-dpr1.png",
"outputs/investment-context-compact-20261023/cards-1440-dpr2.png",
"outputs/investment-context-compact-20261023/cards-1920-dpr1.png",
"outputs/investment-context-compact-20261023/cards-320-dpr1.png",
"outputs/investment-context-compact-20261023/cards-390-dpr2.png",
"outputs/investment-context-compact-20261023/cards-768-dpr1.png"
],
"databaseChanged": false
}
}
@@ -0,0 +1,355 @@
{
"date": "2026-10-23",
"decision": "Pedido expresso da Tempo: adaptar hero, imagens e pesquisa da referência, preservando a informação e os comportamentos equivalentes do V2.",
"sourceProject": "D:/Projects/Tempo_Investidor/investidor",
"targetProject": "D:/Projects/Tempo_Investidor/Investidor-V2",
"planAndAnalysis": "docs/investmoz/public-portal-sections.md#adequação-do-hero--23102026",
"implementation": [
"resources/js/components/portal-hero.tsx",
"resources/js/pages/PortalInvestidor.tsx"
],
"assets": [
{
"source": "D:\\Projects\\Tempo_Investidor\\investidor\\public\\images\\hero\\hero-1.png",
"original": "public\\images\\hero\\hero-1.png",
"sha256": "3c9246169025b9b1b4d1d10fb51c1f644123984bde56c6c2d9bf869d851024fc",
"bytes": 2315768,
"webpBytes": 94012,
"mobileBytes": 38804
},
{
"source": "D:\\Projects\\Tempo_Investidor\\investidor\\public\\images\\hero\\hero-3.jpg",
"original": "public\\images\\hero\\hero-3.jpg",
"sha256": "91377213b6286aca7ee4af90860a7dc7a75fa08a165ef7b3192081db43f92dff",
"bytes": 9875137,
"webpBytes": 140342,
"mobileBytes": 32998
}
],
"desktopBytesTotal": 234354,
"mobileBytesTotal": 71802,
"originalBytesTotal": 12190905,
"verification": {
"browser": {
"results": [
{
"width": 320,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 390,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 768,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 1440,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 1920,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 1440,
"reducedMotion": "no-preference",
"status": "passed"
}
],
"errors": [],
"requests": [
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=",
"/oportunidades",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique"
],
"databaseAccess": false
},
"browserScript": "tools/portal-hero-qa.mjs",
"screenshots": [
"outputs/portal-hero-20261023/after-1440-no-preference.png",
"outputs/portal-hero-20261023/after-1440-reduce.png",
"outputs/portal-hero-20261023/after-1440-second-image.png",
"outputs/portal-hero-20261023/after-1920-reduce.png",
"outputs/portal-hero-20261023/after-320-reduce.png",
"outputs/portal-hero-20261023/after-390-reduce.png",
"outputs/portal-hero-20261023/after-768-reduce.png",
"outputs/portal-hero-20261023/before-1440-reduce.png",
"outputs/portal-hero-20261023/before-390-reduce.png"
],
"additionalCases": [
"pesquisa por Enter e botão",
"ordem do teclado: campo → botão",
"query acentuada e pontuação preservadas",
"remoção de espaços exteriores",
"pesquisa vazia abre catálogo",
"CTA abre oportunidades",
"API indisponível mantém indicadores indeterminados",
"contagens zero preservadas",
"duas imagens carregadas",
"selecção manual",
"pausa e retoma explícitas",
"foco pausa rotação",
"rotação automática após perda de foco",
"movimento reduzido",
"entrada documental e cabeçalho preservados"
],
"existingFrontendTests": {
"command": "node --test tests/frontend/portal-api.test.mjs tests/frontend/portal-navigation.test.mjs",
"passed": 20
},
"typecheck": {
"command": "npm run types:check",
"exitCode": 0
},
"lint": {
"files": [
"resources/js/components/portal-hero.tsx",
"resources/js/pages/PortalInvestidor.tsx",
"tools/portal-hero-qa.mjs"
],
"exitCode": 0
},
"qaBuild": {
"command": "INVESTMOZ_QA_BUILD=1 npm run build",
"exitCode": 0
},
"localBuild": {
"command": "npm run build",
"exitCode": 0,
"pageAsset": "assets/PortalInvestidor-MsUeKoJQ.js"
}
},
"matrix": {
"file": "docs/investmoz/v2/auditoria-portal/matriz-requisitos.csv",
"referencesAdded": [
"MASTER-9dee08d0-0016",
"MASTER-efd550fd-0104",
"MASTER-55050f60-0001"
],
"rowCount": 3422,
"criteriaAndStatesPreserved": true
},
"scope": {
"appliedToLocalCodeAndBuild": true,
"activeDatabaseChanged": false,
"migrationsRun": false,
"externalDeploymentPerformed": false,
"backendSearchReimplemented": false
},
"limits": "Verificação visual com dados sintéticos; pesquisa continua limitada ao catálogo de oportunidades. Os critérios mais amplos da matriz permanecem no estado anterior.",
"latestRevision": {
"id": "hero-no-controls-20261023",
"date": "2026-10-23",
"decision": "Pedido expresso da Tempo: remover do hero as duas bolinhas e o botão de pausa das imagens.",
"implementation": "Removidos grupo de controlos, ícones Pause/Play e estado de pausa manual. Preservadas troca automática, escrita dinâmica, pesquisa e preferência de movimento reduzido.",
"browser": {
"results": [
{
"width": 320,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 390,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 768,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 1440,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 1920,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 390,
"reducedMotion": "no-preference",
"status": "passed"
},
{
"width": 1440,
"reducedMotion": "no-preference",
"status": "passed"
}
],
"errors": [],
"requests": [
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=",
"/oportunidades",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=",
"/oportunidades",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique"
],
"databaseAccess": false
},
"screenshots": [
"outputs/portal-hero-no-controls-20261023/after-1440-no-preference.png",
"outputs/portal-hero-no-controls-20261023/after-1440-reduce.png",
"outputs/portal-hero-no-controls-20261023/after-1920-reduce.png",
"outputs/portal-hero-no-controls-20261023/after-320-reduce.png",
"outputs/portal-hero-no-controls-20261023/after-390-no-preference.png",
"outputs/portal-hero-no-controls-20261023/after-390-reduce.png",
"outputs/portal-hero-no-controls-20261023/after-768-reduce.png",
"outputs/portal-hero-no-controls-20261023/second-image-1440.png",
"outputs/portal-hero-no-controls-20261023/second-image-390.png",
"outputs/portal-hero-no-controls-20261023/typed-1440.png",
"outputs/portal-hero-no-controls-20261023/typed-390.png"
],
"checks": {
"lintExitCode": 0,
"buildExitCode": 0,
"pageAsset": "assets/PortalInvestidor-T0B6aoV_.js"
},
"scope": {
"appliedLocally": true,
"databaseAccess": false,
"externalDeployment": false
}
},
"revisionHistory": [
{
"id": "hero-typing-20261023",
"date": "2026-10-23",
"decision": "Pedido expresso da Tempo: título e frase dinâmicos como na referência; remover Termos de uso do hero.",
"plan": [
"Analisar a sequência de escrita da referência.",
"Animar o título e depois a frase, mantendo os textos do V2 e reservando a dimensão final.",
"Reiniciar a escrita na troca de imagem e integrar pausa/retoma e preferência de movimento reduzido.",
"Remover o link e o ícone jurídico do hero.",
"Demonstrar comportamento em computador e telemóvel e compilar o pacote local."
],
"files": [
"resources/js/components/portal-hero.tsx",
"resources/css/app.css",
"tools/portal-hero-qa.mjs"
],
"browser": {
"results": [
{
"width": 320,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 390,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 768,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 1440,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 1920,
"reducedMotion": "reduce",
"status": "passed"
},
{
"width": 390,
"reducedMotion": "no-preference",
"status": "passed"
},
{
"width": 1440,
"reducedMotion": "no-preference",
"status": "passed"
}
],
"errors": [],
"requests": [
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=",
"/oportunidades",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique",
"/oportunidades?q=",
"/oportunidades",
"/oportunidades?q=energia%20%26%20Nampula%20%2F%20Mo%C3%A7ambique"
],
"databaseAccess": false
},
"screenshots": [
"outputs/portal-hero-typing-20261023/after-1440-no-preference.png",
"outputs/portal-hero-typing-20261023/after-1440-reduce.png",
"outputs/portal-hero-typing-20261023/after-1440-second-image.png",
"outputs/portal-hero-typing-20261023/after-1920-reduce.png",
"outputs/portal-hero-typing-20261023/after-320-reduce.png",
"outputs/portal-hero-typing-20261023/after-390-no-preference.png",
"outputs/portal-hero-typing-20261023/after-390-reduce.png",
"outputs/portal-hero-typing-20261023/after-768-reduce.png",
"outputs/portal-hero-typing-20261023/typed-1440.png",
"outputs/portal-hero-typing-20261023/typed-390.png",
"outputs/portal-hero-typing-20261023/typing-1440.png",
"outputs/portal-hero-typing-20261023/typing-390.png"
],
"demonstrated": [
"escrita progressiva",
"título antes da frase",
"texto completo no modo de movimento reduzido",
"nome acessível completo durante a escrita",
"pesquisa sem deslocamento durante a escrita",
"reinício na selecção manual e automática de imagem",
"pausa e retoma da escrita",
"cursor com pausa",
"Termos de uso ausente do hero",
"pesquisa, teclado, CTA, API indisponível e contagens zero preservados"
],
"checks": {
"types": {
"command": "npm run types:check",
"exitCode": 0
},
"lint": {
"command": "vp lint resources/js/components/portal-hero.tsx tools/portal-hero-qa.mjs",
"exitCode": 0
},
"build": {
"command": "npm run build",
"exitCode": 0,
"pageAsset": "assets/PortalInvestidor-BbVHeTeI.js",
"log": "outputs/portal-hero-typing-20261023/build-local.log"
}
},
"scope": {
"appliedLocally": true,
"databaseAccess": false,
"externalDeployment": false
}
}
]
}
+88
View File
@@ -48,3 +48,91 @@ Edge headless: 11 páginas públicas/autenticação verificadas a 390×844, com
Página inicial também verificada a 1440×1000. Cenário fiscal exercitado no navegador: base 1.000 × taxa 10% × (1 − redução 50%) = 50. Resultados em `public-portal-browser-validation.json`. Página inicial também verificada a 1440×1000. Cenário fiscal exercitado no navegador: base 1.000 × taxa 10% × (1 − redução 50%) = 50. Resultados em `public-portal-browser-validation.json`.
Antes da migration local foi criado e restaurado o backup de 74 tabelas em `storage/app/private/portal-services-backup-20260927-090641/`. O backup completo anterior permanece em `C:/laragon/backups/portal-investidor-20260927-101224/` e representa o estado anterior a esta entrega. Antes da migration local foi criado e restaurado o backup de 74 tabelas em `storage/app/private/portal-services-backup-20260927-090641/`. O backup completo anterior permanece em `C:/laragon/backups/portal-investidor-20260927-101224/` e representa o estado anterior a esta entrega.
## Adequação do hero — 23/10/2026
Origem: pedido expresso da Tempo nesta sessão para aproveitar o hero, as imagens e a barra de pesquisa de `D:/Projects/Tempo_Investidor/investidor`, usando a informação existente no V2. Aplicam-se as orientações permanentes do `AGENTS.md`, incluindo a distinção entre decisão da Tempo e escolha técnica, a preservação de dados e a separação de QA e activo.
Análise prévia: a página de entrada real do V2 é `PortalInvestidor.tsx`, servida por `PortalServicesController::home`. A referência é `domains/investor-portal/components/homepage/homepage-hero.tsx`, montada em `InstitutionalHomepage`. A referência usa Inertia 2, Framer Motion, tradução e navegação diferentes; o V2 usa Inertia 3 e pesquisa de oportunidades. Copiar essas dependências e `/pesquisa` ou `/aviso-legal` directamente criaria incompatibilidades e destinos inexistentes.
Plano executado:
1. Registar a apresentação anterior em computador e telemóvel, com os componentes reais e dados sintéticos.
2. Copiar os dois originais efectivamente usados pela referência (`hero-1.png` e `hero-3.jpg`), conferir SHA-256 e gerar derivados WebP para computador e telemóvel. `hero-2.png` não faz parte da rotação da referência.
3. Extrair `components/portal-hero.tsx` e aplicar fotografias em rotação, texto centrado e pesquisa branca com botão vermelho. Preservar os textos do V2, contagens da API, sectores, documentos, apoio, cabeçalho e rodapé.
4. Manter a pesquisa de oportunidades em `/oportunidades?q=`, incluindo pesquisa vazia e caracteres acentuados. Conservar “Consultar oportunidades” e “Planear finanças”. A primeira iteração acrescentou o acesso jurídico `/termos-de-uso` ao hero; foi removido na revisão expressamente pedida pela Tempo abaixo.
5. Verificar apresentação, teclado, imagens, rotação, pausa, movimento reduzido, falha da API, contagens zero, TypeScript, lint e compilação. Compilar primeiro o pacote QA e depois os assets locais em `public/build`.
Escolhas técnicas desta adaptação: React e transições CSS existentes, sem novas dependências; rotação de oito segundos, pausa por controlo explícito, foco, ponteiro ou separador oculto; apresentação estática quando o utilizador pede movimento reduzido. A primeira iteração apresentou o texto estático; a revisão abaixo introduz a escrita dinâmica pedida pela Tempo. O campo indica pesquisa de oportunidades e conserva exemplos que o catálogo suporta; esta alteração não implementa uma pesquisa global de legislação/licenciamento.
Evidência reproduzível: `tools/portal-hero-qa.mjs`, com Vite local e Playwright configurável por `HERO_QA_PLAYWRIGHT`/`HERO_QA_CHROMIUM`. Fixtures e capturas em `outputs/portal-hero-20261023/`; síntese persistente em `public-portal-hero-validation.json`. Os testes de interface interceptam a API e a navegação Inertia, sem acesso a Laravel, base de dados ou serviços externos. A compilação local aplica os assets desta pasta; não representa publicação noutro servidor.
Referências na matriz existente: `MASTER-efd550fd-0104` (composição da página), `MASTER-9dee08d0-0016` (contexto da pesquisa) e `MASTER-55050f60-0001` (entrada documental preservada). Esta prova cobre a adaptação visual e os percursos exercitados; não encerra os critérios funcionais mais amplos dessas linhas.
### Revisão: escrita dinâmica e remoção do acesso jurídico no hero
Decisão expressa da Tempo na continuação da sessão de 23/10/2026: animar “INVISTA EM MOÇAMBIQUE” e “Transforme informação em decisões e ideias em negócios reais.” como na página de referência, e remover “Termos de uso” do hero. A anterior apresentação estática e a inclusão desse link eram escolhas de implementação, agora substituídas pelo pedido do proprietário.
Análise e plano executado: reproduzir a sequência da referência (espera inicial de 250 ms, título a 50 ms por carácter, intervalo de 150 ms e frase a 28 ms por carácter); reiniciar ao trocar de imagem; acrescentar o cursor intermitente; reservar a dimensão final de ambas as linhas para manter a pesquisa imóvel; remover o link e o ícone jurídico do hero; verificar em computador e telemóvel e compilar o pacote local.
Implementação em `portal-hero.tsx`, com React existente e CSS do cursor em `app.css`, sem dependências novas. A pausa explícita suspende também a escrita, retomando do mesmo ponto. Quando o separador fica oculto a escrita pára; a preferência de movimento reduzido apresenta os dois textos completos. Leitores de ecrã recebem o texto completo uma única vez, independentemente do número de caracteres visíveis. Os temporizadores são limpos ao mudar de imagem ou desmontar o componente.
O script `tools/portal-hero-qa.mjs` demonstra a escrita progressiva, a ordem título→frase, o reinício manual/automático, a pausa/retoma, a posição estável da pesquisa, o modo sem movimento e a ausência de “Termos de uso” no hero. As capturas e resultados desta revisão ficam em `outputs/portal-hero-typing-20261023/`, preservando a evidência anterior. Síntese e compilação final registadas na revisão de `public-portal-hero-validation.json`; referência acrescentada à linha existente `MASTER-efd550fd-0104`, sem encerrar o seu critério mais amplo.
### Revisão: remoção dos controlos visíveis das imagens
Pedido expresso da Tempo na continuação de 23/10/2026: remover do hero o grupo com o botão de pausa e as duas bolinhas de selecção de imagem. Removidos o grupo, os ícones e o estado de pausa manual. A troca automática de imagens e a escrita dinâmica permanecem; conservam-se a pausa da rotação por foco/ponteiro, a suspensão em separador oculto e a preferência de movimento reduzido. Esta decisão substitui os controlos visíveis introduzidos como escolha de implementação nas revisões anteriores.
O script existente de interface foi adaptado para demonstrar a ausência dos controlos e a continuação da rotação automática, escrita e pesquisa, com capturas em `outputs/portal-hero-no-controls-20261023/`. Evidência e pacote local registados em `public-portal-hero-validation.json`, mantendo o histórico das revisões e os estados dos requisitos da matriz.
## Fotografias nas etapas de Como Investir — 23/10/2026
Origem: pedido expresso da Tempo para analisar e ilustrar exclusivamente os cartões “1. Explorar”, “2. Preparar” e “3. Acompanhar”. Aplicam-se as orientações permanentes de `AGENTS.md` de 12/10 e 22/10/2026; componentes e optimização de recursos são escolhas técnicas, sem novas regras operacionais.
Análise e plano: os cartões existentes são âncoras estáticas na home React/Inertia, numa grelha de três colunas a partir de 768 px. Explorar liga a `/oportunidades` e representa a identificação de sector, território e oportunidade; Preparar liga a `/como-investir` e representa percurso/documentação; Acompanhar liga a `/balcao-virtual` e representa envio/consulta de pedido e protocolo. Os recursos locais existentes ilustram outras secções; preparar três fotografias distintas para evitar repetição. Gerar cenas editoriais plausíveis com `imagegen`, rever composição, guardar originais e versões WebP locais, integrar imagens 16:9 com dimensões reservadas e carregamento diferido, manter textos/destinos/título vermelho, verificar comportamento responsivo, navegação e falhas de imagem, compilar. Âmbito exclusivamente visual, sem alterações em dados, autenticação, apoio ou rodapé. Referência documental na linha existente `MASTER-efd550fd-0104`, sem criar outra matriz nem encerrar o critério mais amplo.
Implementação: `components/investment-steps.tsx` reúne os três cartões, preservando títulos, descrições e âncoras. Fotografias individuais geradas com a ferramenta integrada `image_gen`, sem local ou projecto real atribuído: avaliação de oportunidade num parque empresarial genérico, preparação documental numa reunião e consulta de pedido no computador. Originais em `outputs/investment-steps-20261023/originals/`; recursos locais em `public/images/investment-steps/` com WebP 960×540, 480×270 e alternativa própria 240×135. Os cartões usam `srcset`, `sizes`, `loading="lazy"`, dimensões reservadas, corte 16:9, alt em português, foco visível e texto compacto com 16 px de preenchimento. Se também falhar a alternativa pequena, o cartão mantém a área reservada, descrição acessível e destino utilizável.
Verificação desta secção: componentes reais com API sintética e sem base de dados, seis larguras de 320 a 1920 px, duas densidades de ecrã, três imagens distintas, texto/destinos conservados, navegação por teclado, ausência de transbordo e deslocamento no carregamento, falhas dos recursos principais e de todos os recursos. Oito cenários sem erros JavaScript. Fotografias, prompts, hashes, capturas, relatório de browser e compilação documentados em `public-portal-steps-images.json` e `outputs/investment-steps-20261023/`. Ajuste restrito a esta secção; apoio, acesso à gestão e rodapé mantidos.
## Fotografias nos cartões de contexto do investimento — 23/10/2026
Origem: pedido expresso da Tempo para aplicar o anexo “Melhorar as imagens e a identidade visual do Portal do Investidor de Moçambique” exclusivamente à secção “Encontre o contexto do seu investimento”. O anexo define estética fotográfica editorial, imagens individuais contextualizadas, recursos locais, acessibilidade, desempenho e preservação dos cinco destinos e conteúdos. Aplicam-se as orientações permanentes de `AGENTS.md` de 12/10 e 22/10/2026; os pormenores de implementação abaixo são escolhas técnicas.
Análise prévia: Laravel/Inertia 3 e React, com Tailwind existente; os cinco cartões estavam embutidos em `pages/PortalInvestidor.tsx`. `EducationalArticleCard` destina-se a artigos com acções e metadados diferentes, pelo que não foi alterado. A secção foi extraída para `components/investment-context-cards.tsx`, mantendo o título, descrições, âncoras e grelha de uma/duas/quatro colunas. Não foram alteradas as páginas de destino, dados, APIs ou estilos globais.
Foram geradas cinco imagens distintas com a ferramenta integrada `image_gen`, segundo a skill `imagegen`: agro-indústria, terminal logístico, acompanhamento de instalação solar, formação técnica e análise documental. São imagens fotográficas ilustrativas geradas, sem localização ou instituição real atribuída, e não fotografias documentais de projectos cadastrados. A imagem do terminal foi revista para remover o camião com marca visível. Não foram usadas fotografias externas nem URLs de serviços de imagens. Originais seleccionados, prompts e hashes estão registados no manifesto `public-portal-context-images.json`; os originais foram preservados dentro do workspace.
Recursos finais em `public/images/investment-context/`: `clusters-agroindustria`, `corredores-logisticos-v2`, `projectos-ancora`, `educacao-formacao` e `documentos-formularios`, em WebP 960×540, com variantes 480×270 e alternativas 240×135. As imagens mantêm 16:9, `object-cover`, textos alternativos em português, dimensões reservadas, `srcset`, `sizes`, `loading="lazy"` e descodificação assíncrona. Cada cartão conserva o seu título e descrição; o foco usa o azul e os tons neutros pedidos no anexo.
Se um recurso principal falhar, o cartão usa a sua própria variante pequena, evitando repetir a fotografia de outra secção. Se também essa falhar, apresenta “Imagem indisponível” no mesmo espaço reservado, com descrição acessível e link operacional. Este é apenas um estado de erro; os cinco cartões usam imagens fotográficas na apresentação normal.
Verificação reproduzível: `tools/portal-context-cards-qa.mjs`, com o portal e cabeçalho reais, API sintética e acesso exclusivo aos recursos locais. Exercita seis larguras de ecrã, ecrãs de alta densidade, os cinco destinos por teclado, imagens carregadas e distintas, alinhamento, dimensões, ausência de deslocamento no carregamento e dois cenários de falha. Capturas e resultados em `outputs/investment-context-20261023/`; síntese, fontes/prompts e compilação em `public-portal-context-images.json`. Referências acrescentadas às linhas existentes `MASTER-efd550fd-0104` e `MASTER-55050f60-0001`, sem encerrar os respectivos critérios mais amplos.
Revisão expressa da Tempo de 23/10/2026: título da secção no vermelho da identidade existente (`#ed1c24`) e cartões mais compactos. Removidas as alturas mínimas de 56 e 72 px do título/descrição; reduzidos o preenchimento de 20 para 16 px, o intervalo de 8 para 6 px e as entrelinhas. As alturas passam a acompanhar o conteúdo, com alinhamento por linha da grelha, conservando imagens, textos e destinos. A reserva das dimensões das imagens mantém-se. Evidência desta revisão em `outputs/investment-context-compact-20261023/` e no campo `layoutRevision` do manifesto existente.
## Sectores da home e catálogo completo — 23/10/2026
Origem: pedido expresso da Tempo para adaptar a estrutura de “Áreas de Investimento” do projecto `D:/Projects/Tempo_Investidor/tempo-dashboard`, incluindo cartões, botão para mais sectores e respectiva página, e uniformizar a vermelho os títulos das secções da home. Aplicadas as orientações permanentes `AGENTS.md` de 12/10 e 22/10/2026: as decisões de produto são da Tempo; as escolhas técnicas abaixo não criam requisitos organizacionais.
Análise prévia: a referência usa `components/investor-portal/homepage/homepage-sectors.tsx` e `pages/investor-portal/sectors/index.tsx`. Mostra cinco cartões com fotografia e título sobreposto, resumo, “Saiba mais” e ligação central arredondada para o catálogo. O V2 já dispunha de `/sectores`, fichas `/sectores/{slug}`, especialização Fintech e dados de `SectorOrganization`. Foram reutilizados esses contratos e percursos, sem importar Framer Motion, traduções ou rotas exclusivas da referência.
Implementação: `components/public-sector-cards.tsx` partilha os cartões entre a home e o catálogo. A home mostra os primeiros cinco sectores, na ordem recebida da API, com “Ler mais” para a ficha existente e “Ver mais sectores” para `/sectores`. A página existente apresenta todos os sectores publicados, na mesma estrutura visual, e “Voltar ao início”. Mantêm-se nomes, descrições, contagens, valores zero, especializações e URLs canónicos recebidos. Descrições ausentes não são preenchidas com dados da referência. Fintech permanece ligado à ficha própria, sem âncoras HTML aninhadas.
Foram inventariados os onze JPG disponíveis em `storage/app/public/investor-portal/sectors` na referência, copiados os originais para evidência e preparados derivados locais WebP 960×540/480×270 em `public/images/sectors/`. O mapeamento visual por slug é de apresentação e não altera a taxonomia. Para Imobiliário e sectores sem imagem específica usa-se a vista empresarial genérica disponível na referência; para Bens de Consumo e Franquias usa-se a imagem de actividade industrial. A variante genérica também serve como alternativa em caso de erro; se ambas falharem, o título e as ligações continuam visíveis num fundo neutro. Não se atribui aos ficheiros uma origem oficial, licença externa ou localização documental não comprovada.
Os seis títulos de secção da home — contexto do investimento, sectores, Como Investir, oportunidades em destaque, documentos essenciais e apoio — usam `HOME_SECTION_HEADING` em `lib/portal-presentation.ts`: vermelho `#ed1c24`, 24 px, entrelinha de 32 px e peso 700. O cartão de Apoio passou a superfície clara para manter contraste com o título vermelho. O título principal animado do hero mantém a sua hierarquia própria. `PORTAL_MORE_LINK` centraliza o botão arredondado, contorno vermelho e estado de foco, seguindo a referência.
Verificação: `tools/portal-home-sectors-qa.mjs` carrega os componentes reais com dez sectores sintéticos, descrições nulas e especialização Fintech, sem base de dados. Exercita seis larguras, prévia de cinco/cartálogo de dez, estilos dos seis títulos, percurso por teclado, dez fichas, Fintech, regresso à home, catálogo vazio e dois cenários de indisponibilidade de imagens. Capturas, inventário, hashes e resultados em `outputs/home-sectors-20261023/`; resumo persistente em `public-portal-sectors-validation.json`. Referências na matriz existente: `MASTER-efd550fd-0104` e `MASTER-9f5719c8-0077`. Esta adaptação não encerra critérios mais amplos nem altera dados, permissões, regras operacionais ou publicação noutro servidor.
Pedido expresso da Tempo, 23/10/2026 — botão “Contactar Apoio ao Investidor”: em `layouts/portal-navigation.tsx`, a faixa de largura total foi substituída por um botão centrado, com largura ajustada ao texto, altura mínima de 44 px, preenchimento reduzido, sombra discreta e vermelho `#ed1c24`, conservando `/apoio` e o foco visível. Verificado a 320, 390 e 1440 px: cerca de 223×44 px, sem transbordo ou erros JavaScript. Evidência em `outputs/support-button-20261023/qa-results.json` e capturas; compilação local no mesmo directório. Ajuste de apresentação por decisão do proprietário, sem nova regra operacional nem alteração de dados.
Revisão anterior de 23/10/2026, superada pela correcção de âmbito abaixo: o Codex interpretou o pedido de abreviação como aplicável à zona inferior inteira e alterou indevidamente o botão de apoio e o rodapé partilhado. Essa interpretação não foi uma decisão da Tempo. A revisão removeu o bloco interno, abreviou o botão para “Apoio” e recolheu contactos/ligações em “Informações” num rodapé claro; estas alterações fora do bloco indicado foram revertidas após a clarificação expressa do proprietário. O registo desta revisão é histórico e não descreve a apresentação actual.
Evidência histórica da revisão superada: `outputs/footer-compact-20261023/qa-results.json`, capturas e `check.mjs`. Não constitui aceitação do âmbito pelo proprietário.
Correcção expressa da Tempo, 23/10/2026: o pedido abrange exclusivamente o bloco “INVESTE Moçambique / Portal do Investidor — conheça as oportunidades… / Acesso à gestão”. Em `pages/PortalInvestidor.tsx`, esse bloco fica abreviado num ícone de acesso à gestão, com nome acessível e descrição “Acesso à gestão”, destino `/acesso-gestao`, área de interacção de 44 px e fundo branco, sem o título e parágrafo anteriores. O botão de apoio foi restaurado exactamente à apresentação anterior à abreviação: “Contactar Apoio ao Investidor”, compacto, vermelho e sem ícone. `components/tempo-footer.tsx` e os estilos `.tempo-footer` foram integralmente restaurados ao estado anterior, incluindo contactos e ligações visíveis e o fundo original do rodapé geral. Não se altera autenticação nem dados. Esta correcção substitui a interpretação indevida acima e mantém as restantes alterações previamente pedidas.
Evidência da correcção: `outputs/footer-scope-correction-20261023/check.mjs`, `qa-results.json`, capturas e `build-local.log`; componentes reais com API sintética a 320, 390 e 1440 px, ícone de gestão focável, bloco específico claro sem parágrafo, botão de apoio completo/vermelho, rodapé geral restaurado, contactos e ligações legais visíveis, sem transbordo ou erros JavaScript. Lint dos componentes alterados e compilação local. Referência na linha existente `MASTER-efd550fd-0104`, sem encerramento do critério amplo nem alteração dos seus estados.
Continuação expressa da Tempo, 23/10/2026: acrescentado o título visível “Acesso à gestão” ao lado do ícone nesse mesmo bloco, para tornar o destino compreensível. O acesso mantém-se compacto, vermelho e com fundo claro, conservando `/acesso-gestao`. Ajuste restrito a essa ligação; apoio e rodapé geral conservam a apresentação restaurada. Referência: `MASTER-efd550fd-0104` e a evidência da revisão anterior acima. Verificado a 320, 390 e 1440 px, sem transbordo ou erros JavaScript; lint e compilação aprovados. Evidência em `outputs/management-label-20261023/qa-results.json`, capturas e `build-local.log`. No pedido seguinte, a Tempo determinou o alinhamento desse acesso à esquerda; aplicado `justify-start` apenas no seu contentor.
@@ -0,0 +1,748 @@
{
"date": "2026-10-23",
"decision": "Pedido expresso da Tempo: adaptar Áreas de Investimento do tempo-dashboard aos sectores da home e ao catálogo completo, copiar a estrutura dos botões e uniformizar a vermelho os títulos de secção da home.",
"reference": {
"project": "D:/Projects/Tempo_Investidor/tempo-dashboard",
"files": [
"resources/js/components/investor-portal/homepage/homepage-sectors.tsx",
"resources/js/pages/investor-portal/sectors/index.tsx"
],
"structure": "Cinco cartões com fotografia, título sobreposto, resumo e acção de leitura; botão central arredondado/contorno vermelho para o catálogo."
},
"analysisAndPlan": "docs/investmoz/public-portal-sections.md#sectores-da-home-e-catálogo-completo--23102026",
"filesChanged": [
"resources/js/components/public-sector-cards.tsx",
"resources/js/lib/portal-presentation.ts",
"resources/js/components/investment-context-cards.tsx",
"resources/js/lib/portal-api.ts",
"resources/js/pages/PortalInvestidor.tsx",
"resources/js/pages/portal/services.tsx",
"tools/portal-home-sectors-qa.mjs",
"docs/investmoz/public-portal-sections.md",
"docs/investmoz/v2/auditoria-portal/matriz-requisitos.csv"
],
"behaviour": {
"homePreview": 5,
"previewOrder": "Ordem recebida da API, sem novos filtros de publicação.",
"readMore": "Ler mais, para a URL recebida ou ficha existente /sectores/{slug}.",
"moreSectors": "Ver mais sectores, botão arredondado para /sectores.",
"catalogue": "Todos os sectores publicados devolvidos pelo cadastro existente; Voltar ao início para /.",
"specializations": "Fintech conservado como ligação própria; sem âncoras aninhadas.",
"countsAndDescriptions": "Preservados dados recebidos, incluindo zero e descrições ausentes; não importados textos ou registos do outro projecto.",
"headings": [
{
"title": "Encontre o contexto do seu investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Sectores de investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Como Investir",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Oportunidades em destaque",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Documentos essenciais",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Apoio ao Investidor",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
}
],
"supportCard": "Superfície clara para contraste com o título vermelho."
},
"assets": [
{
"source": "D:\\Projects\\Tempo_Investidor\\tempo-dashboard\\storage\\app\\public\\investor-portal\\sectors\\agronegocio.jpg",
"sourceBytes": 444057,
"original": "outputs/home-sectors-20261023/originals/agronegocio.jpg",
"sha256": "7337b689a6ad8b0b4c8d716ea356db14e22bd2982089825bb2382121ed3482f6",
"derivatives": [
{
"file": "public/images/sectors/agronegocio.webp",
"width": 960,
"height": 540,
"bytes": 110310,
"sha256": "3e9d3be22556300f880be39837f86e764e3d05433beff1da6694ef6cee1d5c34"
},
{
"file": "public/images/sectors/agronegocio-480.webp",
"width": 480,
"height": 270,
"bytes": 31592,
"sha256": "fd1f7624f7fd9224fc1c7bd11746806e419c645ba43c257b1edd9ba250cd47f1"
}
]
},
{
"source": "D:\\Projects\\Tempo_Investidor\\tempo-dashboard\\storage\\app\\public\\investor-portal\\sectors\\economia-azul.jpg",
"sourceBytes": 456892,
"original": "outputs/home-sectors-20261023/originals/economia-azul.jpg",
"sha256": "1a2c04d0d9ed4a26129553daefd2ee18f6d820026ab1203acf3bcf91b0550f69",
"derivatives": [
{
"file": "public/images/sectors/economia-azul.webp",
"width": 960,
"height": 540,
"bytes": 107626,
"sha256": "bf3751e66839c1b3c585c91ffe65d32b9ee79ebd7d08e5e2c95c6cd581b04f8f"
},
{
"file": "public/images/sectors/economia-azul-480.webp",
"width": 480,
"height": 270,
"bytes": 29350,
"sha256": "aaf8ee66709d8e15c4304690dd03830b4368d14468a597d5617ccdb71d614331"
}
]
},
{
"source": "D:\\Projects\\Tempo_Investidor\\tempo-dashboard\\storage\\app\\public\\investor-portal\\sectors\\energia.jpg",
"sourceBytes": 386678,
"original": "outputs/home-sectors-20261023/originals/energia.jpg",
"sha256": "a164e2c8ef155a6a198ae400feca132e79ba75e022473893ec48ebfa0557f679",
"derivatives": [
{
"file": "public/images/sectors/energia.webp",
"width": 960,
"height": 540,
"bytes": 81236,
"sha256": "b5605d9bb8645c5042baa511aaf39fcb187080a48d8e067b130fc974c4c9196d"
},
{
"file": "public/images/sectors/energia-480.webp",
"width": 480,
"height": 270,
"bytes": 21926,
"sha256": "7e53977fc6ce11755455f8092ac3f8c7126f54d909a3935e522f8dae0ab834be"
}
]
},
{
"source": "D:\\Projects\\Tempo_Investidor\\tempo-dashboard\\storage\\app\\public\\investor-portal\\sectors\\industria.jpg",
"sourceBytes": 357131,
"original": "outputs/home-sectors-20261023/originals/industria.jpg",
"sha256": "d70c4257ac58a4b5e9f8b8b1a4cf6d98c0514043442c3ce46f5c98399038527f",
"derivatives": [
{
"file": "public/images/sectors/industria.webp",
"width": 960,
"height": 540,
"bytes": 80422,
"sha256": "ca8ddd2d65647f1ed7a9906271fa2ea3d027f310b89434fd7781a37a3d18322d"
},
{
"file": "public/images/sectors/industria-480.webp",
"width": 480,
"height": 270,
"bytes": 25194,
"sha256": "8bd695231209c0042b94e68b0e2095fa7202297708dabff0f78b337500b8c9b7"
}
]
},
{
"source": "D:\\Projects\\Tempo_Investidor\\tempo-dashboard\\storage\\app\\public\\investor-portal\\sectors\\infraestruturas.jpg",
"sourceBytes": 395383,
"original": "outputs/home-sectors-20261023/originals/infraestruturas.jpg",
"sha256": "ac6cde89507af68991faebee19540f955146724d3be901839b85a4098fe1674b",
"derivatives": [
{
"file": "public/images/sectors/infraestruturas.webp",
"width": 960,
"height": 540,
"bytes": 86654,
"sha256": "14754a59477e5c62a62c190be812c89d9616608b3c98acb6100ad70d94d34df0"
},
{
"file": "public/images/sectors/infraestruturas-480.webp",
"width": 480,
"height": 270,
"bytes": 25772,
"sha256": "eca58096087d05dae3eea2b4d063c103f9fc85b0ea20fc5051313cf9bfa1020f"
}
]
},
{
"source": "D:\\Projects\\Tempo_Investidor\\tempo-dashboard\\storage\\app\\public\\investor-portal\\sectors\\logistica-transportes.jpg",
"sourceBytes": 413702,
"original": "outputs/home-sectors-20261023/originals/logistica-transportes.jpg",
"sha256": "5976ead23da0d4e7d5debf875262f0229d389826aaeb7e7be4ebbac3f5129a9e",
"derivatives": [
{
"file": "public/images/sectors/logistica-transportes.webp",
"width": 960,
"height": 540,
"bytes": 96254,
"sha256": "0d235e7bbd160cccd3f97daa3337d6b27fde49db9782ad2ba0599c6a83022b6c"
},
{
"file": "public/images/sectors/logistica-transportes-480.webp",
"width": 480,
"height": 270,
"bytes": 28816,
"sha256": "32f5137e0a7f6a7894b186edb2ca38f12cdfdca04dda3588de3969fb3d2e333a"
}
]
},
{
"source": "D:\\Projects\\Tempo_Investidor\\tempo-dashboard\\storage\\app\\public\\investor-portal\\sectors\\mineracao.jpg",
"sourceBytes": 415161,
"original": "outputs/home-sectors-20261023/originals/mineracao.jpg",
"sha256": "7e6d1e5a17d434456ad937680a6c5501bd33bd624d2cc7ebf4b643185a9440aa",
"derivatives": [
{
"file": "public/images/sectors/mineracao.webp",
"width": 960,
"height": 540,
"bytes": 96642,
"sha256": "12c93df378f54108b13260c10d29789564af7844cc84bcd9281d2be917d83354"
},
{
"file": "public/images/sectors/mineracao-480.webp",
"width": 480,
"height": 270,
"bytes": 26034,
"sha256": "be3e7763fb8cd2e02f576204269821c40d93a7c155d8088a5084064b7269e4d6"
}
]
},
{
"source": "D:\\Projects\\Tempo_Investidor\\tempo-dashboard\\storage\\app\\public\\investor-portal\\sectors\\outros-sectores.jpg",
"sourceBytes": 328152,
"original": "outputs/home-sectors-20261023/originals/outros-sectores.jpg",
"sha256": "4aaac0869dc7e61c4c7a87e1af95beb108aa9be0da082702f6f70722e62b1e7a",
"derivatives": [
{
"file": "public/images/sectors/outros-sectores.webp",
"width": 960,
"height": 540,
"bytes": 75414,
"sha256": "f47b3d0da5b0cd5153d393c6f779484ba89043e50195e968338108e893a88077"
},
{
"file": "public/images/sectors/outros-sectores-480.webp",
"width": 480,
"height": 270,
"bytes": 24936,
"sha256": "a4fc00551d75c96a1648ad4f81d759d4d6ecd7e6fc5689689216a96934bd1ea2"
}
]
},
{
"source": "D:\\Projects\\Tempo_Investidor\\tempo-dashboard\\storage\\app\\public\\investor-portal\\sectors\\servicos-financeiros.jpg",
"sourceBytes": 348386,
"original": "outputs/home-sectors-20261023/originals/servicos-financeiros.jpg",
"sha256": "f932a56248d5544bff92aa30f4af3a5a63044c311969d4370d06f157b097d570",
"derivatives": [
{
"file": "public/images/sectors/servicos-financeiros.webp",
"width": 960,
"height": 540,
"bytes": 72144,
"sha256": "15379485db7de7b2efebe8bdbd4cbd8e911eb34ab8a23b3dd114c849bb4ae65c"
},
{
"file": "public/images/sectors/servicos-financeiros-480.webp",
"width": 480,
"height": 270,
"bytes": 20698,
"sha256": "c21949201e35e63625d3d2e7520e10912fe65be1186954142b2784f6efca51ed"
}
]
},
{
"source": "D:\\Projects\\Tempo_Investidor\\tempo-dashboard\\storage\\app\\public\\investor-portal\\sectors\\tic-economia-digital.jpg",
"sourceBytes": 417398,
"original": "outputs/home-sectors-20261023/originals/tic-economia-digital.jpg",
"sha256": "b09703bd079f55fb5a8ec3167ce96e1fdb1e5090813a81c817b9a33909427d94",
"derivatives": [
{
"file": "public/images/sectors/tic-economia-digital.webp",
"width": 960,
"height": 540,
"bytes": 97892,
"sha256": "b1d79c1a941085582d6a72799140bafed1bf38ec0201a4dfe5f6faf54ea55ae8"
},
{
"file": "public/images/sectors/tic-economia-digital-480.webp",
"width": 480,
"height": 270,
"bytes": 28242,
"sha256": "c4279a27ed402ca2feb62f11a8a954cbcae993912d3c8c27a2d9644fdf922114"
}
]
},
{
"source": "D:\\Projects\\Tempo_Investidor\\tempo-dashboard\\storage\\app\\public\\investor-portal\\sectors\\turismo.jpg",
"sourceBytes": 393339,
"original": "outputs/home-sectors-20261023/originals/turismo.jpg",
"sha256": "1a76db252bc8c1a9dc1f3c650bd95e55337c36a6f604753d61cad96c19b1875f",
"derivatives": [
{
"file": "public/images/sectors/turismo.webp",
"width": 960,
"height": 540,
"bytes": 93234,
"sha256": "de46707dfdd8b98c48ec88d19f3df0b1d6c130adfcbd97d5a7c2e6fa2db62bef"
},
{
"file": "public/images/sectors/turismo-480.webp",
"width": 480,
"height": 270,
"bytes": 27012,
"sha256": "4d3d9a04b9426474dca9ba8895021b48fffbe7e4d4a4551272b8c832cf83488e"
}
]
}
],
"assetMapping": {
"agronegocio": "agronegocio",
"turismo": "turismo",
"infraestruturas": "infraestruturas",
"economia-azul": "economia-azul",
"mercado-financeiro": "servicos-financeiros",
"mineracao": "mineracao",
"energia-especifica": "energia",
"imobiliario": "outros-sectores",
"bens-de-consumo-e-franquias": "industria",
"tecnologias-de-informacao": "tic-economia-digital"
},
"assetSource": "JPG locais do projecto de referência indicado pelo proprietário, inventariados e copiados sem alteração; WebP derivados para apresentação. Sem alegação adicional de licença externa, origem oficial ou localização documental. Imagem genérica reutilizada como alternativa funcional e para sectores sem imagem específica.",
"assetBytes960": 997828,
"assetBytes480": 289572,
"verification": {
"browser": {
"results": [
{
"width": 320,
"homeSectors": 5,
"catalogueSectors": 10,
"homeColumns": 2,
"headings": [
{
"title": "Encontre o contexto do seu investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Sectores de investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Como Investir",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Oportunidades em destaque",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Documentos essenciais",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Apoio ao Investidor",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
}
],
"status": "passed"
},
{
"width": 390,
"homeSectors": 5,
"catalogueSectors": 10,
"homeColumns": 2,
"headings": [
{
"title": "Encontre o contexto do seu investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Sectores de investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Como Investir",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Oportunidades em destaque",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Documentos essenciais",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Apoio ao Investidor",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
}
],
"status": "passed"
},
{
"width": 768,
"homeSectors": 5,
"catalogueSectors": 10,
"homeColumns": 3,
"headings": [
{
"title": "Encontre o contexto do seu investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Sectores de investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Como Investir",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Oportunidades em destaque",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Documentos essenciais",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Apoio ao Investidor",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
}
],
"status": "passed"
},
{
"width": 1024,
"homeSectors": 5,
"catalogueSectors": 10,
"homeColumns": 5,
"headings": [
{
"title": "Encontre o contexto do seu investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Sectores de investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Como Investir",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Oportunidades em destaque",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Documentos essenciais",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Apoio ao Investidor",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
}
],
"status": "passed"
},
{
"width": 1440,
"homeSectors": 5,
"catalogueSectors": 10,
"homeColumns": 5,
"headings": [
{
"title": "Encontre o contexto do seu investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Sectores de investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Como Investir",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Oportunidades em destaque",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Documentos essenciais",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Apoio ao Investidor",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
}
],
"status": "passed"
},
{
"width": 1920,
"homeSectors": 5,
"catalogueSectors": 10,
"homeColumns": 5,
"headings": [
{
"title": "Encontre o contexto do seu investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Sectores de investimento",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Como Investir",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Oportunidades em destaque",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Documentos essenciais",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
},
{
"title": "Apoio ao Investidor",
"size": "24px",
"weight": "700",
"color": "rgb(237, 28, 36)",
"lineHeight": "32px"
}
],
"status": "passed"
},
{
"fail": "primary",
"status": "passed"
},
{
"fail": "all",
"status": "passed"
},
{
"emptyCatalogue": true,
"status": "passed"
}
],
"errors": [],
"navigation": [
"/sectores",
"/sectores",
"/sectores",
"/sectores",
"/sectores",
"/sectores/agronegocio",
"/sectores",
"/sectores/turismo",
"/sectores",
"/sectores/infraestruturas",
"/sectores",
"/sectores/economia-azul",
"/sectores",
"/sectores/mercado-financeiro",
"/sectores",
"/sectores/mineracao",
"/sectores",
"/sectores/energia-especifica",
"/sectores",
"/sectores/imobiliario",
"/sectores",
"/sectores/bens-de-consumo-e-franquias",
"/sectores",
"/sectores/tecnologias-de-informacao",
"/sectores",
"/sectores/mercado-financeiro/fintech",
"/sectores",
"/",
"/sectores",
"/sectores"
],
"databaseAccess": false
},
"script": "tools/portal-home-sectors-qa.mjs",
"screenshots": [
"outputs/home-sectors-20261023/catalogue-1024.png",
"outputs/home-sectors-20261023/catalogue-1440.png",
"outputs/home-sectors-20261023/catalogue-1920.png",
"outputs/home-sectors-20261023/catalogue-320.png",
"outputs/home-sectors-20261023/catalogue-390.png",
"outputs/home-sectors-20261023/catalogue-768.png",
"outputs/home-sectors-20261023/fallback-all.png",
"outputs/home-sectors-20261023/fallback-primary.png",
"outputs/home-sectors-20261023/home-sectors-1024.png",
"outputs/home-sectors-20261023/home-sectors-1440.png",
"outputs/home-sectors-20261023/home-sectors-1920.png",
"outputs/home-sectors-20261023/home-sectors-320.png",
"outputs/home-sectors-20261023/home-sectors-390.png",
"outputs/home-sectors-20261023/home-sectors-768.png",
"outputs/home-sectors-20261023/homepage-1440.png"
],
"existingFrontendTests": {
"command": "node --test tests/frontend/portal-api.test.mjs tests/frontend/portal-navigation.test.mjs",
"passed": 20
},
"types": {
"command": "npm run types:check",
"exitCode": 0
},
"lint": {
"exitCode": 0
},
"build": {
"command": "npm run build",
"exitCode": 0,
"assets": {
"resources/js/pages/PortalInvestidor.tsx": "assets/PortalInvestidor-Q1OJxvfZ.js",
"resources/js/pages/portal/services.tsx": "assets/services-DiuG4Zkv.js"
},
"log": "outputs/home-sectors-20261023/build-local.log"
}
},
"scope": {
"appliedLocally": true,
"databaseChanged": false,
"migrationsRun": false,
"businessRulesChanged": false,
"routesChanged": false,
"sourceProjectChanged": false,
"newDependencies": false,
"externalDeployment": false
},
"limits": "Interface e navegação exercitadas com API e páginas públicas em fixtures; não equivale a demonstração integral dos workflows operacionais ou de critérios mais amplos da matriz.",
"matrixReferences": [
"MASTER-efd550fd-0104",
"MASTER-9f5719c8-0077"
]
}
@@ -0,0 +1,406 @@
{
"date": "2026-10-23",
"decision": "Pedido expresso da Tempo: analisar e acrescentar imagens adequadas exclusivamente aos três cartões de Como Investir.",
"analysisAndPlan": "docs/investmoz/public-portal-sections.md#fotografias-nas-etapas-de-como-investir--23102026",
"source": {
"type": "Fotografias ilustrativas geradas por IA, sem atribuição a pessoas, instituições, locais ou projectos reais.",
"tool": "image_gen, modo integrado",
"skill": "C:/Users/jorge/.codex/skills/.system/imagegen/SKILL.md",
"externalPhotographsUsed": false
},
"images": [
{
"key": "explorar",
"prompt": "Use case: photorealistic-natural. Asset for a small navigation card on a Mozambique investor portal. Create one individual photorealistic editorial photograph, horizontal 16:9, professional restrained style, natural soft daylight, realistic skin and materials, neutral colors, documentary composition readable at 350px wide. Illustration of a plausible setting, no identifiable named project or official building. No text, lettering, logos, watermarks, flags, maps, diagrams, graphic overlays, montage, or advertisement styling. Keep main subject inside the central 80% for responsive crop. Stage 1 EXPLORE opportunities, sector and territory: two Mozambican business professionals, a woman and man in smart casual clothing, standing outdoors by a quiet access road at a modest business park, naturally discussing a tablet held by the woman. Generic unbranded low warehouse buildings and green productive land visible in background, credible southern African environment. Eye-level medium-wide candid composition, both people three-quarter view, looking at tablet and surroundings rather than camera. Business evaluation and discovery, no construction work or hard hats.",
"source": "C:\\Users\\jorge\\.codex\\generated_images\\01a167bd-3f26-71a0-8ec3-3f17519d2bfd\\exec-42eb9338-4350-40bf-9098-858c12994189.png",
"original": "outputs/investment-steps-20261023/originals/explorar.png",
"originalSha256": "a3c4ec1a0d2deaf87e0c8e765616c74ab70067eade9a862effce9e6befbbccb6",
"originalDimensions": {
"width": 1672,
"height": 941
},
"derivatives": [
{
"file": "public/images/investment-steps/explorar.webp",
"width": 960,
"height": 540,
"bytes": 52266,
"sha256": "c3e151ae649ce3cb66f5babc39978fa5803d320cacc95a27e798db4ec2d45a4c"
},
{
"file": "public/images/investment-steps/explorar-480.webp",
"width": 480,
"height": 270,
"bytes": 19312,
"sha256": "d3f383d9a58b23fada37472ea853f985aca8c3146123747d777b27704d32c7e0"
},
{
"file": "public/images/investment-steps/explorar-fallback.webp",
"width": 240,
"height": 135,
"bytes": 5300,
"sha256": "ba12ac4d2e81ac8a2c2e681667ccb08a3abfdba24de39e6e942d6378b700f2a9"
}
]
},
{
"key": "preparar",
"prompt": "Use case: photorealistic-natural. Asset for a small navigation card on a Mozambique investor portal. Create one individual photorealistic editorial photograph, horizontal 16:9, professional restrained style, natural soft daylight, realistic skin and materials, neutral colors, documentary composition readable at 350px wide. Illustration of a plausible setting, no identifiable named project or official building. No text, lettering, logos, watermarks, flags, maps, diagrams, graphic overlays, montage, or advertisement styling. Keep main subject inside the central 80% for responsive crop. Stage 2 PREPARE investment and organize documents: a Mozambican woman entrepreneur and a male business adviser seated at a light wood office desk, calmly reviewing and sorting a small tidy set of document folders and loose sheets beside a closed laptop. One points to a page while the other organizes a folder. No visible readable writing or personal data; papers at an angle. Bright modest professional meeting room, view from slightly above table height, hands and folders clear in foreground, natural candid interaction, realistic anatomy.",
"source": "C:\\Users\\jorge\\.codex\\generated_images\\01a167bd-3f26-71a0-8ec3-3f17519d2bfd\\exec-5f07618a-1e86-42d9-aaf8-3acd0abf2164.png",
"original": "outputs/investment-steps-20261023/originals/preparar.png",
"originalSha256": "679a6875bb3ec79a9b71c27c9d785334376746be2bb305f461db9e19b0a0b7ea",
"originalDimensions": {
"width": 1672,
"height": 941
},
"derivatives": [
{
"file": "public/images/investment-steps/preparar.webp",
"width": 960,
"height": 540,
"bytes": 57942,
"sha256": "6de28042d3abce238a3680fb878779682f3672c3feb97b7e42b72e9a0a0ffbac"
},
{
"file": "public/images/investment-steps/preparar-480.webp",
"width": 480,
"height": 270,
"bytes": 19950,
"sha256": "671ba0fc207f85833b91027d3f6dad91599e95702cfea439e558906f92a2bfac"
},
{
"file": "public/images/investment-steps/preparar-fallback.webp",
"width": 240,
"height": 135,
"bytes": 6008,
"sha256": "645b34cd60b31fdc8e6586dedb71061c08add9ff985ce90909333b0bd1e0aa3e"
}
]
},
{
"key": "acompanhar",
"prompt": "Use case: photorealistic-natural. Asset for a small navigation card on a Mozambique investor portal. Create one individual photorealistic editorial photograph, horizontal 16:9, professional restrained style, natural soft daylight, realistic skin and materials, neutral colors, documentary composition readable at 350px wide. Illustration of a plausible setting, no identifiable named project or official building. No text, lettering, logos, watermarks, flags, maps, diagrams, graphic overlays, montage, or advertisement styling. Keep main subject inside the central 80% for responsive crop. Stage 3 FOLLOW UP submitted request and protocol: a Mozambican male entrepreneur seated at a tidy desk using a laptop to check an online application, one hand naturally on trackpad, a small closed document folder nearby. Three-quarter side view showing focused face and laptop, warm daylight from side window, modest contemporary office with soft greenery out of focus. Laptop screen is oblique and softly out of focus with only indistinct neutral interface rows, no readable text, official seal, logo or invented dashboard details. Convey calm digital self-service and progress checking, not a call centre or signing documents.",
"source": "C:\\Users\\jorge\\.codex\\generated_images\\01a167bd-3f26-71a0-8ec3-3f17519d2bfd\\exec-f896c5f8-19a0-49b0-af8e-0d12bfe4c7aa.png",
"original": "outputs/investment-steps-20261023/originals/acompanhar.png",
"originalSha256": "17d453445f2afb4c7641909950d2ecfb8276c433a4e28eeee94d0a57d1bdad46",
"originalDimensions": {
"width": 1672,
"height": 941
},
"derivatives": [
{
"file": "public/images/investment-steps/acompanhar.webp",
"width": 960,
"height": 540,
"bytes": 43722,
"sha256": "fe764c8161de36ee597f856face5341260670d1a28ab482bd01a0f5120ad0588"
},
{
"file": "public/images/investment-steps/acompanhar-480.webp",
"width": 480,
"height": 270,
"bytes": 16176,
"sha256": "79ceaecb0ef23c6729e43d04b7e91493d6784ea9f658d540dda3550702dc3623"
},
{
"file": "public/images/investment-steps/acompanhar-fallback.webp",
"width": 240,
"height": 135,
"bytes": 5298,
"sha256": "cd4530cfef4f19f23f640ceae59cfd73d0ee269643118b458f2a4748f5845fc6"
}
]
}
],
"cards": [
{
"title": "1. Explorar",
"description": "Identifique o sector, território e oportunidade.",
"href": "/oportunidades",
"image": "explorar"
},
{
"title": "2. Preparar",
"description": "Conheça o percurso e organize os documentos.",
"href": "/como-investir",
"image": "preparar"
},
{
"title": "3. Acompanhar",
"description": "Envie o pedido e acompanhe o protocolo.",
"href": "/balcao-virtual",
"image": "acompanhar"
}
],
"presentation": {
"component": "resources/js/components/investment-steps.tsx",
"homeIntegration": "resources/js/pages/PortalInvestidor.tsx",
"aspectRatio": "16:9",
"responsiveImages": [
960,
480
],
"fallback": "Variante própria de 240 px; se também falhar, espaço reservado com descrição acessível e Imagem indisponível.",
"columns": "Uma coluna abaixo de 768 px, três a partir de 768 px.",
"compactText": "16 px de preenchimento, sem altura mínima de texto.",
"accessibility": "Alt em português, nomes e descrições das âncoras, foco visível, dimensões reservadas e loading lazy.",
"headings": "Título vermelho partilhado da home preservado."
},
"verification": {
"browser": {
"results": [
{
"width": 320,
"dpr": 1,
"fail": "none",
"columns": 1,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-steps/explorar-480.webp",
"alt": "Dois profissionais avaliam uma oportunidade de investimento no terreno com apoio de um tablet.",
"lazy": "lazy",
"ratio": 1.7820512820512822
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/preparar-480.webp",
"alt": "Empreendedora e consultor analisam documentos e organizam pastas numa reunião de preparação.",
"lazy": "lazy",
"ratio": 1.7820512820512822
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/acompanhar-480.webp",
"alt": "Empreendedor consulta um pedido no computador portátil numa secretária de escritório.",
"lazy": "lazy",
"ratio": 1.7820512820512822
}
],
"layoutShift": false,
"overflow": false
},
{
"width": 390,
"dpr": 2,
"fail": "none",
"columns": 1,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-steps/explorar.webp",
"alt": "Dois profissionais avaliam uma oportunidade de investimento no terreno com apoio de um tablet.",
"lazy": "lazy",
"ratio": 1.7755102040816326
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/preparar.webp",
"alt": "Empreendedora e consultor analisam documentos e organizam pastas numa reunião de preparação.",
"lazy": "lazy",
"ratio": 1.7755102040816326
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/acompanhar.webp",
"alt": "Empreendedor consulta um pedido no computador portátil numa secretária de escritório.",
"lazy": "lazy",
"ratio": 1.7755102040816326
}
],
"layoutShift": false,
"overflow": false
},
{
"width": 768,
"dpr": 1,
"fail": "none",
"columns": 3,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-steps/explorar-480.webp",
"alt": "Dois profissionais avaliam uma oportunidade de investimento no terreno com apoio de um tablet.",
"lazy": "lazy",
"ratio": 1.7734375
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/preparar-480.webp",
"alt": "Empreendedora e consultor analisam documentos e organizam pastas numa reunião de preparação.",
"lazy": "lazy",
"ratio": 1.7734375
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/acompanhar-480.webp",
"alt": "Empreendedor consulta um pedido no computador portátil numa secretária de escritório.",
"lazy": "lazy",
"ratio": 1.7734375
}
],
"layoutShift": false,
"overflow": false
},
{
"width": 1024,
"dpr": 1,
"fail": "none",
"columns": 3,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-steps/explorar-480.webp",
"alt": "Dois profissionais avaliam uma oportunidade de investimento no terreno com apoio de um tablet.",
"lazy": "lazy",
"ratio": 1.7784090909090908
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/preparar-480.webp",
"alt": "Empreendedora e consultor analisam documentos e organizam pastas numa reunião de preparação.",
"lazy": "lazy",
"ratio": 1.7784090909090908
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/acompanhar-480.webp",
"alt": "Empreendedor consulta um pedido no computador portátil numa secretária de escritório.",
"lazy": "lazy",
"ratio": 1.7784090909090908
}
],
"layoutShift": false,
"overflow": false
},
{
"width": 1440,
"dpr": 2,
"fail": "none",
"columns": 3,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-steps/explorar.webp",
"alt": "Dois profissionais avaliam uma oportunidade de investimento no terreno com apoio de um tablet.",
"lazy": "lazy",
"ratio": 1.775
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/preparar.webp",
"alt": "Empreendedora e consultor analisam documentos e organizam pastas numa reunião de preparação.",
"lazy": "lazy",
"ratio": 1.775
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/acompanhar.webp",
"alt": "Empreendedor consulta um pedido no computador portátil numa secretária de escritório.",
"lazy": "lazy",
"ratio": 1.775
}
],
"layoutShift": false,
"overflow": false
},
{
"width": 1920,
"dpr": 1,
"fail": "none",
"columns": 3,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-steps/explorar-480.webp",
"alt": "Dois profissionais avaliam uma oportunidade de investimento no terreno com apoio de um tablet.",
"lazy": "lazy",
"ratio": 1.775
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/preparar-480.webp",
"alt": "Empreendedora e consultor analisam documentos e organizam pastas numa reunião de preparação.",
"lazy": "lazy",
"ratio": 1.775
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/acompanhar-480.webp",
"alt": "Empreendedor consulta um pedido no computador portátil numa secretária de escritório.",
"lazy": "lazy",
"ratio": 1.775
}
],
"layoutShift": false,
"overflow": false
},
{
"width": 390,
"dpr": 2,
"fail": "primary",
"columns": 1,
"photos": [
{
"src": "http://127.0.0.1:5174/images/investment-steps/explorar-fallback.webp",
"alt": "Dois profissionais avaliam uma oportunidade de investimento no terreno com apoio de um tablet.",
"lazy": "lazy",
"ratio": 1.7755102040816326
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/preparar-fallback.webp",
"alt": "Empreendedora e consultor analisam documentos e organizam pastas numa reunião de preparação.",
"lazy": "lazy",
"ratio": 1.7755102040816326
},
{
"src": "http://127.0.0.1:5174/images/investment-steps/acompanhar-fallback.webp",
"alt": "Empreendedor consulta um pedido no computador portátil numa secretária de escritório.",
"lazy": "lazy",
"ratio": 1.7755102040816326
}
],
"layoutShift": false,
"overflow": false
},
{
"width": 390,
"dpr": 2,
"fail": "all",
"columns": 1,
"photos": [],
"layoutShift": false,
"overflow": false
}
],
"errors": [],
"navigation": [
"/oportunidades",
"/como-investir",
"/balcao-virtual"
],
"databaseAccess": false
},
"script": "outputs/investment-steps-20261023/check.mjs",
"screenshots": [
"outputs/investment-steps-20261023/cards-1024-none.png",
"outputs/investment-steps-20261023/cards-1440-none.png",
"outputs/investment-steps-20261023/cards-1920-none.png",
"outputs/investment-steps-20261023/cards-320-none.png",
"outputs/investment-steps-20261023/cards-390-all.png",
"outputs/investment-steps-20261023/cards-390-none.png",
"outputs/investment-steps-20261023/cards-390-primary.png",
"outputs/investment-steps-20261023/cards-768-none.png"
],
"lint": {
"exitCode": 0
},
"types": {
"command": "npm run types:check",
"exitCode": 0,
"log": "outputs/investment-steps-20261023/types.log"
},
"build": {
"command": "npm run build",
"exitCode": 0,
"homeAsset": "assets/PortalInvestidor-C1QTZ3-t.js",
"log": "outputs/investment-steps-20261023/build-local.log"
}
},
"scope": {
"appliedLocally": true,
"otherSectionsChanged": false,
"supportAndFooterChanged": false,
"databaseAccess": false,
"businessRulesChanged": false,
"routesChanged": false,
"newDependencies": false,
"externalDeployment": false
},
"matrixReferences": [
"MASTER-efd550fd-0104"
],
"limits": "Componentes reais com API sintética e destinos interceptados para verificar a navegação; não demonstra os workflows operacionais completos nem encerra o critério mais amplo da matriz."
}
@@ -1646,5 +1646,360 @@
], ],
"return_evidence_id": "43317c22-50c8-40cf-98e4-e5d4d108c372", "return_evidence_id": "43317c22-50c8-40cf-98e4-e5d4d108c372",
"B_recovered_context_revision": 2 "B_recovered_context_revision": 2
},
"context_review_and_adaptive_path_preparation_20261022": {
"reviewed_commit": "a76369eb",
"review_status": "complete within accepted increment scope; no integration executed",
"last_return_equivalent_evidence": "43317c22-50c8-40cf-98e4-e5d4d108c372",
"accepted_AB_repeated": false,
"next_lot": "Preparação de pedido de investimento privado: condição, fonte/período, formulário, percurso, cálculo e lacuna",
"next_lot_status": "documented, not implemented or demonstrated end-to-end",
"source_url": "https://pt.apiex.gov.mz/wp-content/uploads/2025/02/LEGISLACAO-DE-INVESTIMENTOS-EM-MOCAMBIQUE.pdf",
"source_sha256": "ba1e9eaabfec5d0c4cb2d9f2444a6860f7a90f222034764197829be402d408ed",
"new_fiscal_rule_activation": false,
"next_acceptance": "Only synthetic C condition transitions and dossier/report links; reuse accepted context and IVA evidence"
},
"private_investment_executable_20261022": {
"base": "52fbb146",
"branch": "codex/private-investment-path-executable-QA",
"status": "implemented and verified in isolated QA; not integrated",
"source_version": "private-investment-preparation-2026-v1",
"orientation": "Tempo 22/10: official sources execute without generic additional legal approval; permanent AGENTS updated",
"qa_url": "http://127.0.0.1:18580/investimentos/4133311b-5426-4cec-900d-1f1484484083",
"persistence": {
"case_id": "4133311b-5426-4cec-900d-1f1484484083",
"case_version": 8,
"context_revision": 4,
"mode": "registration",
"association": {
"lease": "e5ce142a-1178-46a2-b039-f187139c62cd"
},
"documents": 1,
"context_events": 4,
"draft_id": "beba1dec-fc05-4820-b099-24952c5ab36c",
"draft_version": 4,
"draft_sha256": "4136e82a3b9420ab8f980ec0d7bda6dc2a67b568c18535b5ba0ecc80efd37e37",
"saved_context_revision": 3,
"saved_preparation_mode": "authorization",
"currency": "MZN",
"date": "2026-01-01",
"preparation_version": "private-investment-preparation-2026-v1"
},
"new_checks": {
"feature_tests": 3,
"assertions": 96,
"frontend_delta_tests": 1,
"typescript": "passed",
"build": "passed"
},
"evidence_sha256": {
"C-authorization-preview.png": "311c9f14ac601429666ded55c5906aa8ab018b5d31a1f101b4fb32697adf0817",
"C-final-directness-preview.png": "2037958e2879fb184cac1c4aa07ddc367417dbd1541d979c4e653a63918cdaca",
"C-final-path.png": "0c3c0900d861724b6def3f5850bd6c6c0f65dfee7cb01d6bb7c72c8bf645645a",
"C-persistence-v3.json": "b8faad9a5d4d9174a489a7b1096104f3a91645201b221b1ad7ece4a217180e00",
"C-persistence.json": "6b6120c88f41cff43b185905fdfec992ca76b359d0eab6bc1df02dee064c780d",
"C-recovered-path.png": "c734d119b0f766d8600892713be473d1c1875cb6ff4474b6fceabef702a3490b",
"C-report-check.json": "217b56b89041e6c8c05907af48c48dadf4f8316a2cce0f9195daf828258cb503",
"C-report.docx": "28cfe4b75116c892d3e29fde389de7d067b456761756bab732af625178ee69ce"
},
"report": {
"path": "C:\\Mac\\Home\\Downloads\\relatorio-investmoz-sintetico-qa-c-pedido-de-investimento-privado.docx",
"size": 16674,
"sha256": "28cfe4b75116c892d3e29fde389de7d067b456761756bab732af625178ee69ce"
},
"tool_limitation": "Download observation timed out and browser debugger detached; completed DOCX found in Downloads, verified before any retry; no repeated export",
"reused": "Accepted A/B, decimal calculation, CSV, exporters and native PDF pagination",
"main_integrated": false,
"homologation_changed": false,
"fiscal_rule_published_or_activated": false,
"limitations": [
"Only 2026 private investment preparation, documented registration/authorization conditions",
"No administrative submission or entitlement decision",
"No full sector licensing, foreign-currency equivalence or fiscal benefits engine",
"ZEE/ZFI routing predicate uses QA references; no real zone visual recognition proof",
"Dossier attachment association does not approve content; synthetic C fixture pending scan not delivered as seed",
"Final C context v4 registration differs from frozen draft/report context v3 authorization; no silent rewrite or repeated export."
],
"historical_report_persistence": {
"case_id": "4133311b-5426-4cec-900d-1f1484484083",
"case_version": 7,
"context_revision": 3,
"mode": "authorization",
"association": {
"lease": "e5ce142a-1178-46a2-b039-f187139c62cd"
},
"documents": 1,
"context_events": 3,
"draft_id": "beba1dec-fc05-4820-b099-24952c5ab36c",
"draft_version": 4,
"draft_sha256": "4136e82a3b9420ab8f980ec0d7bda6dc2a67b568c18535b5ba0ecc80efd37e37",
"saved_context_revision": 3,
"saved_preparation_mode": "authorization",
"currency": "MZN",
"date": "2026-01-01",
"preparation_version": "private-investment-preparation-2026-v1"
},
"directness_control": "Lei 8/2023 art14(b), R13: direct declared before using direct-investment monetary threshold; indirect/unknown unresolved only for dependent results; PPP independent condition remains executable"
},
"private_investment_report_alignment_20261022": {
"functional_revision": "a1fbda06",
"status": "targeted missing evidence completed; no functional code changes",
"current_persistence": {
"case_id": "4133311b-5426-4cec-900d-1f1484484083",
"case_version": 8,
"context_revision": 4,
"mode": "registration",
"association": {
"lease": "e5ce142a-1178-46a2-b039-f187139c62cd"
},
"documents": 1,
"context_events": 4,
"draft_id": "beba1dec-fc05-4820-b099-24952c5ab36c",
"draft_version": 5,
"draft_sha256": "ba824fe0362ca87b301da55298122796f44fdfb11507830b3fe8f54cf88d132d",
"saved_context_revision": 4,
"saved_preparation_mode": "registration",
"currency": "MZN",
"date": "2026-01-01",
"preparation_version": "private-investment-preparation-2026-v1"
},
"reports": {
"historic_v3": {
"path": "C:\\Mac\\Home\\Downloads\\relatorio-investmoz-sintetico-qa-c-pedido-de-investimento-privado.docx",
"sha256": "28cfe4b75116c892d3e29fde389de7d067b456761756bab732af625178ee69ce",
"bytes": 16674,
"rows": [
[
"Contexto do investimento",
"Revisão 3; sem ZEE, ZFI ou parque seleccionado",
"Contexto versionado; não é reconhecimento jurídico. Referência do mesmo dossier no momento da gravação"
],
[
"Preparação do investimento privado",
"Pedido de autorização",
"Declarações e requisitos de preparação; sem aprovação jurídica. Contexto congelado v3; private-investment-preparation-2026-v1"
],
[
"Estudo de viabilidade técnica e económico-financeira",
"Documento por associar",
"Preparação informativa — simulação, sem submissão à Administração. Integra a preparação do pedido de autorização. R14(1)–(2); https://pt.apiex.gov.mz/wp-content/uploads/2025/02/LEGISLACAO-DE-INVESTIMENTOS-EM-MOCAMBIQUE.pdf#page=45"
],
[
"Comprovação da capacidade financeira",
"Documento por associar",
"Preparação informativa — simulação, sem submissão à Administração. Integra a preparação do pedido de autorização. R14(1)–(2); https://pt.apiex.gov.mz/wp-content/uploads/2025/02/LEGISLACAO-DE-INVESTIMENTOS-EM-MOCAMBIQUE.pdf#page=45"
]
]
},
"current_v4": {
"path": "C:\\Mac\\Home\\Downloads\\relatorio-investmoz-sintetico-qa-c-pedido-de-investimento-privado (1).docx",
"sha256": "a2849427f4a91fa6ab78e433be8b919baca80a0f4f452a4546a5b169b921d753",
"bytes": 16678,
"rows": [
[
"Contexto do investimento",
"Revisão 4; sem ZEE, ZFI ou parque seleccionado",
"Contexto versionado; não é reconhecimento jurídico. Referência do mesmo dossier no momento da gravação"
],
[
"Preparação do investimento privado",
"Pedido de mero registo",
"Declarações e requisitos de preparação; sem aprovação jurídica. Contexto congelado v4; private-investment-preparation-2026-v1"
],
[
"Estudo de viabilidade técnica e económico-financeira",
"Não aplicável; histórico preservado",
"Preparação informativa — simulação, sem submissão à Administração. Integra a preparação do pedido de autorização. R14(1)–(2); https://pt.apiex.gov.mz/wp-content/uploads/2025/02/LEGISLACAO-DE-INVESTIMENTOS-EM-MOCAMBIQUE.pdf#page=45"
],
[
"Comprovação da capacidade financeira",
"Não aplicável; histórico preservado",
"Preparação informativa — simulação, sem submissão à Administração. Integra a preparação do pedido de autorização. R14(1)–(2); https://pt.apiex.gov.mz/wp-content/uploads/2025/02/LEGISLACAO-DE-INVESTIMENTOS-EM-MOCAMBIQUE.pdf#page=45"
]
]
}
},
"proof_sha256": {
"C-report-HISTORICO-contexto-v3.docx": "28cfe4b75116c892d3e29fde389de7d067b456761756bab732af625178ee69ce",
"C-report-contexto-v4.docx": "a2849427f4a91fa6ab78e433be8b919baca80a0f4f452a4546a5b169b921d753",
"C-report-v3-v4-comparison.json": "722154fd38b2915ec087f804abe66bc4c98c6eff2c4403d8e670d65d257e3446",
"C-persistence-v4-draft5.json": "a10505a52c553b4c0e03ece59d20d5a0a20204ae694bcf7174ee0574272ec1c4",
"C-new-report-context-v4.png": "b0cf159e6be5a457efdc46eb5e273895c43010caa9727e3b75668f916aa11f8d"
},
"historic_label": "C-report-HISTORICO-contexto-v3.docx; original bytes unchanged, embedded Contexto congelado v3",
"current_label": "C-report-contexto-v4.docx; embedded Contexto congelado v4; registration; study/capacity not applicable",
"accepted_tests_repeated": false,
"integration_dependencies": [
"a76369eb common continuity, required ancestor of a1fbda06",
"52fbb146 documentary intermediate, no executable delta",
"a1fbda06 adaptive private-investment functionality",
"Current branch includes ancestors; do not cherry-pick a1fbda06 alone without a76369eb/equivalent changes"
],
"integration_procedure": "After Tempo evaluation/decision, fetch current main, merge preserving concurrent changes and review actual conflicts. a76369eb can integrate independently first; shared ancestry avoids duplicate application. No reset or force-push main. Confirm deployed revision and only changed destination behavior. PRIVATE_INVESTMENT_PREPARATION_ENABLED is separate from tax publication/activation.",
"remote_main_read": "57fc914821d0cefa02caa80a74b3d42e663f2742",
"main_integrated": false,
"fiscal_rules_changed": false
},
"adaptive_private_path_homologation_20261022": {
"authorized_by": "Tempo, user authorization 22/10/2026",
"previous_main": "57fc914821d0cefa02caa80a74b3d42e663f2742",
"authorized_ancestry": [
"a76369eb",
"52fbb146",
"a1fbda06",
"064296e1"
],
"integration": "fast-forward, no conflicts or concurrent commits observed at push; no forced update",
"first_attempt": {
"status": "failed",
"commit": "064296e1fbf7b17f932df23c7b3ee5508719dec5",
"error": "Verification command failed: node (see protected build log)",
"active_release_preserved": true,
"requested_commits": [
"064296e1fbf7b17f932df23c7b3ee5508719dec5"
],
"finished_at": "2026-10-22T08:11:54.420414+00:00"
},
"compatibility_fix": {
"commit": "042ffbde44cac27704d6f8b7ec25b525a42e3575",
"cause": "Empty inheritance metadata appended when restoring a legacy draft with no compatible source",
"change": "Return original draft when both compatible source and prior inheritance metadata are absent",
"targeted_tests": "9 inheritance controls + exact failing legacy partition/recovery test, all passed"
},
"installed": {
"status": "installed",
"commit": "042ffbde44cac27704d6f8b7ec25b525a42e3575",
"release": "/var/www/investmoz-homologacao/releases/042ffbde44cac27704d6f8b7ec25b525a42e3575-6dfae60c",
"previous_release": "/var/www/investmoz-homologacao/releases/57fc914821d0cefa02caa80a74b3d42e663f2742-f563f9a7",
"database_migrations": 0,
"content_imports": 0,
"requested_commits": [
"042ffbde44cac27704d6f8b7ec25b525a42e3575"
],
"finished_at": "2026-10-22T08:16:16.903501+00:00"
},
"http": {
"/build/revision.json": {
"status": 200,
"body": {
"commit": "042ffbde44cac27704d6f8b7ec25b525a42e3575",
"branch": "main",
"built_at": "2026-10-22T08:16:14.331119+00:00",
"manifest_sha256": "655eef6e6a5e71c5138c68465a5b2ffc36d2cadeff96e6b35682dbfd19d42e79"
}
},
"/api/v1/fiscal-consumer": {
"status": 200,
"body": {
"data": {
"enabled": true,
"coverage_start": "2026-01-01",
"coverage_end": "2026-12-31",
"message": "IVA geral sobre base líquida disponível; enquadramento declarado."
}
}
},
"/investimentos": {
"status": 302,
"location": "https://teste-investidor.tempo.co.mz/login"
},
"/simulador-fiscal": {
"status": 200,
"body": "HTML available"
},
"checked_utc": "2026-10-22T08:17:20.250804+00:00"
},
"configuration_before": {
"read_only": true,
"utc": "2026-10-22T08:16:34.265947+00:00",
"revision": {
"commit": "042ffbde44cac27704d6f8b7ec25b525a42e3575",
"branch": "main",
"built_at": "2026-10-22T08:16:14.331119+00:00",
"manifest_sha256": "655eef6e6a5e71c5138c68465a5b2ffc36d2cadeff96e6b35682dbfd19d42e79"
},
"live": "/var/www/investmoz-homologacao/releases/042ffbde44cac27704d6f8b7ec25b525a42e3575-6dfae60c",
"env_path": "/var/www/html/teste-investidor.tempo.co.mz/.env",
"env_sha256": "7cdaba591bb5787485a349c24db2fd7c8279436da0eb31502e44db2fffa21d03",
"env_mode": "0o640",
"uid": 1001,
"gid": 33,
"private_preparation_env": "unset",
"config": {
"private_preparation": false,
"investor_path": true,
"fiscal_consumer": {
"enabled": true,
"coverage_start": "2026-01-01",
"coverage_end": "2026-12-31",
"message": "IVA geral sobre base líquida disponível; enquadramento declarado."
},
"preparation_version": "private-investment-preparation-2026-v1"
}
},
"configuration_enable": {
"utc": "2026-10-22T08:16:49.343216+00:00",
"revision": {
"commit": "042ffbde44cac27704d6f8b7ec25b525a42e3575",
"branch": "main",
"built_at": "2026-10-22T08:16:14.331119+00:00",
"manifest_sha256": "655eef6e6a5e71c5138c68465a5b2ffc36d2cadeff96e6b35682dbfd19d42e79"
},
"changed": true,
"env_before_sha256": "7cdaba591bb5787485a349c24db2fd7c8279436da0eb31502e44db2fffa21d03",
"env_after_sha256": "a6b4e9064cf6dbb2d945b53418a6c9252f9c736ff3fde4016b95b74885a9ee0f",
"backup": "/var/lib/investmoz-deploy/backups/private-preparation-20261022/env-7cdaba591bb5787485a349c24db2fd7c8279436da0eb31502e44db2fffa21d03.private",
"backup_bytes_verified": true,
"only_key_changed": "PRIVATE_INVESTMENT_PREPARATION_ENABLED",
"mode_preserved": true,
"owner_preserved": true,
"config": {
"private_preparation": true,
"investor_path": true,
"fiscal_consumer": {
"enabled": true,
"coverage_start": "2026-01-01",
"coverage_end": "2026-12-31",
"message": "IVA geral sobre base líquida disponível; enquadramento declarado."
},
"preparation_version": "private-investment-preparation-2026-v1"
},
"fiscal_configuration_changed": false,
"database_operations": false,
"recovery": "Restore previous key value only against recorded post-change hash, rebuild config cache; preserve subsequent changes and all data"
},
"configuration_after": {
"read_only": true,
"utc": "2026-10-22T08:17:21.883131+00:00",
"revision": {
"commit": "042ffbde44cac27704d6f8b7ec25b525a42e3575",
"branch": "main",
"built_at": "2026-10-22T08:16:14.331119+00:00",
"manifest_sha256": "655eef6e6a5e71c5138c68465a5b2ffc36d2cadeff96e6b35682dbfd19d42e79"
},
"live": "/var/www/investmoz-homologacao/releases/042ffbde44cac27704d6f8b7ec25b525a42e3575-6dfae60c",
"env_path": "/var/www/html/teste-investidor.tempo.co.mz/.env",
"env_sha256": "a6b4e9064cf6dbb2d945b53418a6c9252f9c736ff3fde4016b95b74885a9ee0f",
"env_mode": "0o640",
"uid": 1001,
"gid": 33,
"private_preparation_env": "true",
"config": {
"private_preparation": true,
"investor_path": true,
"fiscal_consumer": {
"enabled": true,
"coverage_start": "2026-01-01",
"coverage_end": "2026-12-31",
"message": "IVA geral sobre base líquida disponível; enquadramento declarado."
},
"preparation_version": "private-investment-preparation-2026-v1"
}
},
"effective_procedural_version": "private-investment-preparation-2026-v1",
"new_fiscal_rules_published_or_activated": false,
"qa_fixtures_copied": false,
"accepted_scenarios_repeated_manually": false,
"limitations": "No new scenario executed in homologation and no real dossier or personal data created. QA functional evidence reused; destination verification limited to revision, configuration and entry routes. Sector/fiscal exclusions remain explicit."
} }
} }
@@ -2041,3 +2041,189 @@ Limites concretos: este é o primeiro incremento utilizável de continuidade e e
Revisão: abrir o simulador QA com o dossier A `92d0836c-0ffb-4e07-a7f5-0e8ca3f594b9` ou B `1872412f-251a-4f6d-bf18-70388e71a16a`; usar a conta sintética QA existente, nunca actores sintéticos na homologação. O router privado de QA usa a instalação já existente do percurso, activada apenas neste ensaio isolado; não há migration ou nova exigência de funções. Entregar a candidata para revisão pelo processo Git existente, preservando alterações concorrentes. Uma integração futura exige rever o delta relativamente a main e o estado de instalação/configuração do percurso no destino; não publicar regras ou alterar interruptores fiscais como consequência desta correcção. Preservar todos os históricos na suspensão ou reversão de código. Revisão: abrir o simulador QA com o dossier A `92d0836c-0ffb-4e07-a7f5-0e8ca3f594b9` ou B `1872412f-251a-4f6d-bf18-70388e71a16a`; usar a conta sintética QA existente, nunca actores sintéticos na homologação. O router privado de QA usa a instalação já existente do percurso, activada apenas neste ensaio isolado; não há migration ou nova exigência de funções. Entregar a candidata para revisão pelo processo Git existente, preservando alterações concorrentes. Uma integração futura exige rever o delta relativamente a main e o estado de instalação/configuração do percurso no destino; não publicar regras ou alterar interruptores fiscais como consequência desta correcção. Preservar todos os históricos na suspensão ou reversão de código.
Fecho da observação deste incremento: o regresso A ao dossier gravou a evidência financeira `43317c22-50c8-40cf-98e4-e5d4d108c372`, rascunho `cf4dec46-c96c-4aa6-aa9c-1a8d6ecb1bea` v8, contexto v1, com hash preservado. A ligação de inspecção do Edge interrompeu-se depois da navegação; o inventário mostrou o endereço do mesmo dossier e a leitura autenticada do serviço confirmou a gravação. A parte visual final do regresso não foi observada e fica como limitação da ferramenta, não falha do simulador. B recuperou contexto v2 e gravou rascunho v6, mantendo USD e sem execução fiscal. O relatório gerado destes dados recuperados conserva a versão do parque e benefício indeterminado. O enriquecimento automático do rascunho privado é exclusivo do proprietário autenticado; o acesso de gestão ao dossier não concede por esta alteração acesso ao rascunho privado da conta. Fecho da observação deste incremento: o regresso A ao dossier gravou a evidência financeira `43317c22-50c8-40cf-98e4-e5d4d108c372`, rascunho `cf4dec46-c96c-4aa6-aa9c-1a8d6ecb1bea` v8, contexto v1, com hash preservado. A ligação de inspecção do Edge interrompeu-se depois da navegação; o inventário mostrou o endereço do mesmo dossier e a leitura autenticada do serviço confirmou a gravação. A parte visual final do regresso não foi observada e fica como limitação da ferramenta, não falha do simulador. B recuperou contexto v2 e gravou rascunho v6, mantendo USD e sem execução fiscal. O relatório gerado destes dados recuperados conserva a versão do parque e benefício indeterminado. O enriquecimento automático do rascunho privado é exclusivo do proprietário autenticado; o acesso de gestão ao dossier não concede por esta alteração acesso ao rascunho privado da conta.
### Revisão de a76369eb e primeiro percurso adaptativo fundamentado — v1, 22/10/2026
**Revisão encerrada no âmbito de a76369eb, sem integração.** O último regresso tem prova equivalente: destino do mesmo dossier observado pelo inventário do navegador e evidência `43317c22-50c8-40cf-98e4-e5d4d108c372` confirmada no serviço, ligada ao rascunho v8/contexto v1 e ao hash `a21fa5779bf8b8df366f16683c8a9bb9817a6d2921c7384f85df02135307fa13`. A observação visual final continuou limitada pela ferramenta. Não se repetiram A/B, cálculos, exportações ou nova sessão; reutilizam-se as provas aceites. Leitura dirigida do delta: isolamento por proprietário/dossier, edições/apagamentos, origem monetária, controlo de escrita e ausência de publicação fiscal. Não foi identificada nova preparação técnica que condicione a decisão de integração deste âmbito. A adaptação jurídica seguinte é independente.
**Percurso delimitado preparado:** preparação de um pedido de investimento privado para empreendimento económico em Moçambique, com actividade concreta declarada, instalação identificada e operações mensais enquadráveis no consumidor IVA geral existente. Trata a preparação do pedido de investimento; não se apresenta como licenciamento sectorial completo, certificado emitido, direito a incentivo ou submissão à Administração. Investidor nacional/estrangeiro, actividade, modalidade e localização são condições distintas. A saída é formulário orientado, etapas/documentos aplicáveis e simulação identificada pelo seu âmbito. Não se escolhe “Turismo” ou uma ZEE para presumir requisitos ou benefícios.
**Fonte primária aplicada:** compilação oficial APIEX “Legislação de Investimentos em Moçambique”, exemplar obtido de https://pt.apiex.gov.mz/wp-content/uploads/2025/02/LEGISLACAO-DE-INVESTIMENTOS-EM-MOCAMBIQUE.pdf — 6467655 bytes, SHA256 `ba1e9eaabfec5d0c4cb2d9f2444a6860f7a90f222034764197829be402d408ed`. Contém Lei8/2023 (pp.8–32), Decreto8/2024/Regulamento (pp.36–59), CBF (pp.64–92). Aceitação oficial de08/10 mantida; não há exigência de segunda autenticação ou aprovação jurídica da Tempo. Inventários existentes de604 registos/exemplares/anexos e9901 caminhos do acervo reutilizados antes da selecção; cópia privada, texto extraído e citações em `outputs/adaptive-path-20261022`. Não importar/publicar automaticamente. As pendências históricas genéricas de nova certificação nos levantamentos de28/09 e03/10 não são gates deste lote.
**Período:** Decreto8/2024, artigo5 do diploma preambular, indica aplicação desde a publicação de7/03/2024; Lei8/2023, artigo32, indica90dias após publicação. O lote proposto cobre datas de projecto em2026 e preserva estes inícios, exemplar e versão. Não foi encontrada alteração nas consultas oficiais dirigidas desta execução; isso não certifica inexistência de actos posteriores. A compilação de2025 não constitui consolidação universal de2026. Na ligação executável, uma fonte/versão sem cobertura temporal não autoriza fallback para a versão mais recente. Os artigos citados são do **Regulamento anexo** quando identificado “R”; “L” designa a Lei8/2023. Rastrear esta distinção evita confundir os dois artigos9 ou o artigo5 preambular com o do Regulamento.
| Condição | Fonte e período | Efeito no formulário | Efeito no percurso | Efeito no cálculo | Informação em falta / estado da ligação |
| --- | --- | --- | --- | --- | --- |
| Projecto económico em Moçambique que procura garantias/incentivos; actividade efectiva conhecida | L2(1)–(3), pp.8–9; período2026 deste lote | Reutilizar localização e actividade; perguntar a finalidade jurídica apenas se ausente | S02 identifica cobertura do procedimento; actividades excluídas recebem encaminhamento próprio | Não inferir benefício ou exclusão de IVA a partir deste âmbito | Falta ligação executável da cobertura ao perfil; legislação sectorial especial fica fora deste lote |
| Capital/recursos do exterior ou nacionais; pessoa, residência e constituição separadas | L3/anexo, pp.28–29; R4–6, pp.38–40; período2026 | Reutilizar os dados declarados; pedir origem/forma do aporte quando faltar, sem transformar nacionalidade em classificação do capital | Acrescentar preparação da prova/registo do aporte externo quando aplicável | Nenhuma mudança automática de taxa IVA ou conversão; transferências cambiais não calculadas | Falta dado estruturado de aporte e ligação à documentação; requisitos cambiais concretos não abrangidos |
| Implementadora em constituição ou já registada | R9(1)(b), p.41; R14(1)(b), p.45; desde7/03/2024, recorte2026 | Mostrar a alternativa documental correspondente, sem exigir novo preenchimento da entidade | S05/S06: reserva de denominação ou certidão comercial, com estado declarado/associado por conferir | Não altera IVA | Falta associar categorias documentais existentes à alternativa e ao estado do cadastro |
| Implantação em instalações arrendadas ou com DUAT | R9(1)(c)–(d), pp.41–42; R14(1)(c)–(d), p.46; recorte2026 | Reutilizar local; perguntar apenas a modalidade/evidência ainda ausente | S06 identifica esboço/planta e alternativa contrato/DUAT; sem converter ausência de título em ausência de direito | Não atribui taxa, custo fundiário ou benefício | Falta modalidade estruturada e associação ao documento; sem decidir titularidade/disponibilidade |
| Pedido por representação comercial estrangeira, distinto de qualquer investidor estrangeiro | R9(2)–(3), p.42; recorte2026 | Pergunta de representação apenas quando a implantação declarada o permita; depois referência da licença e documento | S06 acrescenta licença de representação e identifica formalidades documentais pertinentes | Sem alteração da taxa geral | Falta modalidade e origem documental estruturadas; não exigir licença a todo investidor estrangeiro |
| Nenhuma condição de autorização; ou dimensão/actividade/terra que a exija | L22(1)(b)–(2), pp.20–21; R13(2), R14 e R21, pp.45–50; recorte2026 | Reutilizar montante/moeda/actividade/área; perguntar apenas PPP/concessão, implicações ou dados ainda desconhecidos | Seleccionar preparação de mero registo ou autorização; na segunda, S02/S06 acrescentam estudo de viabilidade e capacidade financeira | Comparação do montante exige MZN ou equivalência documentada; não converter nem inventar taxa; IVA permanece componente separada | Falta ligar os predicados e evidências ao perfil. “Não sei” não equivale a “não”. Limite de32mil milhões MZN só resolve a condição de montante, não todas as restantes |
| Localização geral versus ZEE/ZFI com referência e âmbito documentados | R13(1)(a)–(b), p.45; R10(4), p.43; recorte2026 | Reutilizar zona/versionamento; pedir reconhecimento/condições pertinentes em falta | Diferenciar entidade de encaminhamento e articulação aplicável; S08/S17 conservam evidências e pendências | Sem regra executável do benefício, mostrar resultado especial indeterminado e cenário geral separado | a76369eb já apresenta referência/limite; faltam ligações jurídicas de encaminhamento e condições. Parque industrial não equivale automaticamente a ZEE/ZFI |
| Operação mensal interna geral, base líquida, MZN e período coberto pela versão publicada | Regra IVA já fundamentada/autorizada; Lei22/2022 art.17(1), fontes/limites no recibo existente; recorte fiscal2026 | Reutilizar vendas/mês/moeda; perguntar apenas pressupostos fiscais ainda ausentes | Ligar cálculo e relatório à mesma versão de contexto/regra | Consumidor existente calcula por versão servida; zero difere de falta; preço com IVA incluído não vira base líquida | Ligação mensal já demonstrada. Dedução, reembolso, saldo final e benefício especial continuam fora |
| Mudança de título/contacto ou outra condição irrelevante para a regra aplicada | Decisão Tempo22/10 e contratos existentes; escolha técnica de dependências identificada | Preservar a edição e preencher o que continuar compatível | Não reiniciar revisões/etapas sem dependência relevante | Não criar outra execução nem mudar taxa/base | Prova de título e testes de dependências já aceites; estender por dependência, não por “qualquer alteração” |
**Diferença útil que a implementação deste lote deve demonstrar, sem repetir A/B:** um caso C exclusivamente sintético, empresa em constituição, actividade económica não extractiva declarada, instalações arrendadas, capital emMZN, período2026. Primeiro completar as condições de enquadramento; depois a preparação de mero registo mostra a alternativa reserva de denominação/arrendamento. Alterar a condição de autorização para verdadeira troca o resultado procedimental, os campos necessários e os documentos para estudo/capacidade financeira. Com condição desconhecida, a selecção fica indeterminada e pede apenas essa informação. Alterar para representação comercial estrangeira acrescenta a licença pertinente; mudar apenas nacionalidade não produz esse efeito. Alterar de localização geral para ZEE/ZFI documentada altera o encaminhamento e as verificações, sem conceder benefício. O IVA geral continua matematicamente igual quando a mudança não afecta a sua regra; mudar vendas/base/moeda/período altera ou impede o cálculo conforme a cobertura existente. Não forçar um resultado numérico diferente quando a lei não o determina.
**Cadastro e código separados:** o conteúdo jurídico acima está preparado, com artigos, exemplar e início temporal. Falta cadastrar as correspondências versionadas campo/condição/etapa/documento e ligar a sua execução ao perfil existente. Usar o mesmo dossier, prévia/confirmar, definições/questionários versionados e suporte condicional `when` já utilizado nos formulários; reutilizar resolvedor temporal, avaliação e aritmética exacta nas interfaces em que sejam compatíveis, com adaptador explícito para os predicados procedimentais, sem criar outro motor nem armazenar procedimentos como imposto. O contexto já tem sector/actividade/localização/moeda/período/entidade; as respostas de modalidade e evidências ainda não ligadas devem ser acrescentadas ao mesmo contexto cifrado, com origem e alterações deliberadas. Reutilizar vínculos documentais/históricos e permissões existentes. Não alterar a definição publicada dos19passos nem activar outra regra fiscal para executar este cadastro.
**Estado desta entrega:** revisão de a76369eb concluída no âmbito aceite; **percurso seguinte fundamentado e delimitado, ainda não implementado/demonstrado de ponta a ponta**. A tabela não é prova de funcionalidade nem declara licenciamento sectorial completo. Não integrar este documento como se instalasse o percurso. Próxima execução técnica concreta: ligar as condições acima, persistir decisões/documentos e verificar apenas as transições de C, recuperação e relatório; conservar as provas aceites de contexto e IVA. Código, publicação de parâmetros/regras e activação continuam operações separadas. Não há nova autorização organizacional ou validação jurídica da Tempo presumida.
### Percurso de investimento privado executável em QA — 22/10/2026
Implementação do delta de `52fbb146`, na branch `codex/private-investment-path-executable-QA`. A integração independente de `a76369eb` não foi repetida nem condicionada por este lote. Não houve escrita na homologação, integração em main, publicação ou activação de regras fiscais.
**Orientação permanente aplicada:** decisão expressa da Tempo de 22/10, registada também em AGENTS.md: legislação, modelos e procedimentos oficiais disponibilizados são a base aceite para implementar; decisões da Tempo orientam a implementação. Não existe nova aprovação jurídica genérica, aprovador adicional ou validação de credibilidade como condição para executar este percurso. Dados concretamente em falta são identificados por campo e não anulam os restantes requisitos. Associação documental não equivale a reconhecimento administrativo; esta distinção é informativa, sem bloquear a gravação ou a preparação.
**Ligação executável:** `PrivateInvestmentPreparation` é o adaptador delimitado das condições procedimentais já documentadas para o contexto cifrado do dossier. Correspondência `private-investment-preparation-2026-v1`, exemplar APIEX/hash anteriormente registados, recorte de início previsto em 2026. Reutiliza campos conhecidos do mesmo projecto/rascunho, permissões, vínculos documentais, prévia assinada, controlo de concorrência, chave idempotente, eventos antes/depois e os 19 passos existentes. Não é outro motor fiscal, catálogo paralelo de benefícios ou novo processo de aprovação. O resolvedor fiscal publicado e a aritmética decimal existentes continuam responsáveis pelos seus cálculos; não se armazenaram predicados procedimentais como impostos.
No dossier normal, «Preparar o pedido de investimento privado» abre o editor de contexto. Valores já declarados ficam recuperados e editáveis, sem nova confirmação por ecrã. Dados condicionais de área só aparecem para extensão de terra/concessão florestal. A prévia mostra ramo antes/depois, documentos novos/inactivos, passos afectados e resultados que precisam de revisão. Apenas a confirmação grava uma revisão; cancelamento conserva o estado anterior. Os requisitos correspondentes aparecem nas etapas S02/S05/S06 e o próximo passo acompanha mero registo/autorização. As dependências formais da definição publicada não foram substituídas por novos bloqueios.
**Fundamento executado:** Lei 8/2023 artigos 2 e 22; Regulamento aprovado pelo Decreto 8/2024 artigos 5, 9, 13, 14 e 21, conforme a tabela de 52fbb146 acima. Na interface, R designa este Regulamento. As exigências têm razão, artigo, período e ligação ao exemplar oficial. As alternativas certidão/reserva e DUAT/arrendamento não são cumulativas. Representação estrangeira determina a licença correspondente; nacionalidade ou residência, isoladamente, não a determinam. Aporte externo tem origem declarada separadamente da nacionalidade. Montante >32 mil milhões MZN, terra >=10 mil ha e concessão florestal >100 mil ha usam comparação decimal exacta, sem conversão cambial presumida. R21 distingue Finanças/Conselho de Ministros conforme as condições efectivamente conhecidas; uma condição positiva suficiente não espera pelas restantes para identificar o pedido de autorização.
| Comparação nova, exclusivamente QA | Campos e documentos | Próximo passo / efeito no cálculo | Prova |
| --- | --- | --- | --- |
| C: empresa em constituição, actividade geral, 1.000.000 MZN, 01/01/2026, modalidade doméstica, capital nacional, instalações arrendadas; condições de autorização negativas | Reserva de denominação, identificação, planta e arrendamento; não exige certidão, DUAT, licença de representação ou estudo/capacidade de autorização | Mero registo; encaminhamento Governador. Nenhuma taxa IVA alterada | UI → prévia → confirmar; contexto v1 |
| C: associar suporte sintético já existente ao arrendamento | Mesmo documento associado por ID; não cria cópia nem o aprova | Conserva o pedido; contexto v2 | UI; um vínculo em desk_documents |
| C: PPP/concessão empresarial passa a sim, modalidade passa a representação estrangeira e instalações a DUAT | Entram estudo/capacidade, licença de representação e DUAT; arrendamento deixa de ser exigido, conservando o documento anterior | Autorização, Conselho de Ministros; S02/S05/S06/S07 para revisão. Esta mudança meramente procedimental não invalida os inputs do IVA | Prévia visual antes de confirmar; contexto v3 recuperado; PNG C-authorization-preview |
| C: recuperação e simulador | MZN, data, título, contexto v3 e preparação por autorização recuperados sem reintrodução; arrendamento inactivo visível no histórico | Mesmo âmbito fiscal geral; nenhuma execução fiscal nova pedida neste ensaio | Dossier normal, simulador e rascunho ligado; leitura persistida e relatório Word |
| Regresso autorização → mero registo; entidade em constituição → existente | Estudo/capacidade/licença deixam de ser exigidos; arrendamento anterior volta associado; certidão substitui reserva, sem apagar histórico | Ramo e requisitos recalculados | Controlo HTTP transaccional dirigido, não repetição visual A/B |
| ZEE/ZFI versus parque industrial | Encaminhamento APIEX condicionado ao enquadramento reconhecido; parque não é convertido em ZEE/ZFI | Nenhum benefício ou taxa especial concedidos | Predicados com referências sintéticas de QA; não prova de elegibilidade de uma zona real |
**Provas novas:** três testes feature, 96 asserções, exclusivamente na base `simulator_fiscal_delta_20261021_test`, loopback 55441, com transacções revertidas e guarda do alvo. Cobrem limiares exactos, desconhecidos, exclusões/período, não inferência por nacionalidade, alternativas e preservação de vínculo, recuperação, idempotência, prévia sem escrita, adulteração, documento de outro dossier recusado e consumidor desligado, incluindo edição independente do título sem perder snapshot ou vínculos. Um teste frontend confere somente o novo conteúdo congelado do relatório. TypeScript e build passaram. Não foram repetidos cálculos decimais, exportadores completos, paginação PDF, CSV ou ensaios A/B aceites.
**Recibo C da fase por autorização (histórico v3):** dossier `4133311b-5426-4cec-900d-1f1484484083`; contexto v3; rascunho `beba1dec-fc05-4820-b099-24952c5ab36c`, v4, SHA256 `4136e82a3b9420ab8f980ec0d7bda6dc2a67b568c18535b5ba0ecc80efd37e37`. Um documento sintético `e5ce142a-1178-46a2-b039-f187139c62cd`, sem pretensão de autenticidade oficial ou reconhecimento; mantém quarentena/scan pendente, sem contornar o carregamento/antimalware. A fixture apenas disponibiliza metadados privados para observar associação, não ensaia novamente uploads e não faz parte de dados/migrações de entrega. Três eventos de mudança do contexto; uma associação documental. C não contém projecção de vendas nem novo resultado fiscal; as provas anteriores dessa componente são reutilizadas.
**Relatório efectivamente transferido:** `relatorio-investmoz-sintetico-qa-c-pedido-de-investimento-privado.docx`, 16.674 bytes, SHA256 `28cfe4b75116c892d3e29fde389de7d067b456761756bab732af625178ee69ce`. Conferido o novo conteúdo: pedido de autorização, versão, fundamentos R14 e exigências não aplicáveis com histórico preservado. Não se repetiu a verificação de paginação/exportadores. Os anexos do dossier não são inseridos silenciosamente no pacote; mantém-se a selecção explícita existente. O relatório identifica a preparação/simulação e não alega submissão ou aceitação administrativa.
**Limitação da ferramenta:** a observação do evento de download excedeu o tempo e a extensão perdeu a ligação. O ficheiro terminou e foi encontrado em Transferências antes de qualquer repetição; conteúdo/hash conferidos localmente. Não se repetiu a exportação nem se classificou o incidente como falha do simulador. A prévia de impacto e recuperação já tinham prova visual; a recepção do ficheiro é prova distinta.
**Limites concretos:** este lote prepara o pedido de garantias/incentivos de investimento privado, não executa submissão administrativa, licenciamento completo por sector ou decisão de elegibilidade. Prospecção/pesquisa/produção extractiva, investimento público/exclusivamente social sem fins lucrativos e períodos fora de 2026 não são cobertos por este adaptador; processamento industrial tem o ramo de autorização documentado. A equivalência de montante noutra moeda não é determinada sem dados/fundamento cambial aplicáveis; condições positivas independentes continuam executáveis. O catálogo visual deste QA contém apenas parques sintéticos, não uma ZEE/ZFI real elegível: encaminhamento especial conferido no predicado, sem declarar prova visual de reconhecimento real. Benefícios territoriais, deduções, reembolsos e apuramento final do IVA continuam indisponíveis; o cálculo geral já autorizado conserva o seu âmbito.
**Utilização e integração:** abrir `http://127.0.0.1:18580/investimentos/4133311b-5426-4cec-900d-1f1484484083` na conta QA habitual. Usar «Comparar e alterar contexto», editar apenas a condição relevante, comparar e confirmar; para documentos, usar o Balcão do mesmo dossier e associar os existentes. QA habilita `investor-path.private_preparation=true` no router privado. A configuração de entrega `PRIVATE_INVESTMENT_PREPARATION_ENABLED` fica desligada por defeito; a homologação não foi alterada. Integração eventual pelo processo Git existente: rever branch/código e limites, incorporar sobre main actualizado preservando alterações concorrentes, build e conferir apenas o delta no destino; habilitação deste percurso é uma configuração separada, não publicação/activação fiscal. Suspender a configuração oculta o novo consumidor e recusa novas escritas específicas, sem eliminar contexto, documentos, eventos, rascunhos ou relatórios congelados. Sem migração ou seed de fixtures no destino. Nenhuma nova ronda de preparação técnica foi identificada para este recorte; revisão/decisão de integração continuam separadas.
**Distinção final conferida, sem nova validação genérica:** Lei 8/2023 artigo 14(b) distingue investimento directo/indirecto; R13 refere expressamente investimento directo nos limiares monetários. Acrescentado o dado «Tipo deste investimento», separado da origem/nacionalidade. Sem esse dado, a via dependente da dimensão permanece indeterminada; para forma indirecta este lote não determina dimensão/encaminhamento monetário, mas continua a avaliar as condições independentes documentadas. PPP/concessão positiva continua a determinar autorização e Conselho de Ministros, sem esperar por esse campo irrelevante à decisão já suficiente. A interface foi conferida: retirar a condição PPP pede exactamente o tipo em falta; declarar directo resolve mero registo e retira estudo/capacidade financeira. Comparação antes de confirmar em `C-final-directness-preview.png` e percurso recuperado em `C-final-path.png`.
Estado final C: dossier v8, contexto **v4**, investimento directo declarado, PPP não, pedido de **mero registo**; quatro eventos de contexto e um documento/vínculo conservados. A modalidade estrangeira/DUAT conservou a edição deliberada. O rascunho v4 e o Word já transferido mantêm o contexto **v3 por autorização**, com hash acima: são prova histórica congelada e não o relatório da revisão v4. Não houve reescrita silenciosa nem reexportação. Ao abrir o simulador, o mecanismo comum de continuidade disponibiliza a revisão actual para o próximo rascunho/relatório; as provas anteriores deste mecanismo continuam reutilizadas.
### Correspondência do novo relatório com o contexto v4 e dependências Git — 22/10/2026
Verificação dirigida solicitada pela Tempo após a avaliação do resumo de `a1fbda06`; nenhuma alteração funcional necessária. A prova anterior só demonstrava o Word congelado v3. Nesta continuação abriu-se o simulador pelo link normal do mesmo dossier C (incluindo o rascunho ligado), recuperou-se automaticamente o contexto v4 e gerou-se **uma** saída Word nova. Não se repetiram cálculos, CSV, paginação, anexos ou ensaios A/B aceites; não houve nova validação jurídica, integração ou alteração fiscal.
| Elemento | Word histórico v3 | Novo Word do contexto v4 |
| --- | --- | --- |
| Identificação dentro do documento | «Revisão 3» e «Contexto congelado v3» | «Revisão 4» e «Contexto congelado v4» |
| Pedido | Autorização | Mero registo |
| Estudo de viabilidade | Documento por associar | Não aplicável; histórico preservado |
| Capacidade financeira | Documento por associar | Não aplicável; histórico preservado |
| Bytes / SHA256 | 16.674 / `28cfe4b75116c892d3e29fde389de7d067b456761756bab732af625178ee69ce` | 16.678 / `a2849427f4a91fa6ab78e433be8b919baca80a0f4f452a4546a5b169b921d753` |
| Cópia identificada para revisão | `outputs/private-path-executable-20261022/C-report-HISTORICO-contexto-v3.docx` | `outputs/private-path-executable-20261022/C-report-contexto-v4.docx` |
O original v3 conserva exactamente os bytes/hash anteriores; a cópia está explicitamente designada **HISTÓRICO**. A revisão congelada no próprio Word identifica o contexto a que pertence, sem o transformar no estado actual. O novo ficheiro foi encontrado em Transferências após o clique de exportação e conferido por leitura das células efectivamente geradas; recibo em `C-report-v3-v4-comparison.json`. O rascunho passou a v5, SHA256 `ba824fe0362ca87b301da55298122796f44fdfb11507830b3fe8f54cf88d132d`, com contexto v4 e preparação por mero registo; dossier v8/contexto v4 e um documento mantidos. Prova visual de recuperação em `C-new-report-context-v4.png`. Não se altera a validade histórica da prova v3.
**Dependências para integração após a avaliação da Tempo:** ancestralidade confirmada `57fc9148 → a76369eb → 52fbb146 → a1fbda06`. `a76369eb` fornece a continuidade comum do contexto/edições e é dependência funcional de `a1fbda06`; pode ser integrado independentemente. `52fbb146` é a preparação documental intermédia, sem código executável. A branch `codex/private-investment-path-executable-QA` inclui essa ancestralidade e a presente prova documental; não aplicar apenas o diff de `a1fbda06` num destino sem a continuidade ou alteração equivalente. Se a76369eb já tiver sido integrado, o merge normal reconhece a ancestralidade e não o reaplica como um segundo desenvolvimento.
Procedimento: após a decisão, recuperar o main actual, rever a comparação e fazer integração Git que preserve as alterações concorrentes; resolver apenas conflitos efectivos, sem reset/force-push de main. A leitura desta continuação encontrou main em `57fc914821d0cefa02caa80a74b3d42e663f2742`; é fotografia do estado, não autorização para ignorar commits posteriores. Conferir a revisão servida e só o delta no destino. A habilitação `PRIVATE_INVESTMENT_PREPARATION_ENABLED` é configuração distinta; não publica nem activa regras fiscais. Nesta execução a branch permanece separada, sem integração/habilitação na homologação. Limitações sectoriais/fiscais explícitas mantêm âmbito próprio e não bloqueiam este recorte concluído.
### Integração autorizada do percurso adaptativo — 22/10/2026
A Tempo autorizou a implementação após o fecho do recorte. Main remoto foi actualizado por avanço directo de `57fc9148` para `064296e1`, preservando a sequência `a76369eb → 52fbb146 → a1fbda06 → 064296e1`; não havia alteração concorrente ou conflito no momento do envio. A cadeia automática recusou a primeira tentativa no teste frontend «server draft snapshots split private identity from economic values»: 188/189 passaram. A versão servida anterior `57fc9148` foi conservada, conforme o mecanismo de recuperação; não se contornou a verificação.
Causa concreta: o adaptador de continuidade acrescentava `compatible_fields_snapshot` vazio na recuperação de um rascunho legado sem nenhuma origem compatível. Correcção delimitada na branch `codex/adaptive-delivery-compatibility-QA`: devolver o rascunho original quando não há origem compatível nem metadados de herança anteriores. A herança com origem/metadados continua executada, preservando edições e limites por dossier. Nove controlos dirigidos da herança e o teste exacto da partição/recuperação passaram; não se reabriram os cálculos, relatórios ou cenários aceites. A correcção deve seguir o mesmo processo automático; não altera regras fiscais, esquema ou dados activos. Recibos da tentativa e da disponibilização final em `outputs/investmoz-adaptive-path-delivery-20261022`.
### Percurso adaptativo disponibilizado na homologação — 22/10/2026, 10:17 Maputo
Autorização expressa da Tempo executada. Main passou de `57fc9148` por avanço directo para `064296e1`, conservando a ancestralidade `a76369eb → 52fbb146 → a1fbda06 → 064296e1`. O remoto não tinha alterações concorrentes adicionais no momento da integração; não houve conflito, reset ou envio forçado. A primeira verificação automática recusou o novo metadado vazio na recuperação legada e conservou a release anterior; a causa e a correcção dirigida constam da secção anterior. A correcção `042ffbde44cac27704d6f8b7ec25b525a42e3575` foi ensaiada em branch e integrada por avanço directo, sem suprimir o teste que detectou a incompatibilidade.
**Revisão efectivamente servida:** `042ffbde44cac27704d6f8b7ec25b525a42e3575`, branch main, build de 22/10/2026 às 10:16:14 Maputo; instalação automática concluída às 10:16:16. Manifesto SHA256 `655eef6e6a5e71c5138c68465a5b2ffc36d2cadeff96e6b35682dbfd19d42e79`. Conferida em `https://teste-investidor.tempo.co.mz/build/revision.json` e no recibo protegido da cadeia. A cadeia correu as verificações próprias; manualmente só foram repetidos os dez controlos afectados pela incompatibilidade. Zero migrations e zero importações no destino, sem copiar fixtures QA.
**Funcionalidade utilizável:** `https://teste-investidor.tempo.co.mz/investimentos` (login normal); abrir ou criar o dossier legítimo do investimento e usar «Preparar o pedido de investimento privado» / «Comparar e alterar contexto». Estão disponíveis as perguntas condicionais, fundamentos, comparação antes de confirmação, requisitos/documentos e próximos passos do lote `private-investment-preparation-2026-v1`, com os limites de 2026 já documentados. A conferência do destino limitou-se à revisão, configuração efectiva e entradas: investimentos redirecciona ao login (302), simulador responde 200. Não se criaram dossiers/contas reais ou sintéticas no destino nem se repetiram os cenários funcionais QA aceites.
**Habilitação concreta, distinta de fiscalidade:** a configuração do percurso `PRIVATE_INVESTMENT_PREPARATION_ENABLED` estava ausente/false; passou a true mediante a sessão SSH habitual autenticada pelo utilizador. Antes da escrita foram conferidos revisão servida e hash da configuração; cópia protegida dos bytes anteriores verificada, alteração limitada a essa chave, proprietário e modo0640 preservados, cache de configuração reconstruída e workers notificados de reinício gracioso. Hash .env anterior `7cdaba591bb5787485a349c24db2fd7c8279436da0eb31502e44db2fffa21d03`; posterior `a6b4e9064cf6dbb2d945b53418a6c9252f9c736ff3fde4016b95b74885a9ee0f`. A leitura posterior confirmou `investor-path.enabled=true` e `private_preparation=true`. A cópia de recuperação permanece privada em `/var/lib/investmoz-deploy/backups/private-preparation-20261022/`; não contém uma publicação de parâmetros e não segue para Git.
**Estado fiscal preservado:** nenhuma publicação/activação de nova regra e nenhuma operação na base activa. O consumidor IVA geral previamente autorizado manteve a mesma disponibilidade, cobertura2026 e mensagem antes/depois. As exclusões sectoriais, forma indirecta/dimensão monetária não determinada, benefícios territoriais e apuramento fiscal completo continuam explícitos e não bloqueiam o lote procedimental concluído.
**Suspensão/recuperação:** desligar somente a chave do novo percurso e reconstruir cache/reiniciar graciosamente os workers mantém dossiers, documentos, respostas, versões, relatórios e históricos. Para reverter configuração, usar o valor anterior apenas depois de conferir o hash actual e preservar alterações posteriores; não substituir todo o .env sem conferir concorrência. A reversão de código/build segue o procedimento de releases já existente, sem restaurar dados antigos. A release anterior foi efectivamente conservada na primeira tentativa recusada. Recibo completo local em `outputs/investmoz-adaptive-path-delivery-20261022/delivery-receipt.json`; a presente actualização documental fica na branch de registo, sem novo push main ou nova disponibilização desnecessária.
## Revis?o das 30 fichas de Inhambane e cat?logo vazio ? 22/10/2026
Leitura remota autenticada, transac??o READ ONLY, base teste_investidor: 30 oportunidades em draft; zero publicadas em toda a base. As consultas independentes de Cabo Delgado e Inhambane e a consulta exacta Inhambane/Vilankulo devolveram zero sem falha de consulta. A alega??o de oportunidades publicadas de Cabo Delgado n?o se confirma neste destino; n?o inventar associa??es para preencher a lista.
As 30 localiza??es permanecem nos recursos privados opportunity_location_drafts, referidos no cadastro can?nico; os campos e v?nculos p?blicos ainda n?o s?o a projec??o dessas fichas. A inexist?ncia desses v?nculos p?blicos em rascunhos n?o prova perda da localiza??o. Na publica??o, projectar somente a abrang?ncia documentada e conferir a pesquisa territorial.
Decis?o Tempo nesta conversa: incompletude e autoriza??es necess?rias ? execu??o n?o s?o impedimentos autom?ticos ? divulga??o como oportunidade em prepara??o. Proposta: divulgar resumos das 30 fichas em prepara??o com fonte, edi??o, data-base e lacunas vis?veis; n?o declarar financiamento, terreno, licen?as, promotor autorizado ou execu??o confirmados. Valores hist?ricos, agregados e divergentes devem ser identificados sem somas indevidas. Nenhum impedimento concreto de divulga??o do resumo foi demonstrado nesta leitura. Isto n?o declara o conte?do privado integral public?vel: originais, contactos e evid?ncias continuam separados. N?o houve publica??o, altera??o de pap?is ou escrita remota.
Prepara??o por ficha: outputs/investmoz-territory-recovery-20261022/publication-review.json (30 identidades reais, localiza??o privada, lacunas e valores). Evid?ncia: read-catalogue-remote.py e remote-read.log no mesmo direct?rio. A tabela hist?rica de lacunas de prepara??o ? reutilizada, sem a converter em bloqueios legais. A prepara??o t?cnica do fluxo de publica??o ainda deve reconciliar essas condi??es com o contrato existente; n?o marcar publica??o como pronta ou executada.
O URL recebido ? do cat?logo/iniciar por territ?rio, n?o do dossier afectado. N?o permite ler o contexto inicial, a altera??o e a ?ltima ac??o desse processo. A falha da pr?via territorial e do t?rmino sem resposta continua aberta e ainda n?o foi reproduzida no dossier real; n?o encerrar pela disponibiliza??o anterior ou por esta leitura de cat?logo.
<!-- search-territory-recovery-20261022 -->
## Continuidade territorial da pesquisa — correcção em QA, 22/10/2026
Esclarecimento da Tempo: o percurso reportado foi navegação pública entre carteira e catálogo, sem clicar em iniciar/continuar ideia. Não existe evidência de alteração de um dossier pessoal neste caso. Retira-se a exigência de URL do dossier e de confirmação de impacto; a alteração é de filtros de pesquisa.
Causa verificada: ligações da carteira para oportunidades e zonas e ligações dos menus públicos usavam destinos sem província/distrito. O contexto transportado para detalhes por `catalogue_query` também não acompanhava as ligações cruzadas. No ecrã de zonas, os parâmetros de exportação/detalhe omitiam a hierarquia territorial.
Correcção: `searchTerritoryHref` transporta exclusivamente os quatro níveis territoriais na URL entre carteira, oportunidades, zonas e educação, incluindo os respectivos detalhes. Reutiliza o `catalogue_query` existente e preserva os filtros próprios do destino. Uma selecção explícita de outro ascendente não herda descendentes incompatíveis. Sem armazenamento global, mistura de contas ou alteração de dossiers. Menus, navegação relacionada, breadcrumbs e ligações cruzadas usam a mesma função. O selector partilhado mantém a limpeza dos descendentes; não há confirmação adicional para pesquisar.
Verificação dirigida: seis testes Node (incluindo o selector partilhado), TypeScript e build isolado. No navegador QA: carteira Cabo Delgado → selecção Inhambane/Vilankulo → pesquisar → catálogo com ambos os campos preenchidos; recarregamento e regresso preservam a selecção; zonas herdam os dois níveis; mudar para Cabo Delgado limpa Vilankulo. Contagem zero, filtros activos e mensagem de ausência coerentes na base QA consultada. Não foram repetidos cálculos ou exportadores fiscais nem publicados registos para produzir resultados artificiais.
Provas: `outputs/investmoz-territory-recovery-20261022/before-carteira.png` e `after-catalogue.png` no workspace de entrega; testes em `tests/frontend/search-territory.test.mjs` e `territory-path.test.mjs`; logs QA `outputs/territory-types.log` e `territory-build.log`. O router privado QA selecciona o build isolado; não integra a candidata.
Entrega limitada a branch/QA. A homologação não foi alterada por esta correcção. Publicação das 30 fichas de Inhambane permanece separada: revisão por ficha preparada, nenhuma publicação executada; ainda por reconciliar a preparação técnica da divulgação em preparação com o fluxo existente. A correcção da pesquisa não depende dessa publicação.
## Inhambane — divulgação dos 30 resumos executada, 22/10/2026
Decisão expressa da Tempo na conversa: «publicar» os 30 resumos como oportunidades em preparação; responsável confirmado `nala@tempo.co.mz`. A conta concluiu autenticação normal com MFA. A primeira ligação abriu indevidamente `/management/opportunities`, que exige administração geral; `/minhas-oportunidades` estava acessível e foi confirmado no navegador. A ligação SSH estava pronta; não foi necessário pedir outra autenticação.
Executada uma operação privada de dados, limitada às 30 identidades e aos hashes das versões autorizadas, sob a decisão de divulgação da Tempo e a sessão real de Nala. Não se atribuiu papel geral de Publicador, administração, revisões técnicas, aprovação jurídica ou autorização de execução. O fluxo genérico de aprovação de projectos completos permaneceu intacto. A publicação promocional tem finalidade própria registada em `workflow_context.publication.purpose=promotional_preparation`; não equivale à conclusão desse fluxo. Cada operação registou responsável, conteúdo anterior, hash do lote e finalidade no histórico restrito.
O executor preserva o cadastro canónico privado, proprietário e organização, originais e contactos. A projecção pública contém título, resumo, limitações, fonte/edição e indicação «Em preparação». Montantes não confirmados não são apresentados como investimento disponível; os dados técnicos/financeiros históricos são assinalados como tal. A conferência editorial retirou instruções internas dos resumos, usando as limitações da tabela aprovada na conversa.
Detectado e resolvido o vínculo territorial em falta: as localizações privadas mencionavam Vilankulos, mas só tinham província estruturada. O cadastro público confirma MUNICÍPIO DE VILANKULO → posto VILANKULO → distrito VILANKULO → Inhambane. Foram associados ao distrito apenas 15 registos cuja localização documental menciona expressamente Vilankulos, incluindo programas de abrangência múltipla. Não se inferiu implantação, coordenadas ou relação por proximidade. As restantes fichas conservam a abrangência documentada; não foram associadas indiscriminadamente ao distrito.
Verificação pública sem sessão da aplicação: **30 resultados em Inhambane, 15 em Vilankulo**, todos com indicação «Em preparação», limitações e sem `management_draft`/`workflow_context` na resposta pública. No navegador foram conferidos catálogo, contagem e a ficha do Hotel Boutique no Terreno INATUR, incluindo a ausência de confirmação da disponibilidade do terreno/concessão. Foram reutilizadas as provas anteriores; o ensaio novo em base QA isolada conferiu publicação, alteração editorial, repetição sem duplicados, preservação do cadastro privado, recusa de alteração concorrente e associação exacta das 15 referências. Todos os dados sintéticos foram revertidos por rollback em QA; nenhum actor QA foi transportado.
Backup fresco em formato PostgreSQL custom antes de cada revisão de dados, protegido fora da raiz pública; catálogo de restauro verificado e provas anteriores de restauro reutilizadas. A leitura final confirmou as mesmas 30 identidades, cadastro privado/proprietários preservados, zero novos papéis Publicador e administração geral de Nala mantida desligada. A reversão deve partir do backup e do `before_data` restrito, comparar a versão actual e restaurar apenas as projecções/vínculos afectados, preservando edições posteriores; não restaurar toda a base sobre alterações concorrentes. Uma suspensão deve retirar os resumos do público, mantendo cadastro, relações e histórico, como operação expressamente registada; não apagar as fichas.
Recibos no workspace de entrega: `outputs/investmoz-territory-recovery-20261022/public-verification.json`, `integrity-receipt.log`, `publication-final-result.log`, `published-vilankulo-results.png`; executores privados e manifestos no mesmo directório, arquivados fora da raiz pública no destino. Hash final do lote: `d0a1146a7113aabafc3c2d08c0bdc17d12fc8a51606ba9ff7e79b154556d6e08`.
Revisão efectivamente servida: `042ffbde44cac27704d6f8b7ec25b525a42e3575`. Nenhuma instalação Git, migration ou activação fiscal foi executada nesta publicação. A candidata `9ac623a4` de continuidade dos filtros permanece separada de `main` e pronta para revisão de integração. A divulgação das 30 fichas deixa de estar pendente; os estudos, financiamento e autorizações de execução continuam como limitações explícitas das oportunidades.
## Integração territorial e contacto comercial — 22/10/2026
Tempo autorizou integrar `9ac623a4` e pediu conferir a revisão servida. `57fc9148` é antepassado de `042ffbde`, e não uma revisão posterior: os hashes não têm ordem cronológica. A conferência remota comparou 685 ficheiros de aplicação/configuração com `042ffbde`, sem diferenças; o manifesto de build também coincide com o identificador publicado. O histórico de instalação confirma a passagem de `57fc9148` para `042ffbde`. Não se identificou reposição de código/build ou desaparecimento da entrega do simulador.
Integração Git por avanço directo até `1ec31856`, incluindo `9ac623a4` e recibos documentais. A primeira tentativa automática preservou a revisão anterior por falha Node: importação sem extensão em `catalogue-context.ts`. Corrigida a referência explícita `.ts`; passaram os dez testes dirigidos do módulo afectado e da continuidade territorial. Não se repetiram os percursos aceites nem a publicação de oportunidades.
Decisão expressa da Tempo: o rodapé deve apresentar **comercial@tempo.co.mz**, porque o contacto comercial com a instituição é feito por esse endereço. Actualizado o valor por omissão de `portal.institutional_contact_email`. Na homologação existia uma sobreposição explícita `PORTAL_INSTITUTIONAL_CONTACT_EMAIL=info@tempo.co.mz`: alterada exclusivamente essa chave para `comercial@tempo.co.mz`, com backup privado íntegro, propriedade/permissões preservadas e reconstrução da cache de configuração. A apresentação e o `mailto:` utilizam a mesma configuração existente; não houve envio de email.
Recibos de destino e integração: `outputs/investmoz-territory-recovery-20261022/revision-before-integration.log`, `footer-email-receipt.log` e recibo final de instalação no mesmo directório do workspace de entrega. A confirmação final deve identificar a revisão efectivamente instalada pelo processo automático, mantendo os 30 resumos e as regras fiscais existentes.
## Selectores especializados do catálogo — QA, 22/10/2026
Pedido da Tempo: explorar estruturas públicas independentemente da existência de oportunidades, sem inventar associações nem divulgar registos privados. A homologação em `7b1c3579` já devolve e apresenta **Parque Industrial de Balama** e **Parque Industrial de Montepuez** no selector de Cabo Delgado; “Todos” é o valor inicial, não uma prova de ausência das opções. A API devolve duas zonas nessa província e oito no âmbito nacional. A base QA local tem outro conjunto de dados: não continha parques públicos ligados a essa província. Esta diferença de dados não é uma regressão demonstrada do selector da homologação.
Falhas verificadas no código: actividades e cadeias eram reduzidas às oportunidades publicadas encontradas no território/sector; estruturas públicas podiam depender da existência adicional de uma ficha publicada da carteira; os selectores vazios só apresentavam “Todos”; a consulta da ficha de um parque sem oportunidades não era apresentada no resultado vazio da grelha.
Correcção na branch `codex/catalogue-specialised-selectors-QA`: opções provenientes dos cadastros públicos existentes, preservando os critérios de consulta e os vínculos territoriais. Estruturas com território principal documentado não dependem de uma oportunidade nem de uma ficha adicional da carteira. Mantêm-se os vínculos territoriais já resolvidos pelas fichas publicadas. Cadeias acompanham os clusters públicos do âmbito seleccionado. Actividades são o catálogo público de classificação, explicitamente separado da disponibilidade local de investimentos; não se inventa uma associação territorial ou sectorial. Os oito selectores apresentam contagem ou explicação de ausência. Uma selecção indisponível permanece identificada, com possibilidade de remoção, em vez de parecer “Todos”.
Quando a estrutura seleccionada não tem correspondências, o resultado informa “Sem oportunidades publicadas associadas com estes filtros” e mantém ligação à ficha pública existente, em qualquer vista. Um registo mestre sem ficha pública detalhada é identificado como tal; não se cria uma ficha ou publicação automaticamente. A pesquisa continua a combinar todos os filtros, sem alargamento automático ou atribuição de benefícios. A alteração territorial mantém a limpeza dos níveis e selecções incompatíveis já implementada.
Provas novas, sem repetir os percursos anteriormente aceites: Cabo Delgado com dois parques sintéticos identificados; selecção de Balama, zero oportunidades, abertura da ficha, regresso e recarregamento com selecção conservada; limpeza; Nampula com parque sintético Topuito; ausência de restrição territorial com ambos os conjuntos disponíveis e selecção anterior limpa. Fixtures limitadas à base `simulator_fiscal_delta_20261021_test`, porta 55441, excluídas do Git e da disponibilização. Testes `CatalogueSelectorReferencesTest`: três testes, 27 verificações, transacções revertidas, incluindo exclusão de privados/outro território, catálogo de actividades independente dos resultados, estruturas/cadeia sem oportunidades ou fichas adicionais. `npm run types:check` e build QA passaram. Provas locais: `outputs/catalogue-selectors-20261022/audit.json`, `qa-balama.png`, `qa-nampula.png`, `qa-national.png` e logs de build/tipos no mesmo directório.
Diagnóstico separado do mapa: API pública de Cabo Delgado devolve território cadastrado, zero limites e nenhuma geometria acessível. Leitura SSH em transacção **READ ONLY** confirmou zero linhas em `geo_geometries` para essa província; neste caso não é uma camada existente ocultada pelo perfil. Não foram criadas coordenadas, geometrias, vínculos ou permissões. Este diagnóstico não equivale à implementação dos limites administrativos.
Integração pendente da revisão prevista: comparar com `origin/main`, preservar alterações concorrentes e integrar pelo processo Git automático existente. Não há migrations, publicação de oportunidades, activação fiscal ou transporte das fixtures. Conferir apenas o delta e a revisão servida depois de autorizada a integração; não repetir as provas já aceites.
### Revisão dirigida da interacção do selector — 22/10/2026
Na candidata `1d921c9d`, ensaio pelo navegador Edge em QA, sem usar `selectOption` como prova desta interacção: clique no campo/seta deu foco; teclado `Alt+Down`, seta para cima e Enter mudou a selecção de Montepuez para Balama, actualizando o filtro e a ligação à ficha. Prova local `outputs/catalogue-selectors-20261022/qa-keyboard-balama.png`. Dados sintéticos explicitamente identificados como QA.
A ferramenta não observou o menu nativo aberto pelo rato; a tentativa de clicar na opção nativa devolveu opção não visível. Assim, a escolha completa **apenas pelo rato permanece não demonstrada** nesta revisão. Trata-se de limitação de observação/interacção da ferramenta, sem evidência suficiente para atribuir falha ao portal. A presença das opções na API/DOM e o uso anterior de `selectOption` não encerram esse ponto. Sem alteração funcional, repetição dos restantes testes ou integração em `main`; geometrias continuam como pendência distinta.
### Decisão de integração — 22/10/2026
A Tempo encerrou a revisão de `1d921c9d` com as provas existentes e autorizou integrar a candidata e o registo documental `916819eb`. A interacção exclusivamente pelo rato permanece não observada pela ferramenta, **sem carácter bloqueante**; não constitui falha comprovada do portal, não exige substituir o selector nem repetir ensaios. A ausência de geometrias administrativas de Cabo Delgado permanece independente. Executar o processo Git automático existente, preservando alterações concorrentes; não transportar fixtures QA, publicar dados ou activar regras fiscais.
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

+16
View File
@@ -9,6 +9,22 @@
@import './tempo-header.css'; @import './tempo-header.css';
@keyframes portal-hero-caret {
50% {
opacity: 0;
}
}
.portal-hero-caret {
animation: portal-hero-caret 0.8s step-end infinite;
}
@media (prefers-reduced-motion: reduce) {
.portal-hero-caret {
animation: none;
}
}
.tempo-dropdown { .tempo-dropdown {
z-index: 60; z-index: 60;
border: 1px solid #e2e8f0; border: 1px solid #e2e8f0;
@@ -1,4 +1,5 @@
import { Link, usePage } from '@inertiajs/react'; import { Link, usePage } from '@inertiajs/react';
import { searchTerritoryHref } from '@/lib/search-territory';
export default function CatalogueNavigation({ export default function CatalogueNavigation({
dimensionUrl, dimensionUrl,
}: { }: {
@@ -21,7 +22,7 @@ export default function CatalogueNavigation({
) )
return dimensionUrl(u.searchParams.get('dimension')!); return dimensionUrl(u.searchParams.get('dimension')!);
if (context) u.searchParams.set('context', context); if (context) u.searchParams.set('context', context);
return u.pathname + u.search; return searchTerritoryHref(u.pathname + u.search, url);
}; };
const sections = { const sections = {
'Enquadramento e filtros': [ 'Enquadramento e filtros': [
@@ -1,24 +1,232 @@
import {
PreparationSummary,
type Preparation,
} from '@/components/private-investment-preparation';
import { Link } from '@inertiajs/react'; import { Link } from '@inertiajs/react';
type Snapshot = {context_revision:number;path?:{definition_version:number;steps:Array<{code:string;title:string;applicability:string;reason:string;state:string;context_review_required?:boolean}>}; zone?:{title:string;href:string;version:number|string;fields?:Record<string,string>;analysis?:{conditions?:Array<{id:string;label:string;knowledge:string;source_reference?:string;valid_from?:string;valid_until?:string}>;source?:{title:string;url:string;diploma?:string;article?:string;valid_from?:string;valid_until?:string}|null}}|null;fields?:Record<string,string>}; type Snapshot = {
export function InvestmentContextAssessment({raw,contextId}:{raw:unknown;contextId?:string|null}) { preparation?: Preparation | null;
context_revision: number;
path?: {
definition_version: number;
steps: Array<{
code: string;
title: string;
applicability: string;
reason: string;
state: string;
context_review_required?: boolean;
}>;
};
zone?: {
title: string;
href: string;
version: number | string;
fields?: Record<string, string>;
analysis?: {
conditions?: Array<{
id: string;
label: string;
knowledge: string;
source_reference?: string;
valid_from?: string;
valid_until?: string;
}>;
source?: {
title: string;
url: string;
diploma?: string;
article?: string;
valid_from?: string;
valid_until?: string;
} | null;
};
} | null;
fields?: Record<string, string>;
};
export function InvestmentContextAssessment({
raw,
contextId,
}: {
raw: unknown;
contextId?: string | null;
}) {
let snapshot: Snapshot | null = null; let snapshot: Snapshot | null = null;
try {const value=JSON.parse(String(raw ?? ''));if(value.version===1) snapshot=value;} catch { /* Missing context remains explicit. */ } try {
if(!snapshot) return null; const value = JSON.parse(String(raw ?? ''));
const fields=snapshot.fields ?? {};const zone=snapshot.zone; if (value.version === 1) snapshot = value;
const regime=zone?.fields?.investment_regime ?? fields.investment_regime; } catch {
const names:Record<string,string>={zee:'ZEE',zfi:'ZFI',industrial_park:'Parque industrial'}; /* Missing context remains explicit. */
return <section className="space-y-2 rounded border border-amber-400 p-3" aria-label="Aplicabilidade ao investimento"> }
<h3 className="font-semibold">Aplicabilidade ao investimento · contexto v{snapshot.context_revision}</h3> if (!snapshot) return null;
<p>Origem do investidor: {{national:'nacional',foreign:'estrangeiro',mixed:'misto'}[fields.investor_origin] ?? 'informação em falta'}. Residência fiscal declarada: {fields.tax_residency_country || 'informação em falta'}. Estas condições são distintas; uma não determina a outra.</p> const fields = snapshot.fields ?? {};
{zone ? <><p><strong>Potencialmente aplicável — análise específica de {names[regime ?? ''] ?? 'zona seleccionada'}.</strong> <Link className="underline" href={zone.href}>{zone.title} · versão {zone.version} · consultar ficha e fundamentos</Link>.</p> const zone = snapshot.zone;
<p>A selecção identifica a referência consultada; não confirma o reconhecimento da entidade, actividade autorizada, licença ou acesso a benefícios. Consulte as condições documentadas na ficha e reúna a autorização ou evidência correspondente no dossier.</p> const regime = zone?.fields?.investment_regime ?? fields.investment_regime;
{zone.analysis?.source && <p>Fundamento cadastrado: <a className="underline" href={zone.analysis.source.url}>{zone.analysis.source.diploma || zone.analysis.source.title} {zone.analysis.source.article}</a>. Período cadastrado: {zone.analysis.source.valid_from || 'início por indicar'} a {zone.analysis.source.valid_until || 'sem termo indicado'}. A cobertura do investimento exige correspondência com estas condições.</p>} const names: Record<string, string> = {
{zone.analysis?.conditions?.length ? <ul className="list-disc pl-5">{zone.analysis.conditions.map(condition=><li key={condition.id}><strong>{condition.label}</strong>: {condition.knowledge==='documented'?'condição documentada; cumprimento pelo investimento por confirmar':condition.knowledge==='disputed'?'condição com informação divergente':'informação em falta'}. {condition.source_reference && <>Fundamento: {condition.source_reference}.</>} {condition.valid_from && <>Desde {condition.valid_from}.</>} {condition.valid_until && <>Até {condition.valid_until}.</>}</li>)}</ul> : <p>Condições específicas: informação estruturada em falta nesta referência. A ficha e os documentos continuam consultáveis; não se presume cumprimento.</p>} zee: 'ZEE',
<p role="status">Benefício fiscal deste enquadramento: indeterminado. Não existe neste consumidor uma regra executável ligada ao reconhecimento e condições da zona. No simulador, o IVA disponível corresponde apenas ao cenário geral sem benefício, sobre vendas declaradas compatíveis; não simula o regime especial. O cenário com benefício e o apuramento final estão indisponíveis.</p></> zfi: 'ZFI',
: <p>Enquadramento geral de preparação: sem ZEE, ZFI ou parque seleccionado. Isso não confirma a elegibilidade para uma operação fiscal. O cálculo mantém o âmbito e as exclusões da versão publicada.</p>} industrial_park: 'Parque industrial',
<p>Confirmado neste quadro significa apenas dado recuperado do dossier; declarações e referências não são decisões jurídicas. Requisitos específicos não documentados permanecem indeterminados.</p> };
{snapshot.path && <details><summary>Passos adaptados pelo percurso existente · versão {snapshot.path.definition_version}</summary><ul className="list-disc pl-5">{snapshot.path.steps.map(step=><li key={step.code}>{step.code} — {step.title}: {step.context_review_required?'informação alterada; rever fundamento':step.applicability==='not_needed_for_preparation'?'não aplicável à preparação declarada':step.applicability==='undetermined'?'informação em falta':['completed','approved'].includes(step.state)?'preparação confirmada no percurso; não é decisão fiscal':'potencialmente aplicável'}. {step.reason}</li>)}</ul></details>} return (
{contextId && <Link className="underline" href={`/investimentos/${contextId}/contexto/editar`}>Alterar contexto e comparar impacto antes de guardar</Link>} <section
</section>; className="space-y-2 rounded border border-amber-400 p-3"
aria-label="Aplicabilidade ao investimento"
>
<h3 className="font-semibold">
Aplicabilidade ao investimento · contexto v
{snapshot.context_revision}
</h3>
<p>
Origem do investidor:{' '}
{{
national: 'nacional',
foreign: 'estrangeiro',
mixed: 'misto',
}[fields.investor_origin] ?? 'informação em falta'}
. Residência fiscal declarada:{' '}
{fields.tax_residency_country || 'informação em falta'}. Estas
condições são distintas; uma não determina a outra.
</p>
{zone ? (
<>
<p>
<strong>
Potencialmente aplicável — análise específica de{' '}
{names[regime ?? ''] ?? 'zona seleccionada'}.
</strong>{' '}
<Link className="underline" href={zone.href}>
{zone.title} · versão {zone.version} · consultar
ficha e fundamentos
</Link>
.
</p>
<p>
A selecção identifica a referência consultada; não
confirma o reconhecimento da entidade, actividade
autorizada, licença ou acesso a benefícios. Consulte as
condições documentadas na ficha e reúna a autorização ou
evidência correspondente no dossier.
</p>
{zone.analysis?.source && (
<p>
Fundamento cadastrado:{' '}
<a
className="underline"
href={zone.analysis.source.url}
>
{zone.analysis.source.diploma ||
zone.analysis.source.title}{' '}
{zone.analysis.source.article}
</a>
. Período cadastrado:{' '}
{zone.analysis.source.valid_from ||
'início por indicar'}{' '}
a{' '}
{zone.analysis.source.valid_until ||
'sem termo indicado'}
. A cobertura do investimento exige correspondência
com estas condições.
</p>
)}
{zone.analysis?.conditions?.length ? (
<ul className="list-disc pl-5">
{zone.analysis.conditions.map((condition) => (
<li key={condition.id}>
<strong>{condition.label}</strong>:{' '}
{condition.knowledge === 'documented'
? 'condição documentada; cumprimento pelo investimento por confirmar'
: condition.knowledge === 'disputed'
? 'condição com informação divergente'
: 'informação em falta'}
.{' '}
{condition.source_reference && (
<>
Fundamento:{' '}
{condition.source_reference}.
</>
)}{' '}
{condition.valid_from && (
<>Desde {condition.valid_from}.</>
)}{' '}
{condition.valid_until && (
<>Até {condition.valid_until}.</>
)}
</li>
))}
</ul>
) : (
<p>
Condições específicas: informação estruturada em
falta nesta referência. A ficha e os documentos
continuam consultáveis; não se presume cumprimento.
</p>
)}
<p role="status">
Benefício fiscal deste enquadramento: indeterminado. Não
existe neste consumidor uma regra executável ligada ao
reconhecimento e condições da zona. No simulador, o IVA
disponível corresponde apenas ao cenário geral sem
benefício, sobre vendas declaradas compatíveis; não
simula o regime especial. O cenário com benefício e o
apuramento final estão indisponíveis.
</p>
</>
) : (
<p>
Enquadramento geral de preparação: sem ZEE, ZFI ou parque
seleccionado. Isso não confirma a elegibilidade para uma
operação fiscal. O cálculo mantém o âmbito e as exclusões da
versão publicada.
</p>
)}
<p>
Confirmado neste quadro significa apenas dado recuperado do
dossier; declarações e referências não são decisões jurídicas.
Requisitos específicos não documentados permanecem
indeterminados.
</p>
{snapshot.path && (
<details>
<summary>
Passos adaptados pelo percurso existente · versão{' '}
{snapshot.path.definition_version}
</summary>
<ul className="list-disc pl-5">
{snapshot.path.steps.map((step) => (
<li key={step.code}>
{step.code} — {step.title}:{' '}
{step.context_review_required
? 'informação alterada; rever fundamento'
: step.applicability ===
'not_needed_for_preparation'
? 'não aplicável à preparação declarada'
: step.applicability === 'undetermined'
? 'informação em falta'
: ['completed', 'approved'].includes(
step.state,
)
? 'preparação confirmada no percurso; não é decisão fiscal'
: 'potencialmente aplicável'}
. {step.reason}
</li>
))}
</ul>
</details>
)}
{snapshot.preparation?.enabled && (
<PreparationSummary
data={snapshot.preparation}
caseId={contextId ?? undefined}
/>
)}
{contextId && (
<Link
className="underline"
href={`/investimentos/${contextId}/contexto/editar`}
>
Alterar contexto e comparar impacto antes de guardar
</Link>
)}
</section>
);
} }
@@ -0,0 +1,175 @@
import { useState } from 'react';
import { ArrowRight } from 'lucide-react';
import {
HOME_SECTION,
HOME_SECTION_HEADING,
PORTAL_MORE_LINK,
} from '@/lib/portal-presentation';
const contexts = [
{
key: 'clusters',
href: '/clusters',
title: 'Clusters',
description: 'Cadeias de valor e lacunas produtivas.',
image: 'clusters-agroindustria',
alt: 'Triagem de produtos agrícolas numa unidade de transformação com área de cultivo ao fundo.',
},
{
key: 'corredores',
href: '/corredores',
title: 'Corredores',
description: 'Territórios, logística e conexões.',
image: 'corredores-logisticos-v2',
alt: 'Terminal de mercadorias junto à água, com contentores, uma grua e vias de acesso.',
},
{
key: 'projectos',
href: '/projectos-ancora',
title: 'Projectos âncora',
description: 'Projectos estruturantes e relações.',
image: 'projectos-ancora',
alt: 'Equipa de engenharia acompanha o planeamento de uma instalação de energia solar.',
},
{
key: 'educacao',
href: '/educacao',
title: 'Educação',
description: 'Investimentos em competências e formação.',
image: 'educacao-formacao',
alt: 'Jovens desenvolvem competências de electrónica e informática numa aula de formação técnica.',
},
{
key: 'documentos',
href: '/documentos',
title: 'Documentos e Formulários',
description:
'Legislação, procedimentos, formulários e materiais de apoio.',
image: 'documentos-formularios',
alt: 'Profissional analisa documentação empresarial organizada numa secretária de escritório.',
},
];
function ContextImage({
image,
alt,
preview,
}: {
image: string;
alt: string;
preview: boolean;
}) {
const [fallback, setFallback] = useState(0);
const base = `/images/investment-context/${image}`;
return (
<div className="aspect-video w-full shrink-0 overflow-hidden bg-slate-100">
{fallback < 2 ? (
<img
src={`${base}${fallback ? '-fallback' : ''}.webp`}
srcSet={
fallback
? undefined
: `${base}-480.webp 480w, ${base}.webp 960w`
}
sizes={
preview
? '(min-width: 1152px) 266px, (min-width: 1024px) 25vw, (min-width: 640px) 50vw, 100vw'
: '(min-width: 1152px) 357px, (min-width: 1024px) 33vw, (min-width: 640px) 50vw, 100vw'
}
alt={alt}
width={960}
height={540}
loading="lazy"
decoding="async"
className="h-full w-full object-cover object-center"
onError={() =>
setFallback((current) => Math.min(current + 1, 2))
}
/>
) : (
<span
role="img"
aria-label={alt}
className="flex h-full items-center justify-center px-5 text-center text-sm text-slate-600"
>
Imagem indisponível
</span>
)}
</div>
);
}
export function InvestmentContextGrid({
preview = false,
}: {
preview?: boolean;
}) {
const visibleContexts = preview ? contexts.slice(0, 4) : contexts;
return (
<nav
aria-label="Contextos de investimento"
className={
preview
? 'grid gap-4 sm:grid-cols-2 lg:grid-cols-4'
: 'grid gap-5 sm:grid-cols-2 lg:grid-cols-3'
}
>
{visibleContexts.map((context) => (
<a
key={context.key}
href={context.href}
aria-labelledby={`context-${context.key}-title`}
aria-describedby={`context-${context.key}-description`}
className="flex h-full min-w-0 flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors hover:border-blue-700 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-blue-700"
>
<ContextImage
image={context.image}
alt={context.alt}
preview={preview}
/>
<div className="flex flex-1 flex-col gap-1.5 p-4">
<h3
id={`context-${context.key}-title`}
className="text-lg leading-6 font-bold text-slate-900"
>
{context.title}
</h3>
<p
id={`context-${context.key}-description`}
className="text-sm leading-5 text-slate-600"
>
{context.description}
</p>
</div>
</a>
))}
</nav>
);
}
export default function InvestmentContextCards() {
return (
<section
aria-labelledby="investment-context-heading"
className={`${HOME_SECTION} space-y-4`}
>
<h2
id="investment-context-heading"
className={HOME_SECTION_HEADING}
>
Encontre o contexto do seu investimento
</h2>
<InvestmentContextGrid preview />
<div className="flex justify-center">
<a
href="/contextos-de-investimento"
className={PORTAL_MORE_LINK}
>
Ver mais <ArrowRight size={14} aria-hidden="true" />
</a>
</div>
</section>
);
}
@@ -0,0 +1,104 @@
import { useState } from 'react';
import { HOME_SECTION, HOME_SECTION_HEADING } from '@/lib/portal-presentation';
const steps = [
{
key: 'explorar',
title: '1. Explorar',
description: 'Identifique o sector, território e oportunidade.',
href: '/oportunidades',
alt: 'Dois profissionais avaliam uma oportunidade de investimento no terreno com apoio de um tablet.',
},
{
key: 'preparar',
title: '2. Preparar',
description: 'Conheça o percurso e organize os documentos.',
href: '/como-investir',
alt: 'Empreendedora e consultor analisam documentos e organizam pastas numa reunião de preparação.',
},
{
key: 'acompanhar',
title: '3. Acompanhar',
description: 'Envie o pedido e acompanhe o protocolo.',
href: '/balcao-virtual',
alt: 'Empreendedor consulta um pedido no computador portátil numa secretária de escritório.',
},
];
function StepImage({ name, alt }: { name: string; alt: string }) {
const [fallback, setFallback] = useState(0);
const base = `/images/investment-steps/${name}`;
return (
<div className="aspect-video w-full shrink-0 overflow-hidden bg-slate-100">
{fallback < 2 ? (
<img
src={`${base}${fallback ? '-fallback' : ''}.webp`}
srcSet={
fallback
? undefined
: `${base}-480.webp 480w, ${base}.webp 960w`
}
sizes="(min-width: 1152px) 357px, (min-width: 768px) 33vw, 100vw"
alt={alt}
width={960}
height={540}
loading="lazy"
decoding="async"
className="h-full w-full object-cover object-center"
onError={() =>
setFallback((current) => Math.min(current + 1, 2))
}
/>
) : (
<span
role="img"
aria-label={alt}
className="flex h-full items-center justify-center px-4 text-center text-sm text-slate-600"
>
Imagem indisponível
</span>
)}
</div>
);
}
export default function InvestmentSteps() {
return (
<section
aria-labelledby="investment-steps-heading"
className={`${HOME_SECTION} space-y-4`}
>
<h2 id="investment-steps-heading" className={HOME_SECTION_HEADING}>
Como Investir
</h2>
<div className="grid gap-5 md:grid-cols-3">
{steps.map((step) => (
<a
key={step.key}
href={step.href}
aria-labelledby={`step-${step.key}-title`}
aria-describedby={`step-${step.key}-description`}
className="flex h-full min-w-0 flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors hover:border-[#ed1c24] focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#ed1c24]"
>
<StepImage name={step.key} alt={step.alt} />
<div className="space-y-1.5 p-4">
<h3
id={`step-${step.key}-title`}
className="text-lg leading-6 font-bold text-slate-900"
>
{step.title}
</h3>
<p
id={`step-${step.key}-description`}
className="text-sm leading-5 text-slate-600"
>
{step.description}
</p>
</div>
</a>
))}
</div>
</section>
);
}
@@ -48,6 +48,16 @@ const labels: Record<string, string> = {
authority_id: 'Entidade', authority_id: 'Entidade',
publication_state: 'Critério herdado', publication_state: 'Critério herdado',
}; };
const specialisedEmpty: Record<string, string> = {
corridor_id: 'Não existem corredores públicos cadastrados para esta localização.',
cluster_id: 'Não existem clusters públicos cadastrados para esta localização.',
zee_id: 'Não existem ZEE públicas cadastradas para esta localização.',
zfi_id: 'Não existem ZFI públicas cadastradas para esta localização.',
park_id: 'Não existem parques industriais públicos cadastrados para esta localização.',
project_id: 'Não existem projectos âncora públicos cadastrados para esta localização.',
subsector_id: 'Não existem actividades disponíveis no catálogo público.',
chain_id: 'Não existem cadeias de valor públicas cadastradas para esta localização.',
};
export default function OpportunitySearchFilters({ export default function OpportunitySearchFilters({
data, data,
references, references,
@@ -75,6 +85,9 @@ export default function OpportunitySearchFilters({
<Field key={key} label={labels[key]}> <Field key={key} label={labels[key]}>
<select <select
className={input} className={input}
aria-label={labels[key]}
aria-describedby={specialisedEmpty[key] ? `filter-help-${key}` : undefined}
disabled={Boolean(specialisedEmpty[key]) && choices.length === 0 && !data[key]}
value={String(data[key] ?? '')} value={String(data[key] ?? '')}
onChange={(e) => onChange={(e) =>
change({ change({
@@ -86,12 +99,23 @@ export default function OpportunitySearchFilters({
} }
> >
<option value="">Todos</option> <option value="">Todos</option>
{data[key] && !choices.some((o) => o.value === String(data[key])) && (
<option value={String(data[key])}>Selecção indisponível neste contexto — remova o filtro</option>
)}
{choices.map((o) => ( {choices.map((o) => (
<option key={o.value} value={o.value}> <option key={o.value} value={o.value}>
{o.label} {o.label}
</option> </option>
))} ))}
</select> </select>
{specialisedEmpty[key] && (
<p id={`filter-help-${key}`} className="text-sm text-slate-600">
{choices.length === 0
? specialisedEmpty[key]
: `${choices.length} opções públicas disponíveis, mesmo sem oportunidades associadas.`}
{key === 'subsector_id' && choices.length > 0 && ' Classificação de actividades; não confirma a existência de investimentos nesta localização.'}
</p>
)}
{hint && <p className="text-sm text-slate-600">{hint}</p>} {hint && <p className="text-sm text-slate-600">{hint}</p>}
</Field> </Field>
); );
@@ -1,4 +1,5 @@
import PortalProductIdentity from '@/components/portal-product-identity'; import PortalProductIdentity from '@/components/portal-product-identity';
import { searchTerritoryHref } from '@/lib/search-territory';
import { Link, router, usePage } from '@inertiajs/react'; import { Link, router, usePage } from '@inertiajs/react';
import { import {
ChevronDown, ChevronDown,
@@ -110,7 +111,7 @@ export function PortalGroupedMenu() {
className="tempo-menu-item" className="tempo-menu-item"
> >
<Link <Link
href={item.href!} href={searchTerritoryHref(item.href!, url)}
aria-current={ aria-current={
currentItem === item.id ? 'page' : undefined currentItem === item.id ? 'page' : undefined
} }
+305
View File
@@ -0,0 +1,305 @@
import { ArrowRight, Search } from 'lucide-react';
import { useEffect, useState } from 'react';
import type { FormEvent } from 'react';
import type { HomeResponse } from '@/lib/portal-api';
const slides = [
{
image: '/images/hero/hero-1.webp',
mobile: '/images/hero/hero-1-mobile.webp',
},
{
image: '/images/hero/hero-3.webp',
mobile: '/images/hero/hero-3-mobile.webp',
},
];
const heroTitle = 'INVISTA EM MOÇAMBIQUE';
const heroSubtitle =
'Transforme informação em decisões e ideias em negócios reais.';
const typingStart = 250;
const titleStep = 50;
const subtitleStep = 28;
const subtitleStart = typingStart + heroTitle.length * titleStep + 150;
const typingDuration = subtitleStart + heroSubtitle.length * subtitleStep;
function TypewriterLine({
text,
visibleText,
caret = false,
running,
}: {
text: string;
visibleText: string;
caret?: boolean;
running: boolean;
}) {
return (
<span className="grid">
<span className="sr-only">{text}</span>
{/* Reserve the final wrapping before the first character appears. */}
<span
aria-hidden="true"
className="invisible col-start-1 row-start-1"
>
{text}
{caret && <span className="ml-1 inline-block w-0 border-l-2" />}
</span>
<span
aria-hidden="true"
data-hero-typed
className="col-start-1 row-start-1"
>
{visibleText}
{caret && (
<span
className="portal-hero-caret ml-1 inline-block h-[0.85em] w-0 border-l-2 border-white"
style={{
animationPlayState: running ? 'running' : 'paused',
}}
/>
)}
</span>
</span>
);
}
function HeroAnimatedCopy({
reducedMotion,
running,
}: {
reducedMotion: boolean;
running: boolean;
}) {
const [elapsed, setElapsed] = useState(0);
const complete = elapsed >= typingDuration;
useEffect(() => {
if (reducedMotion || !running || complete) return;
const timer = window.setInterval(() => {
setElapsed((current) => Math.min(current + 25, typingDuration));
}, 25);
return () => window.clearInterval(timer);
}, [reducedMotion, running, complete]);
const titleLength = Math.max(
0,
Math.floor((elapsed - typingStart) / titleStep),
);
const subtitleLength = Math.max(
0,
Math.floor((elapsed - subtitleStart) / subtitleStep),
);
return (
<>
<h1
id="portal-hero-title"
className="max-w-5xl text-3xl leading-tight font-semibold tracking-tight text-white sm:text-5xl lg:text-6xl"
>
<TypewriterLine
text={heroTitle}
visibleText={
reducedMotion
? heroTitle
: heroTitle.slice(0, titleLength)
}
caret={!reducedMotion}
running={running}
/>
</h1>
<p className="mt-5 max-w-3xl text-lg leading-relaxed font-medium text-white sm:text-2xl">
<TypewriterLine
text={heroSubtitle}
visibleText={
reducedMotion
? heroSubtitle
: heroSubtitle.slice(0, subtitleLength)
}
running={running}
/>
</p>
</>
);
}
type PortalHeroProps = {
query: string;
setQuery: (value: string) => void;
onSearch: (event: FormEvent<HTMLFormElement>) => void;
onNavigate: (view: 'opportunities') => void;
stats?: HomeResponse['data']['stats'];
};
/** Reference visuals adapted to the V2 data and navigation contracts. */
export default function PortalHero({
query,
setQuery,
onSearch,
onNavigate,
stats,
}: PortalHeroProps) {
const [currentSlide, setCurrentSlide] = useState(0);
const [interacting, setInteracting] = useState(false);
const [hovering, setHovering] = useState(false);
const [pageVisible, setPageVisible] = useState(true);
// Start static for SSR and until the browser's motion preference is known.
const [reducedMotion, setReducedMotion] = useState(true);
useEffect(() => {
const preference = window.matchMedia(
'(prefers-reduced-motion: reduce)',
);
const updateMotion = () => setReducedMotion(preference.matches);
const updateVisibility = () => setPageVisible(!document.hidden);
updateMotion();
updateVisibility();
preference.addEventListener('change', updateMotion);
document.addEventListener('visibilitychange', updateVisibility);
return () => {
preference.removeEventListener('change', updateMotion);
document.removeEventListener('visibilitychange', updateVisibility);
};
}, []);
useEffect(() => {
if (reducedMotion || interacting || hovering || !pageVisible) return;
const timer = window.setInterval(() => {
setCurrentSlide((current) => (current + 1) % slides.length);
}, 8000);
return () => window.clearInterval(timer);
}, [reducedMotion, interacting, hovering, pageVisible]);
return (
<section
aria-labelledby="portal-hero-title"
className="portal-hero relative isolate overflow-hidden bg-[#101820] text-white"
onMouseEnter={() => setHovering(true)}
onMouseLeave={() => setHovering(false)}
onFocusCapture={() => setInteracting(true)}
onBlurCapture={(event) => {
if (!event.currentTarget.contains(event.relatedTarget))
setInteracting(false);
}}
>
<div className="absolute inset-0 -z-20" aria-hidden="true">
{slides.map((slide, index) => (
<picture key={slide.image}>
<source
media="(max-width: 640px)"
srcSet={slide.mobile}
/>
<img
src={slide.image}
alt=""
width={1920}
height={1280}
fetchPriority={index === 0 ? 'high' : 'low'}
decoding="async"
className={`portal-hero-image absolute inset-0 h-full w-full object-cover transition-opacity duration-1500 motion-reduce:transition-none ${currentSlide === index ? 'opacity-100' : 'opacity-0'}`}
/>
</picture>
))}
</div>
<div
className="absolute inset-0 -z-10 bg-linear-to-r from-black/75 via-black/65 to-black/60"
aria-hidden="true"
/>
<div
className="absolute inset-x-0 bottom-0 -z-10 h-48 bg-linear-to-t from-black/65 to-transparent"
aria-hidden="true"
/>
<div className="mx-auto flex min-h-[88svh] max-w-6xl flex-col items-center justify-center px-5 py-12 text-center sm:px-6 sm:py-16 lg:py-20">
<HeroAnimatedCopy
key={currentSlide}
reducedMotion={reducedMotion}
running={pageVisible}
/>
<p className="mt-3 max-w-3xl text-sm leading-relaxed text-white/90 sm:text-base">
Oportunidades reais de investimento em Moçambique,
organizadas por sector.
</p>
<p
id="portal-hero-description"
className="mt-2 max-w-2xl text-sm leading-relaxed text-white/80 sm:text-base"
>
Consulte projectos por província e estágio de maturidade,
compreenda os requisitos legais e fiscais, e manifeste
interesse directamente junto da entidade promotora.
</p>
<form
onSubmit={onSearch}
role="search"
aria-label="Pesquisar oportunidades"
className="mt-7 w-full max-w-4xl"
>
<label
htmlFor="portal-opportunity-search"
className="mb-2 block text-left text-sm font-medium text-white/90"
>
Pesquisa rápida de oportunidades
</label>
<div className="flex min-w-0 flex-col gap-2 rounded-2xl border border-white/30 bg-white p-1.5 shadow-2xl shadow-black/20 focus-within:ring-2 focus-within:ring-white focus-within:ring-offset-4 focus-within:ring-offset-[#101820] min-[400px]:flex-row">
<input
id="portal-opportunity-search"
type="search"
name="q"
value={query}
onChange={(event) => setQuery(event.target.value)}
placeholder="Ex.: agronegócio, Nampula, energia..."
className="h-12 w-full min-w-0 flex-1 rounded-xl border-0 bg-white px-4 text-base text-slate-900 outline-none placeholder:text-slate-500"
/>
<button
type="submit"
className="inline-flex min-h-12 shrink-0 items-center justify-center gap-2 rounded-xl bg-[#ed1c24] px-5 text-sm font-semibold text-white transition-colors hover:bg-[#c9141b] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ed1c24]"
>
<Search size={18} aria-hidden="true" />
Pesquisar
</button>
</div>
</form>
<div className="mt-6 flex flex-wrap items-center justify-center gap-3">
<button
onClick={() => onNavigate('opportunities')}
className="inline-flex min-h-11 items-center gap-2 rounded-xl bg-white px-5 py-3 text-sm font-semibold text-[#101820] transition-colors hover:bg-slate-100 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white"
>
Consultar oportunidades{' '}
<ArrowRight size={16} aria-hidden="true" />
</button>
<a
href="/simulador-fiscal"
className="inline-flex min-h-11 items-center rounded-xl border border-white/50 bg-black/15 px-5 py-3 text-sm font-semibold text-white transition-colors hover:bg-white/15 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-white"
>
Planear finanças
</a>
</div>
<dl
aria-label="Indicadores do portal"
className="mt-9 grid w-full max-w-lg grid-cols-3 gap-3 border-t border-white/25 pt-5"
>
{[
['oportunidades', stats?.opportunities],
['sectores', stats?.sectors],
['províncias', stats?.provinces],
].map(([label, value]) => (
<div
key={label}
className="flex flex-col-reverse gap-1"
>
<dt className="text-xs text-white/85 sm:text-sm">
{label}
</dt>
<dd className="text-2xl font-semibold text-white tabular-nums sm:text-3xl">
{value ?? '—'}
</dd>
</div>
))}
</dl>
</div>
</section>
);
}
@@ -0,0 +1,457 @@
import { Link } from '@inertiajs/react';
import { card, input } from '@/pages/investment/shared';
export type PreparationDocument = {
document_id: string;
file_name: string;
status: string;
malware_scan_status: string;
};
export type Preparation = {
version: string;
enabled: boolean;
mode: string;
period_covered: boolean;
scope_covered: boolean;
reason: string[];
missing_fields: string[];
missing_labels?: string[];
authority: string;
next: string;
calculation_notice: string;
notice: string;
source: { url: string; sha256: string };
authority_source: { reference: string; url: string };
questions: Array<{
key: string;
label: string;
type?: string;
options?: Record<string, string>;
when?: { field: string; equals: string };
source: string;
help?: string;
}>;
requirements: Array<{
key: string;
label: string;
state: string;
required: boolean;
document_id: string | null;
document: PreparationDocument | null;
stage: string;
reason: string;
source: { reference: string; url: string; period: string };
}>;
};
const states: Record<string, string> = {
not_applicable: 'Não aplicável neste contexto',
indeterminate: 'Informação em falta para decidir',
missing: 'Documento por associar',
associated: 'Documento associado — conteúdo por conferir',
};
export const preparationMode = (mode: string) =>
({
authorization: 'Pedido de autorização',
registration: 'Pedido de mero registo',
indeterminate: 'Enquadramento por determinar',
})[mode] ?? mode;
export function PreparationSummary({
data,
caseId,
}: {
data: Preparation | null | undefined;
caseId?: string;
}) {
if (!data) return null;
return (
<section
id="private-investment-preparation"
className={card + ' space-y-3'}
aria-label="Preparação adaptada do investimento privado"
>
<h2 className="text-xl font-bold">
Preparar o pedido de investimento privado
</h2>
{!data.enabled ? (
<p>
Use os dados deste dossier para identificar o pedido e os
documentos aplicáveis. A preparação é opcional e não atribui
benefícios.
</p>
) : (
<>
<p>
<strong>{preparationMode(data.mode)}</strong> · recorte
de 2026 ·{' '}
{data.version.replace(
'private-investment-preparation-',
'',
)}
</p>
<p>{data.next}</p>
{data.missing_fields.length > 0 && (
<p>
Informação em falta:{' '}
{(
data.missing_labels ??
data.missing_fields.map(
(key) =>
data.questions?.find(
(q) => q.key === key,
)?.label ??
(
{
currency: 'Moeda do projecto',
expected_start_date:
'Data prevista de início',
entity_stage:
'Situação da entidade',
} as Record<string, string>
)[key] ??
key,
)
).join('; ')}
.
</p>
)}
{!data.period_covered && (
<p>
Este incremento cobre pedidos com início previsto em
2026. Uma data em falta ou fora desse recorte não
permite determinar o pedido por este lote; os
restantes trabalhos do dossier continuam
disponíveis.
</p>
)}
{!data.scope_covered && (
<p>
Declare a actividade efectiva. Prospecção,
pesquisa/produção extractiva e investimento público
ou exclusivamente social/sem fins lucrativos seguem
enquadramentos próprios, fora deste lote.
</p>
)}
{data.reason.map((reason) => (
<p key={reason}>{reason}</p>
))}
<p>
Encaminhamento indicativo: {data.authority}.{' '}
<a
className="underline"
href={data.authority_source.url}
>
{data.authority_source.reference}
</a>
</p>
<ul className="space-y-3">
{data.requirements
.filter((r) => r.state !== 'not_applicable')
.map((r) => (
<li key={r.key} className="rounded border p-3">
<strong>{r.label}</strong> —{' '}
{states[r.state]}.{' '}
{r.document?.file_name && (
<span>
Ficheiro: {r.document.file_name}
.{' '}
</span>
)}
<p>
{r.reason}{' '}
<a
className="underline"
href={r.source.url}
>
Ver fundamento: {r.source.reference}
</a>{' '}
· {r.source.period}.
</p>
{caseId && (
<Link
className="underline"
href={`/investimentos/${caseId}/contexto/editar#preparation-documents`}
>
Rever dados ou associar documento do
dossier
</Link>
)}
</li>
))}
</ul>
<details>
<summary>
Exigências que não se aplicam — histórico preservado
</summary>
{data.requirements
.filter((r) => r.state === 'not_applicable')
.map((r) => (
<p key={r.key}>
{r.label}: {r.reason}{' '}
{r.document_id && (
<>
Associação anterior mantida
{r.document?.file_name
? `: ${r.document.file_name}`
: ''}
.
</>
)}{' '}
<a
className="underline"
href={r.source.url}
>
{r.source.reference}
</a>
</p>
))}
</details>
<p>{data.calculation_notice}</p>
<p>{data.notice}</p>
</>
)}
<a className="underline" href={data.source.url}>
Consultar o exemplar oficial e os fundamentos
</a>
{caseId && (
<p>
<Link
className="underline"
href={`/investimentos/${caseId}/contexto/editar#preparation-questions`}
>
Completar apenas os dados em falta ou editar declarações
</Link>
</p>
)}
</section>
);
}
export function PreparationEditor({
data,
fields,
changes,
documents,
links,
onChange,
onLink,
disabled,
}: {
data: Preparation;
fields: Record<string, string>;
changes: Record<string, string>;
documents: PreparationDocument[];
links: Record<string, string | null>;
onChange: (key: string, value: string) => void;
onLink: (key: string, value: string | null) => void;
disabled: boolean;
}) {
const values = { ...fields, ...changes };
const active = values.investment_preparation === 'yes';
const excluded = ['extractive', 'public_nonprofit'].includes(
values.investment_activity_scope,
);
const applicable = (q: Preparation['questions'][number]) =>
!q.when || values[q.when.field] === q.when.equals;
// Keep a field in place while the user edits it; collapse only recovered answers.
const known = (q: Preparation['questions'][number]) =>
!!fields[q.key] && fields[q.key] !== 'unknown';
const render = (q: Preparation['questions'][number]) => (
<label className="grid gap-1" key={q.key} htmlFor={'prep-' + q.key}>
{q.label}
{q.options ? (
<select
id={'prep-' + q.key}
className={input}
disabled={disabled}
value={values[q.key] ?? ''}
onChange={(e) => onChange(q.key, e.target.value)}
>
<option value="">Por indicar</option>
{Object.entries(q.options).map(([value, text]) => (
<option key={value} value={value}>
{text}
</option>
))}
</select>
) : (
<input
id={'prep-' + q.key}
className={input}
disabled={disabled}
type="text"
inputMode="decimal"
value={values[q.key] ?? ''}
onChange={(e) => onChange(q.key, e.target.value)}
/>
)}
<span className="text-sm">
{q.help} Fundamento: {q.source}.
</span>
</label>
);
const questions = data.questions.filter(
(q) =>
q.key !== 'investment_preparation' &&
applicable(q) &&
(!excluded || q.key === 'investment_activity_scope'),
);
const needed = questions.filter(
(q) =>
!known(q) &&
(!data.enabled ||
data.mode !== 'authorization' ||
data.missing_fields.includes(q.key)),
);
return (
<section
id="preparation-questions"
className={card + ' space-y-4'}
aria-label="Dados do pedido de investimento privado"
>
<h2 className="text-xl font-bold">
Dados em falta para preparar o pedido
</h2>
<p>
Valores conhecidos são reutilizados. As alterações só são
gravadas depois da comparação de impacto. Nacionalidade e
residência não determinam a origem do capital nem a modalidade
da empresa.
</p>
{render(data.questions[0])}
{active && (
<>
{needed.map(render)}
<details>
<summary>
Dados já declarados — consultar ou alterar
</summary>
<div className="space-y-3">
{questions.filter(known).map(render)}
</div>
</details>
<p>
Data, moeda e situação da entidade usam as declarações
acima.{' '}
{data.missing_fields.filter((k) =>
[
'currency',
'expected_start_date',
'entity_stage',
].includes(k),
).length > 0 &&
'Complete esses campos em falta antes de comparar.'}
</p>
<div id="preparation-documents" className="space-y-3">
<h3 className="font-bold">
Associar documentos já existentes no dossier
</h3>
<p>
Carregue documentos pelo Balcão Virtual do mesmo
dossier. A associação não aprova o conteúdo nem
substitui a análise do pedido.
</p>
{data.requirements
.filter((r) => r.required)
.map((r) => (
<label className="grid gap-1" key={r.key}>
{r.label}
<select
className={input}
disabled={disabled}
value={
Object.hasOwn(links, r.key)
? (links[r.key] ?? '')
: (r.document_id ?? '')
}
onChange={(e) =>
onLink(
r.key,
e.target.value || null,
)
}
>
<option value="">Por associar</option>
{documents.map((doc) => (
<option
key={doc.document_id}
value={doc.document_id}
>
{doc.file_name} ·{' '}
{{
quarantined:
'Em quarentena',
active: 'Disponível',
deleted: 'Removido',
}[doc.status] ??
'Estado por conferir'}
</option>
))}
</select>
<span>
{r.reason}{' '}
<a
className="underline"
href={r.source.url}
>
{r.source.reference}
</a>
</span>
</label>
))}
</div>
</>
)}
<p>
Compare o impacto para actualizar o enquadramento, as perguntas
e as exigências. Uma exigência que deixe de ser aplicável
conserva o documento anterior no histórico.
</p>
</section>
);
}
export function PreparationImpact({
before,
after,
}: {
before: Preparation;
after: Preparation;
}) {
return (
<div
className="space-y-2 rounded border border-amber-400 p-3"
aria-label="Impacto no pedido de investimento"
>
<h3 className="font-bold">Impacto no pedido e nos documentos</h3>
<p>
{preparationMode(before.mode)} → {preparationMode(after.mode)}.
</p>
<p>Próximo passo: {after.next}.</p>
<ul className="list-disc pl-5">
{after.requirements
.filter(
(r) =>
before.requirements.find((b) => b.key === r.key)
?.state !== r.state,
)
.map((r) => (
<li key={r.key}>
{r.label}:{' '}
{
states[
before.requirements.find(
(b) => b.key === r.key,
)?.state ?? 'indeterminate'
]
}{' '}
→ {states[r.state]}.{' '}
{r.document_id && 'Vínculo documental preservado.'}
</li>
))}
</ul>
<p>{after.calculation_notice}</p>
<PreparationSummary data={after} />
</div>
);
}
@@ -0,0 +1,197 @@
import { ArrowRight } from 'lucide-react';
import { useState } from 'react';
import {
HOME_SECTION,
HOME_SECTION_HEADING,
PORTAL_MORE_LINK,
} from '@/lib/portal-presentation';
export type PublicSector = {
slug: string;
name: string;
description: string | null;
opportunitiesCount: number;
url?: string;
specializations?: { id: number; name: string; url: string }[];
};
const images: Record<string, string> = {
agronegocio: 'agronegocio',
turismo: 'turismo',
infraestruturas: 'infraestruturas',
'economia-azul': 'economia-azul',
'mercado-financeiro': 'servicos-financeiros',
'servicos-financeiros': 'servicos-financeiros',
fintech: 'tic-economia-digital',
mineracao: 'mineracao',
energia: 'energia',
'energia-especifica': 'energia',
imobiliario: 'outros-sectores',
'bens-de-consumo-e-franquias': 'industria',
'bens-de-consumo-franquias': 'industria',
'tecnologias-de-informacao': 'tic-economia-digital',
'tic-economia-digital': 'tic-economia-digital',
industria: 'industria',
'logistica-transportes': 'logistica-transportes',
};
const imageDescriptions: Record<string, string> = {
agronegocio: 'Campos agrícolas e instalações de transformação de produtos.',
turismo: 'Alojamento turístico junto à costa e à vegetação tropical.',
infraestruturas: 'Ponte rodoviária sobre um rio, ligando áreas urbanas.',
'economia-azul': 'Actividades de pesca e aquacultura numa zona costeira.',
'servicos-financeiros':
'Edifícios empresariais e serviços num espaço urbano.',
mineracao:
'Exploração mineira a céu aberto com instalações de processamento.',
energia:
'Painéis solares e infra-estruturas de transporte de electricidade.',
industria:
'Unidade industrial com área de armazenagem e movimentação de mercadorias.',
'tic-economia-digital':
'Infra-estruturas de telecomunicações num ambiente urbano.',
'logistica-transportes':
'Terminal portuário com contentores e transporte ferroviário.',
'outros-sectores': 'Espaço empresarial e edifícios urbanos ao fundo.',
};
function SectorImage({ slug, preview }: { slug: string; preview: boolean }) {
const [failed, setFailed] = useState(0);
const image = failed
? 'outros-sectores'
: (images[slug] ?? 'outros-sectores');
const base = `/images/sectors/${image}`;
if (failed > 1) return <span className="absolute inset-0 bg-slate-800" />;
return (
<img
src={`${base}.webp`}
srcSet={`${base}-480.webp 480w, ${base}.webp 960w`}
sizes={
preview
? '(min-width: 1152px) 266px, (min-width: 1024px) 25vw, 50vw'
: '(min-width: 1152px) 357px, (min-width: 1024px) 33vw, (min-width: 640px) 50vw, 100vw'
}
width={960}
height={540}
alt={imageDescriptions[image]}
loading="lazy"
decoding="async"
className="h-full w-full object-cover transition-transform duration-500 motion-safe:group-hover:scale-105"
onError={() => setFailed((current) => Math.min(current + 1, 2))}
/>
);
}
export function PublicSectorCards({
sectors,
preview = false,
}: {
sectors: PublicSector[];
preview?: boolean;
}) {
return (
<div
className={
preview
? 'grid grid-cols-2 gap-4 lg:grid-cols-4'
: 'grid gap-5 sm:grid-cols-2 lg:grid-cols-3'
}
>
{sectors.map((sector) => {
const href =
sector.url ??
`/sectores/${sector.slug.split('/').map(encodeURIComponent).join('/')}`;
const titleId = `public-sector-${sector.slug.replaceAll('/', '-')}`;
return (
<article
key={sector.slug}
className="group flex min-w-0 flex-col overflow-hidden rounded-xl border border-slate-200 bg-white shadow-sm transition-colors hover:border-[#ed1c24]"
>
<a
href={href}
aria-labelledby={titleId}
className="relative block h-40 shrink-0 overflow-hidden focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-[#ed1c24] sm:h-44"
>
<SectorImage slug={sector.slug} preview={preview} />
<span
aria-hidden="true"
className="absolute inset-0 bg-linear-to-t from-black/85 via-black/20 to-transparent"
/>
<h3
id={titleId}
className="absolute right-3 bottom-3 left-3 text-sm leading-5 font-bold wrap-break-word text-white drop-shadow-lg min-[375px]:text-base sm:text-lg sm:leading-6"
>
{sector.name}
</h3>
</a>
<div className="flex flex-1 flex-col gap-2 p-3 sm:p-4">
{sector.description && (
<p className="line-clamp-3 text-sm leading-5 wrap-break-word text-slate-600">
{sector.description}
</p>
)}
{sector.specializations?.map((child) => (
<a
key={child.id}
href={child.url}
className="text-xs font-semibold text-slate-700 underline underline-offset-2 focus-visible:outline-2 focus-visible:outline-[#ed1c24]"
>
Especialização:{' '}
{child.name.replace(
'Mercado Financeiro — ',
'',
)}
</a>
))}
<div className="mt-auto pt-1">
<p className="text-xs leading-5 text-slate-500">
{sector.opportunitiesCount} oportunidade
{sector.opportunitiesCount === 1 ? '' : 's'}
</p>
<a
href={href}
aria-label={`Ler mais sobre ${sector.name}`}
className="inline-flex min-h-11 items-center gap-1.5 text-xs font-bold text-[#ed1c24] hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ed1c24]"
>
Ler mais{' '}
<ArrowRight size={14} aria-hidden="true" />
</a>
</div>
</div>
</article>
);
})}
</div>
);
}
export function HomepageSectors({ sectors }: { sectors: PublicSector[] }) {
return (
<section
aria-labelledby="home-sectors-heading"
className={HOME_SECTION}
>
<h2 id="home-sectors-heading" className={HOME_SECTION_HEADING}>
Sectores de investimento
</h2>
<p className="mt-2 max-w-2xl text-slate-600">
Explore as áreas prioritárias do programa de investimento
nacional.
</p>
<div className="mt-5">
<PublicSectorCards sectors={sectors.slice(0, 4)} preview />
{!sectors.length && (
<p className="text-slate-600">
Não existem sectores publicados.
</p>
)}
</div>
<div className="mt-5 flex justify-center">
<a href="/sectores" className={PORTAL_MORE_LINK}>
Ver mais sectores{' '}
<ArrowRight size={14} aria-hidden="true" />
</a>
</div>
</section>
);
}
+5 -3
View File
@@ -1,4 +1,5 @@
import SearchFeedback from '@/components/search-feedback'; import SearchFeedback from '@/components/search-feedback';
import { searchTerritoryHref } from '@/lib/search-territory';
import { Link, usePage } from '@inertiajs/react'; import { Link, usePage } from '@inertiajs/react';
import { createContext, useContext } from 'react'; import { createContext, useContext } from 'react';
import { PortalGroupedMenu } from '@/components/portal-grouped-menu'; import { PortalGroupedMenu } from '@/components/portal-grouped-menu';
@@ -24,6 +25,7 @@ export const portalLinks = [
['/apoio', 'Apoio ao Investidor'], ['/apoio', 'Apoio ao Investidor'],
] as const; ] as const;
const names: Record<string, string> = { const names: Record<string, string> = {
'/contextos-de-investimento': 'Contextos de investimento',
'/sobre': 'Sobre nós', '/sobre': 'Sobre nós',
'/contacto': 'Contacto', '/contacto': 'Contacto',
'/politica-de-privacidade': 'Política de Privacidade', '/politica-de-privacidade': 'Política de Privacidade',
@@ -148,7 +150,7 @@ export default function PortalNavigation({
{parent && ( {parent && (
<> <>
<Link <Link
href={parent} href={searchTerritoryHref(parent, url)}
className="underline" className="underline"
> >
{names[parent]} {names[parent]}
@@ -175,11 +177,11 @@ export default function PortalNavigation({
</div> </div>
<aside <aside
aria-label="Contacto de apoio ao investidor" aria-label="Contacto de apoio ao investidor"
className={printable ? 'print:hidden' : undefined} className={`mx-auto flex max-w-6xl justify-center px-5 pt-4 ${printable ? 'print:hidden' : ''}`}
> >
<a <a
href="/apoio" href="/apoio"
className="mx-3 mt-4 block max-w-[calc(100%-1.5rem)] rounded-xl bg-emerald-800 px-5 py-3 text-center text-sm font-semibold text-white shadow-xl focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-emerald-600" className="inline-flex min-h-11 max-w-full items-center justify-center rounded-lg bg-[#ed1c24] px-4 py-2 text-center text-sm font-semibold text-white shadow-sm transition-colors hover:bg-[#c9141b] focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#ed1c24]"
> >
Contactar Apoio ao Investidor Contactar Apoio ao Investidor
</a> </a>
+2 -1
View File
@@ -1,3 +1,4 @@
import { searchTerritoryHref } from './search-territory.ts';
/** Only a query string is carried; the return destination is always local. */ /** Only a query string is carried; the return destination is always local. */
export function catalogueDetailHref(path: string, query: string): string { export function catalogueDetailHref(path: string, query: string): string {
return query return query
@@ -8,5 +9,5 @@ export function catalogueReturnHref(base: string, pageUrl: string): string {
const query = new URL(pageUrl, 'https://portal.invalid').searchParams.get( const query = new URL(pageUrl, 'https://portal.invalid').searchParams.get(
'catalogue_query', 'catalogue_query',
); );
return base + (query ? `?${new URLSearchParams(query).toString()}` : ''); return searchTerritoryHref(base + (query ? `?${new URLSearchParams(query).toString()}` : ''), pageUrl);
} }
+2
View File
@@ -57,6 +57,8 @@ export function inheritSimulatorFields<T extends Record<string,unknown>>(draft:T
if(/^\d{4}-\d{2}-\d{2}$/.test(start)) source.monthly_iva_start=start.slice(0,7); if(/^\d{4}-\d{2}-\d{2}$/.test(start)) source.monthly_iva_start=start.slice(0,7);
else if(/^\d{4}$/.test(String(draft.fiscal_period)) && draft.fiscal_periodicity==='monthly' && /^(0?[1-9]|1[0-2])$/.test(String(draft.fiscal_month))) source.monthly_iva_start=`${draft.fiscal_period}-${String(draft.fiscal_month).padStart(2,'0')}`; else if(/^\d{4}$/.test(String(draft.fiscal_period)) && draft.fiscal_periodicity==='monthly' && /^(0?[1-9]|1[0-2])$/.test(String(draft.fiscal_month))) source.monthly_iva_start=`${draft.fiscal_period}-${String(draft.fiscal_month).padStart(2,'0')}`;
if(!settingsValid) delete source.monthly_iva_start; if(!settingsValid) delete source.monthly_iva_start;
// Legacy drafts without a compatible source need no inheritance marker or autosave churn.
if (!Object.keys(source).length && !draft.compatible_fields_snapshot) return draft;
const values={...draft,monthly_iva_start:settings.start ?? ''}; const values={...draft,monthly_iva_start:settings.start ?? ''};
const patch=inheritCompatibleFields('simulator-compatible-fields',values,source,draft.compatible_fields_snapshot); const patch=inheritCompatibleFields('simulator-compatible-fields',values,source,draft.compatible_fields_snapshot);
const next:Record<string,unknown>={...draft,...patch.patch,compatible_fields_snapshot:patch.metadata}; const next:Record<string,unknown>={...draft,...patch.patch,compatible_fields_snapshot:patch.metadata};
+21
View File
@@ -1,3 +1,7 @@
import type {
Preparation,
PreparationDocument,
} from '@/components/private-investment-preparation';
function csrfToken(): string { function csrfToken(): string {
return decodeURIComponent( return decodeURIComponent(
document.cookie document.cookie
@@ -56,6 +60,8 @@ export type DossierContext = {
dependency_hash?: string; dependency_hash?: string;
}; };
export type ContextView = { export type ContextView = {
private_investment?: Preparation | null;
preparation_documents?: PreparationDocument[];
simulator_context_revision?: number | null; simulator_context_revision?: number | null;
case: { id: string; title: string; version: number }; case: { id: string; title: string; version: number };
context: DossierContext; context: DossierContext;
@@ -73,6 +79,7 @@ export type ContextView = {
notice: string; notice: string;
}; };
export type ContextPlan = { export type ContextPlan = {
private_investment?: { before: Preparation; after: Preparation } | null;
preview_hash: string; preview_hash: string;
version: number; version: number;
revision: number; revision: number;
@@ -119,6 +126,20 @@ export async function contextApi<T>(
return data as T; return data as T;
} }
export const contextFieldNames: Record<string, string> = { export const contextFieldNames: Record<string, string> = {
investment_form: 'Tipo do investimento',
investment_preparation: 'Preparação do pedido',
investment_activity_scope: 'Natureza da actividade',
implementation_mode: 'Modalidade da empresa',
capital_origin: 'Origem dos capitais',
site_tenure: 'Utilização das instalações',
project_concession: 'PPP ou concessão empresarial',
significant_implications: 'Implicações significativas',
land_extension: 'Extensão de terra',
forest_concession: 'Concessão florestal',
forest_concession_hectares: 'Área florestal em hectares',
total_investment: 'Valor total do investimento',
area_required: 'Área de terra requerida',
area_unit: 'Unidade da área',
title: 'Título do investimento', title: 'Título do investimento',
territory_id: 'Localização documentada', territory_id: 'Localização documentada',
location_source: 'Origem da localização', location_source: 'Origem da localização',
+1
View File
@@ -1,4 +1,5 @@
export type Sector = { export type Sector = {
url?: string;
slug: string; slug: string;
name: string; name: string;
specializations?: { id: number; name: string; slug: string; url: string }[]; specializations?: { id: number; name: string; slug: string; url: string }[];
+10
View File
@@ -0,0 +1,10 @@
export const HOME_SECTION_HEADING =
'text-2xl leading-8 font-bold text-slate-900';
export const HOME_SECTION = 'mx-auto max-w-6xl px-5 py-5 sm:py-6';
export const HOME_SECTION_BAND =
'border-t border-slate-200 bg-white py-5 sm:py-6';
export const PORTAL_MORE_LINK =
'inline-flex min-h-11 items-center justify-center gap-1.5 rounded-full border border-[#ed1c24] bg-white px-5 py-2 text-xs font-bold text-[#ed1c24] transition-colors hover:bg-[#ed1c24] hover:text-white focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#ed1c24]';
+94 -11
View File
@@ -279,15 +279,75 @@ function makeSections(
if (draft.context_applicability_snapshot) { if (draft.context_applicability_snapshot) {
try { try {
const context = JSON.parse(String(draft.context_applicability_snapshot)); const context = JSON.parse(
String(draft.context_applicability_snapshot),
);
if (context.version === 1) { if (context.version === 1) {
const section = sections.get('sources'); const section = sections.get('sources');
const zone = context.zone; const zone = context.zone;
section?.rows.push({field:'Contexto do investimento',value:`Revisão ${context.context_revision}; ${zone ? `${zone.title}, versão ${zone.version}` : 'sem ZEE, ZFI ou parque seleccionado'}`,origin:'Referência do mesmo dossier no momento da gravação',classification:'Contexto versionado; não é reconhecimento jurídico'}); section?.rows.push({
section?.paragraphs.push(zone ? 'Benefício fiscal da zona indeterminado: falta regra executável ligada às condições e reconhecimento. O IVA apresentado é apenas cenário geral sem benefício; não representa o regime especial nem o apuramento final.' : 'Cenário geral de preparação; sem confirmação automática de elegibilidade fiscal.'); field: 'Contexto do investimento',
if(zone?.href) section?.rows.push({field:'Ficha e fundamentos da zona',value:zone.href,origin:`Versão consultada ${zone.version}`,classification:'Referência consultável; condições por verificar'}); value: `Revisão ${context.context_revision}; ${zone ? `${zone.title}, versão ${zone.version}` : 'sem ZEE, ZFI ou parque seleccionado'}`,
origin: 'Referência do mesmo dossier no momento da gravação',
classification:
'Contexto versionado; não é reconhecimento jurídico',
});
section?.paragraphs.push(
zone
? 'Benefício fiscal da zona indeterminado: falta regra executável ligada às condições e reconhecimento. O IVA apresentado é apenas cenário geral sem benefício; não representa o regime especial nem o apuramento final.'
: 'Cenário geral de preparação; sem confirmação automática de elegibilidade fiscal.',
);
const preparation = context.preparation;
if (preparation?.enabled) {
const modes: Record<string, string> = {
authorization: 'Pedido de autorização',
registration: 'Pedido de mero registo',
indeterminate: 'Enquadramento por determinar',
};
section?.rows.push({
field: 'Preparação do investimento privado',
value: modes[preparation.mode] ?? 'Por determinar',
origin: `Contexto congelado v${context.context_revision}; ${preparation.version}`,
classification:
'Declarações e requisitos de preparação; sem aprovação jurídica',
});
section?.paragraphs.push(
preparation.next,
preparation.calculation_notice,
preparation.notice,
);
for (const requirement of preparation.requirements ?? [])
section?.rows.push({
field: requirement.label,
value:
requirement.state === 'not_applicable'
? 'Não aplicável; histórico preservado'
: requirement.state === 'associated'
? `Associado: ${requirement.document?.file_name ?? 'documento do dossier'}; conteúdo por conferir`
: requirement.state === 'missing'
? 'Documento por associar'
: 'Informação em falta para decidir',
origin: `${requirement.reason} ${requirement.source?.reference ?? ''}; ${requirement.source?.url ?? ''}`,
classification:
'Preparação informativa — simulação, sem submissão à Administração',
});
}
if (zone?.href)
section?.rows.push({
field: 'Ficha e fundamentos da zona',
value: zone.href,
origin: `Versão consultada ${zone.version}`,
classification:
'Referência consultável; condições por verificar',
});
}
} catch {
sections
.get('sources')
?.paragraphs.push(
'Não foi possível recuperar o contexto guardado; o enquadramento territorial permanece indeterminado.',
);
} }
} catch { sections.get('sources')?.paragraphs.push('Não foi possível recuperar o contexto guardado; o enquadramento territorial permanece indeterminado.'); }
} }
for (const [sectionName, field, value, origin] of rows.slice(1)) { for (const [sectionName, field, value, origin] of rows.slice(1)) {
@@ -359,9 +419,23 @@ function makeSections(
} }
const finance = sections.get('finance'); const finance = sections.get('finance');
if (finance && ['fiscal_rule_qa_preview', 'fiscal_rule_published'].includes(String(currentCalculation?.snapshot?.scenario_kind)) && currentCalculation?.snapshot) { if (
for (const [field, value] of fiscalQaRows(currentCalculation.snapshot)) { finance &&
finance.rows.push({ field, value, origin: 'Snapshot fiscal preservado; sem recálculo', classification: 'Cálculo exacto; ver estado da regra no snapshot; não é saldo a pagar' }); ['fiscal_rule_qa_preview', 'fiscal_rule_published'].includes(
String(currentCalculation?.snapshot?.scenario_kind),
) &&
currentCalculation?.snapshot
) {
for (const [field, value] of fiscalQaRows(
currentCalculation.snapshot,
)) {
finance.rows.push({
field,
value,
origin: 'Snapshot fiscal preservado; sem recálculo',
classification:
'Cálculo exacto; ver estado da regra no snapshot; não é saldo a pagar',
});
} }
} }
if (finance && currentCalculation) { if (finance && currentCalculation) {
@@ -436,13 +510,22 @@ function makeSections(
}, },
{ {
field: 'Fórmula e valores usados', field: 'Fórmula e valores usados',
value: value: [
['fiscal_rule_qa_preview', 'fiscal_rule_published'].includes(String(snapshot?.scenario_kind)) 'fiscal_rule_qa_preview',
'fiscal_rule_published',
].includes(String(snapshot?.scenario_kind))
? `Base tributável declarada × taxa cadastrada ÷ 100; cálculo decimal exacto, sem arredondamento. Ver regra e proveniência acima.` ? `Base tributável declarada × taxa cadastrada ÷ 100; cálculo decimal exacto, sem arredondamento. Ver regra e proveniência acima.`
: snapshot && typeof snapshot.formula_version === 'string' : snapshot && typeof snapshot.formula_version === 'string'
? `Fórmula ${snapshot.formula_version}; base ${displayValue(snapshot.base, 'não disponível')}; taxa ${displayValue(snapshot.rate_percent, 'não disponível')}%; redução ${displayValue(snapshot.reduction_percent, 'não disponível')}%; moeda ${displayValue(snapshot.currency, 'não indicada')}` ? `Fórmula ${snapshot.formula_version}; base ${displayValue(snapshot.base, 'não disponível')}; taxa ${displayValue(snapshot.rate_percent, 'não disponível')}%; redução ${displayValue(snapshot.reduction_percent, 'não disponível')}%; moeda ${displayValue(snapshot.currency, 'não indicada')}`
: 'A fórmula não foi identificada no snapshot; ver explicação da execução', : 'A fórmula não foi identificada no snapshot; ver explicação da execução',
origin: ['fiscal_rule_qa_preview', 'fiscal_rule_published'].includes(String(snapshot?.scenario_kind)) ? (snapshot?.scenario_kind === 'fiscal_rule_published' ? 'Versão publicada na admissão; sem validação jurídica da operação' : 'Snapshot QA de regra em rascunho; sem activação ou validação jurídica da operação') : 'Snapshot guardado; sem aplicação de regra legal', origin: [
'fiscal_rule_qa_preview',
'fiscal_rule_published',
].includes(String(snapshot?.scenario_kind))
? snapshot?.scenario_kind === 'fiscal_rule_published'
? 'Versão publicada na admissão; sem validação jurídica da operação'
: 'Snapshot QA de regra em rascunho; sem activação ou validação jurídica da operação'
: 'Snapshot guardado; sem aplicação de regra legal',
classification: 'Reutilização do resultado existente', classification: 'Reutilização do resultado existente',
}, },
{ {
+24
View File
@@ -0,0 +1,24 @@
const levels = ['province_id', 'district_id', 'admin_post_id', 'locality_id'];
const searchRoutes = ['/carteira', '/oportunidades', '/zonas', '/educacao'];
/** URL-scoped search context, never a saved investment or another browser tab. */
export function searchTerritoryHref(href: string, pageUrl: string): string {
const base = 'https://portal.invalid';
const source = new URL(pageUrl, base);
const target = new URL(href, base);
const supported = (path: string) => searchRoutes.some((route) => path === route || path.startsWith(`${route}/`));
if (target.origin !== base || !supported(source.pathname) || !supported(target.pathname)) return href;
const inherited = source.searchParams.has('catalogue_query')
? new URLSearchParams(source.searchParams.get('catalogue_query')!)
: source.searchParams;
// An explicit ancestor, including an explicit empty value, overrides its descendants.
let changed = false;
for (const field of levels) {
if (target.searchParams.has(field)) {
changed ||= target.searchParams.get(field) !== inherited.get(field);
} else if (!changed && inherited.get(field)) {
target.searchParams.set(field, inherited.get(field)!);
}
}
return target.pathname + target.search + target.hash;
}
+188 -331
View File
@@ -1,3 +1,12 @@
import { HomepageSectors } from '@/components/public-sector-cards';
import {
HOME_SECTION,
HOME_SECTION_BAND,
HOME_SECTION_HEADING,
} from '@/lib/portal-presentation';
import InvestmentContextCards from '@/components/investment-context-cards';
import InvestmentSteps from '@/components/investment-steps';
import PortalHero from '@/components/portal-hero';
import SearchState from '@/components/search-state'; import SearchState from '@/components/search-state';
import { useInterestDraft } from '@/hooks/use-interest-draft'; import { useInterestDraft } from '@/hooks/use-interest-draft';
import { createContext, useContext, useRef, useState } from 'react'; import { createContext, useContext, useRef, useState } from 'react';
@@ -7,7 +16,6 @@ import { ProvinceSelect } from '@/components/investment-territory';
import { MATURITY_LEVELS } from '@/lib/investment-maturity'; import { MATURITY_LEVELS } from '@/lib/investment-maturity';
import CountrySelect, { type Country } from '@/components/country-select'; import CountrySelect, { type Country } from '@/components/country-select';
import type { Dispatch, FormEvent, ReactNode, SetStateAction } from 'react'; import type { Dispatch, FormEvent, ReactNode, SetStateAction } from 'react';
import type { LucideIcon } from 'lucide-react';
import { usePortalQuery } from '@/hooks/use-portal-query'; import { usePortalQuery } from '@/hooks/use-portal-query';
import { import {
PortalApiError, PortalApiError,
@@ -30,30 +38,20 @@ import type {
Sector, Sector,
} from '@/lib/portal-api'; } from '@/lib/portal-api';
import { import {
Search,
Leaf,
Zap,
Hotel,
Truck,
Waves,
Banknote,
ArrowRight,
ArrowLeft, ArrowLeft,
MapPin, MapPin,
CheckCircle2, CheckCircle2,
LogIn,
FileText,
Scale,
Handshake,
Calculator,
ArrowRight,
} from 'lucide-react'; } from 'lucide-react';
type View = 'home' | 'opportunities' | 'detail' | 'interest'; type View = 'home' | 'opportunities' | 'detail' | 'interest';
type OpportunityAction = (opportunity: Opportunity) => void; type OpportunityAction = (opportunity: Opportunity) => void;
const SectorContext = createContext<Sector[]>([]); const SectorContext = createContext<Sector[]>([]);
const SECTOR_ICONS: Record<string, LucideIcon> = {
agronegocio: Leaf,
energia: Zap,
turismo: Hotel,
infraestruturas: Truck,
'economia-azul': Waves,
'mercado-financeiro': Banknote,
};
function QueryStatus({ function QueryStatus({
loading, loading,
@@ -68,7 +66,7 @@ function QueryStatus({
return ( return (
<p <p
role="status" role="status"
className="mx-auto max-w-6xl px-5 py-8 text-slate-600" className="mx-auto max-w-6xl px-5 py-5 text-slate-600 sm:py-6"
> >
A carregar dados... A carregar dados...
</p> </p>
@@ -77,7 +75,7 @@ function QueryStatus({
return ( return (
<div <div
role="alert" role="alert"
className="mx-auto my-6 max-w-6xl rounded-xl border border-red-200 bg-red-50 p-5 text-red-800" className="mx-auto my-5 max-w-6xl rounded-xl border border-red-200 bg-red-50 p-5 text-red-800"
> >
<p>{error}</p> <p>{error}</p>
<button <button
@@ -137,172 +135,6 @@ function TopBar({
); );
} }
function Hero({
query,
setQuery,
onSearch,
onNavigate,
stats,
}: {
query: string;
setQuery: (value: string) => void;
onSearch: (event: FormEvent<HTMLFormElement>) => void;
onNavigate: (view: View) => void;
stats?: HomeResponse['data']['stats'];
}) {
return (
<section className="border-b border-slate-200 bg-[#0B2038] text-white">
<div className="mx-auto grid max-w-6xl gap-10 px-5 py-16 md:py-24">
<div className="text-center">
<p className="text-4xl leading-tight font-black tracking-tight text-emerald-300 uppercase md:text-6xl">
INVISTA EM MOÇAMBIQUE
</p>
<h1 className="mx-auto mt-4 max-w-4xl text-4xl leading-[1.05] font-black tracking-tight md:text-5xl">
Transforme informação em decisões
<span className="text-amber-400">
{' '}
e ideias em negócios reais.
</span>
</h1>
<p className="mx-auto mt-6 max-w-3xl text-lg font-semibold text-slate-200">
Oportunidades reais de investimento em Moçambique,
organizadas por sector.
</p>
<p className="mx-auto mt-5 max-w-2xl text-slate-300">
Consulte projectos por província e estágio de
maturidade, compreenda os requisitos legais e fiscais, e
manifeste interesse directamente junto da entidade
promotora.
</p>
<div className="mt-8 flex flex-wrap justify-center gap-3">
<button
onClick={() => onNavigate('opportunities')}
className="inline-flex items-center gap-2 rounded-lg bg-amber-400 px-5 py-3 font-bold text-[#0B2038] hover:bg-amber-300"
>
Consultar oportunidades <ArrowRight size={16} />
</button>
<a
href="/simulador-fiscal"
className="rounded-lg border border-emerald-300 px-5 py-3 font-semibold text-emerald-100 hover:bg-emerald-900"
>
Planear finanças
</a>
</div>
</div>
<form
onSubmit={onSearch}
className="h-fit rounded-2xl border border-white/10 bg-white/10 p-5"
>
<label
htmlFor="portal-opportunity-search"
className="mb-2 block text-sm font-semibold text-slate-200"
>
Pesquisa rápida
</label>
<div className="flex gap-2">
<input
id="portal-opportunity-search"
type="search"
value={query}
onChange={(e) => setQuery(e.target.value)}
placeholder="Ex.: agronegócio, Nampula, energia..."
className="w-full rounded-lg bg-white px-3 py-2.5 text-sm text-slate-900 ring-2 ring-transparent outline-none placeholder:text-slate-500 focus:ring-amber-400"
/>
<button
type="submit"
aria-label="Pesquisar oportunidades"
className="rounded-lg bg-amber-400 px-4 text-[#0B2038]"
>
<Search size={18} />
</button>
</div>
<div className="mt-4 flex flex-wrap gap-3 border-t border-white/10 pt-4 text-center text-xs text-slate-300">
<div>
<p className="text-xl font-black text-white">
{stats?.opportunities ?? '—'}
</p>
oportunidades
</div>
<div className="ml-auto">
<p className="text-xl font-black text-white">
{stats?.sectors ?? '—'}
</p>
sectores
</div>
<div className="ml-auto">
<p className="text-xl font-black text-white">
{stats?.provinces ?? '—'}
</p>
províncias
</div>
</div>
</form>
</div>
</section>
);
}
function SectorGrid({
onSelectSector,
}: {
onSelectSector: (slug: string) => void;
}) {
const sectors = useContext(SectorContext);
return (
<section className="mx-auto max-w-6xl px-5 py-16">
<h2 className="text-2xl font-black text-slate-900">
Sectores estratégicos
</h2>
<p className="mt-2 max-w-2xl text-slate-600">
Explore as áreas prioritárias do programa de investimento
nacional.
</p>
<div className="mt-8 grid gap-5 sm:grid-cols-2 lg:grid-cols-3">
{sectors.map((sector) => {
const Icon = SECTOR_ICONS[sector.slug] ?? Banknote;
const count = sector.opportunitiesCount;
return (
<button
key={sector.slug}
onClick={() => onSelectSector(sector.slug)}
className="group rounded-2xl border border-slate-200 bg-white p-6 text-left shadow-sm transition hover:-translate-y-0.5 hover:border-emerald-300 hover:shadow-md"
>
<div className="flex h-11 w-11 items-center justify-center rounded-xl bg-emerald-50 text-emerald-700">
<Icon size={22} />
</div>
<h3 className="mt-4 font-bold text-slate-900">
{sector.name}
</h3>
<p className="mt-2 text-sm leading-relaxed text-slate-600">
{sector.shortDescription}
</p>
{sector.specializations?.map((child) => (
<span
key={child.id}
className="mt-3 block text-sm font-semibold text-emerald-800"
>
Especialização:{' '}
{child.name.replace(
'Mercado Financeiro — ',
'',
)}
</span>
))}
<p className="mt-4 text-sm font-semibold text-emerald-700 group-hover:underline">
{count} oportunidade{count === 1 ? '' : 's'} →
</p>
</button>
);
})}
</div>
</section>
);
}
function OpportunityCard({ function OpportunityCard({
opportunity, opportunity,
onView, onView,
@@ -392,7 +224,12 @@ function OpportunitiesView({
return ( return (
<section className="mx-auto max-w-6xl px-5 py-12"> <section className="mx-auto max-w-6xl px-5 py-12">
<SearchState loading={query.loading} error={query.error} total={total} retry={query.retry} /> <SearchState
loading={query.loading}
error={query.error}
total={total}
retry={query.retry}
/>
<h1 className="text-3xl font-black text-slate-900"> <h1 className="text-3xl font-black text-slate-900">
Oportunidades de investimento Oportunidades de investimento
</h1> </h1>
@@ -705,7 +542,9 @@ function InterestForm({
const pending = useRef(false); const pending = useRef(false);
const submission = useRef<{ body: string; key: string } | null>(null); const submission = useRef<{ body: string; key: string } | null>(null);
const [submitError, setSubmitError] = useState<string | null>(null); const [submitError, setSubmitError] = useState<string | null>(null);
const draft = useInterestDraft<InterestFormData>('opportunity:' + (preselected?.reference ?? 'general'), { const draft = useInterestDraft<InterestFormData>(
'opportunity:' + (preselected?.reference ?? 'general'),
{
name: '', name: '',
email: '', email: '',
phone: '', phone: '',
@@ -717,7 +556,8 @@ function InterestForm({
investmentRange: '', investmentRange: '',
message: '', message: '',
privacyConsent: false, privacyConsent: false,
}); },
);
const { form, setForm } = draft; const { form, setForm } = draft;
const [errors, setErrors] = useState<FormErrors>({}); const [errors, setErrors] = useState<FormErrors>({});
const [result, setResult] = useState<{ reference: string } | null>(null); const [result, setResult] = useState<{ reference: string } | null>(null);
@@ -779,7 +619,10 @@ function InterestForm({
setResult({ reference: response.data.reference }); setResult({ reference: response.data.reference });
onSubmitted(); onSubmitted();
} catch (error: unknown) { } catch (error: unknown) {
if (error instanceof PortalApiError && error.status === 401) { draft.authenticate(); return; } if (error instanceof PortalApiError && error.status === 401) {
draft.authenticate();
return;
}
if (error instanceof PortalApiError) { if (error instanceof PortalApiError) {
setErrors(fieldErrors(error)); setErrors(fieldErrors(error));
setSubmitError(error.message); setSubmitError(error.message);
@@ -805,7 +648,13 @@ function InterestForm({
A sua referência é <strong>{result.reference}</strong>. A A sua referência é <strong>{result.reference}</strong>. A
equipa do portal irá analisar o pedido e poderá solicitar equipa do portal irá analisar o pedido e poderá solicitar
informação adicional. informação adicional.
</p><a href="/investidor/manifestacoes" className="mt-4 inline-block underline">Acompanhar manifestações</a> </p>
<a
href="/investidor/manifestacoes"
className="mt-4 inline-block underline"
>
Acompanhar manifestações
</a>
</section> </section>
); );
} }
@@ -1053,16 +902,20 @@ function Field({
function Footer() { function Footer() {
return ( return (
<footer className="border-t border-slate-200 bg-slate-950 py-10 text-slate-400"> <footer
<div className="mx-auto max-w-6xl px-5 text-sm"> aria-label="Portal do Investidor"
<p className="font-bold text-white">INVESTE Moçambique</p> className="border-t border-slate-200 bg-white"
<p className="mt-2 max-w-md"> >
Portal do Investidor — conheça as oportunidades de <div className="mx-auto flex max-w-6xl justify-start px-5 py-2">
investimento em Moçambique e manifeste o seu interesse.{' '} <a
<a href="/acesso-gestao" className="underline"> href="/acesso-gestao"
Acesso à gestão aria-label="Acesso à gestão"
title="Acesso à gestão"
className="inline-flex min-h-11 items-center justify-center gap-2 rounded-lg px-3 text-sm font-medium text-[#ed1c24] transition-colors hover:bg-red-50 focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-[#ed1c24]"
>
<LogIn className="size-5" aria-hidden="true" />
<span>Acesso à gestão</span>
</a> </a>
</p>
</div> </div>
</footer> </footer>
); );
@@ -1120,11 +973,7 @@ export default function PortalInvestidorApp({
function handleHeroSearch(event: FormEvent<HTMLFormElement>) { function handleHeroSearch(event: FormEvent<HTMLFormElement>) {
event.preventDefault(); event.preventDefault();
router.get('/oportunidades', { q: heroQuery }); router.get('/oportunidades', { q: heroQuery.trim() });
}
function handleSelectSector(slug: string) {
router.get('/sectores/' + encodeURIComponent(slug));
} }
function handleView(opportunity: Opportunity) { function handleView(opportunity: Opportunity) {
@@ -1140,121 +989,52 @@ export default function PortalInvestidorApp({
return ( return (
<SectorContext.Provider value={sectors}> <SectorContext.Provider value={sectors}>
<div className="min-h-screen bg-slate-50 font-sans text-slate-900"> <div className="min-h-screen bg-slate-50 font-sans text-slate-900">
{view !== 'home' && <TopBar onNavigate={navigate} requestCount={requestCount} />} {view !== 'home' && (
<TopBar onNavigate={navigate} requestCount={requestCount} />
)}
<PortalMenu /> <PortalMenu />
<main> <main>
{view === 'home' && ( {view === 'home' && (
<> <>
<Hero <PortalHero
query={heroQuery} query={heroQuery}
setQuery={setHeroQuery} setQuery={setHeroQuery}
onSearch={handleHeroSearch} onSearch={handleHeroSearch}
stats={home.data?.data.stats} stats={home.data?.data.stats}
onNavigate={navigate} onNavigate={navigate}
/> />
<section className="mx-auto max-w-6xl space-y-5 px-5 py-10"> <InvestmentContextCards />
<h2 className="text-2xl font-bold">
Encontre o contexto do seu investimento
</h2>
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-4">
{[
[
'/clusters',
'Clusters',
'Cadeias de valor e lacunas produtivas.',
],
[
'/corredores',
'Corredores',
'Territórios, logística e conexões.',
],
[
'/projectos-ancora',
'Projectos âncora',
'Projectos estruturantes e relações.',
],
[
'/educacao',
'Educação',
'Investimentos em competências e formação.',
],
[
'/documentos',
'Documentos e Formulários',
'Legislação, procedimentos, formulários e materiais de apoio.',
],
].map(([href, title, text]) => (
<a
key={href}
href={href}
className="rounded-xl border bg-white p-5"
>
<h3 className="text-lg font-bold">
{title}
</h3>
<p>{text}</p>
</a>
))}
</div>
</section>
<QueryStatus <QueryStatus
loading={home.loading} loading={home.loading}
error={home.error} error={home.error}
retry={home.retry} retry={home.retry}
/> />
{home.data && ( {home.data && (
<SectorGrid <HomepageSectors
onSelectSector={handleSelectSector} sectors={sectors.map((sector) => ({
...sector,
description: sector.shortDescription,
}))}
/> />
)} )}
<section className="mx-auto max-w-6xl space-y-5 px-5 py-12"> <InvestmentSteps />
<h2 className="text-2xl font-black">
Como Investir
</h2>
<div className="grid gap-5 md:grid-cols-3">
{[
[
'1. Explorar',
'Identifique o sector, território e oportunidade.',
'/oportunidades',
],
[
'2. Preparar',
'Conheça o percurso e organize os documentos.',
'/como-investir',
],
[
'3. Acompanhar',
'Envie o pedido e acompanhe o protocolo.',
'/balcao-virtual',
],
].map(([title, text, href]) => (
<a
key={href}
href={href}
className="rounded-xl border bg-white p-6"
>
<h3 className="font-bold">
{title}
</h3>
<p>{text}</p>
</a>
))}
</div>
</section>
<section className="border-t border-slate-200 bg-white py-16"> <section className={HOME_SECTION_BAND}>
<div className="mx-auto max-w-6xl px-5"> <div className="mx-auto max-w-6xl px-5">
<div className="mb-8 flex items-end justify-between"> <div className="mb-5 flex items-end justify-between">
<h2 className="text-2xl font-black text-slate-900"> <h2 className={HOME_SECTION_HEADING}>
Oportunidades em destaque Oportunidades em destaque
</h2> </h2>
<button <button
onClick={goToOpportunities} onClick={goToOpportunities}
className="text-sm font-bold text-emerald-700 hover:underline" className="inline-flex items-center gap-1 text-sm font-bold text-[#ed1c24] hover:underline"
> >
Ver todas → <span>Ver todas</span>
<ArrowRight
className="h-4 w-4"
aria-hidden="true"
/>
</button> </button>
</div> </div>
{home.data && featured.length === 0 && ( {home.data && featured.length === 0 && (
@@ -1275,77 +1055,154 @@ export default function PortalInvestidorApp({
</div> </div>
</div> </div>
</section> </section>
<section className="mx-auto grid max-w-6xl gap-6 px-5 py-12 md:grid-cols-2"> <section
<div className="space-y-4 rounded-xl border bg-white p-6"> className={`${HOME_SECTION} grid gap-4 sm:gap-5 md:grid-cols-2`}
<h2 className="text-2xl font-black"> >
<article className="group flex h-full flex-col overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-sm transition-shadow hover:shadow-md">
<div className="flex items-start gap-4 p-6">
<div className="flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-[#ed1c24]/10 text-[#ed1c24]">
<FileText
className="h-5 w-5"
aria-hidden="true"
/>
</div>
<div className="space-y-2">
<h2 className="text-xl font-bold text-slate-900 sm:text-2xl">
Documentos essenciais Documentos essenciais
</h2> </h2>
{essentialResources.length > 0 && ( <p className="text-sm leading-relaxed text-slate-600 sm:text-base">
<ul className="space-y-2"> Consulte legislação, referências
{essentialResources.map( e formulários publicados para
(resource) => ( preparar o seu investimento.
<li key={resource.id}>
<a
className="underline"
href={`/documentos/${resource.id}/download`}
>
{resource.title}
</a>
</li>
),
)}
</ul>
)}
<p>
Consulte legislação, referências e
formulários publicados para preparar o
seu investimento.
</p> </p>
</div>
</div>
<div className="mt-auto flex flex-col gap-2 px-6 pb-6">
<a <a
className="font-semibold text-emerald-800 underline" className="inline-flex items-center justify-between gap-2 rounded-xl border border-slate-200 px-4 py-3 text-sm font-semibold text-slate-900 transition-colors hover:border-[#ed1c24] hover:bg-red-50/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ed1c24]"
href="/documentos" href="/documentos"
> >
Abrir biblioteca documental Abrir biblioteca documental
<ArrowRight
className="h-4 w-4"
aria-hidden="true"
/>
</a> </a>
<p>
<a <a
className="underline" className="inline-flex items-center justify-between gap-2 rounded-xl border border-slate-200 px-4 py-3 text-sm font-semibold text-slate-900 transition-colors hover:border-[#ed1c24] hover:bg-red-50/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ed1c24]"
href="/legislacao" href="/legislacao"
> >
<span className="flex items-center gap-2">
<Scale
className="h-4 w-4 text-[#ed1c24]"
aria-hidden="true"
/>
Legislação e Incentivos Legislação e Incentivos
</span>
<ArrowRight
className="h-4 w-4"
aria-hidden="true"
/>
</a> </a>
{essentialResources.length > 0 && (
<div className="mt-2 rounded-xl bg-slate-50/80 p-4">
<p className="mb-2 text-xs font-semibold tracking-wide text-slate-500 uppercase">
Destaques
</p> </p>
<ul className="space-y-1.5">
{essentialResources
.slice(0, 3)
.map((resource) => (
<li
key={
resource.id
}
>
<a
className="inline-flex items-center gap-2 text-sm text-slate-700 underline-offset-4 hover:text-slate-900 hover:underline"
href={`/documentos/${resource.id}/download`}
>
<FileText
className="h-4 w-4 text-slate-400"
aria-hidden="true"
/>
{
resource.title
}
</a>
</li>
))}
</ul>
</div> </div>
<div className="space-y-4 rounded-xl bg-emerald-900 p-6 text-white"> )}
<h2 className="text-2xl font-black"> </div>
</article>
<article className="group flex h-full flex-col overflow-hidden rounded-2xl border border-slate-200 bg-white shadow-sm transition-shadow hover:shadow-md">
<div className="flex items-start gap-4 p-6">
<div className="flex h-11 w-11 shrink-0 items-center justify-center rounded-xl bg-[#ed1c24]/10 text-[#ed1c24]">
<Handshake
className="h-5 w-5"
aria-hidden="true"
/>
</div>
<div className="space-y-2">
<h2 className="text-xl font-bold text-slate-900 sm:text-2xl">
Apoio ao Investidor Apoio ao Investidor
</h2> </h2>
<p> <p className="text-sm leading-relaxed text-slate-600 sm:text-base">
Peça orientação à equipa, proponha uma Peça orientação à equipa,
parceria ou acompanhe o seu pedido. proponha uma parceria ou
acompanhe o seu pedido.
</p> </p>
</div>
</div>
<div className="mt-auto flex flex-col gap-2 px-6 pb-6">
<a <a
className="font-semibold underline" className="inline-flex items-center justify-between gap-2 rounded-xl bg-[#ed1c24] px-4 py-3 text-sm font-semibold text-white transition-colors hover:bg-[#c9141b] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ed1c24]"
href="/apoio" href="/apoio"
> >
Contactar Apoio ao Investidor Contactar Apoio ao Investidor
<ArrowRight
className="h-4 w-4"
aria-hidden="true"
/>
</a> </a>
<p> <div className="grid grid-cols-1 gap-2 sm:grid-cols-2">
<a <a
className="underline" className="inline-flex items-center justify-between gap-2 rounded-xl border border-slate-200 px-4 py-3 text-sm font-semibold text-slate-900 transition-colors hover:border-[#ed1c24] hover:bg-red-50/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ed1c24]"
href="/parcerias" href="/parcerias"
> >
<span className="flex items-center gap-2">
<Handshake
className="h-4 w-4 text-[#ed1c24]"
aria-hidden="true"
/>
Bolsa de Parcerias Bolsa de Parcerias
</a>{' '} </span>
·{' '} <ArrowRight
className="h-4 w-4"
aria-hidden="true"
/>
</a>
<a <a
className="underline" className="inline-flex items-center justify-between gap-2 rounded-xl border border-slate-200 px-4 py-3 text-sm font-semibold text-slate-900 transition-colors hover:border-[#ed1c24] hover:bg-red-50/40 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[#ed1c24]"
href="/simulador-fiscal" href="/simulador-fiscal"
> >
<span className="flex items-center gap-2">
<Calculator
className="h-4 w-4 text-[#ed1c24]"
aria-hidden="true"
/>
Simulador Fiscal Simulador Fiscal
</span>
<ArrowRight
className="h-4 w-4"
aria-hidden="true"
/>
</a> </a>
</p>
</div> </div>
</div>
</article>
</section> </section>
</> </>
)} )}
+25 -2
View File
@@ -1,4 +1,5 @@
import EducationalGuides from '@/components/educational-guides'; import EducationalGuides from '@/components/educational-guides';
import { searchTerritoryHref } from '@/lib/search-territory';
import type { EducationalArticle } from '@/components/educational-article-card'; import type { EducationalArticle } from '@/components/educational-article-card';
import OpportunitySearchFilters from '@/components/opportunity-search-filters'; import OpportunitySearchFilters from '@/components/opportunity-search-filters';
import SearchState from '@/components/search-state'; import SearchState from '@/components/search-state';
@@ -46,7 +47,8 @@ export default function Catalogue({
corridor_id: string | null; corridor_id: string | null;
}[]; }[];
}) { }) {
const { auth } = usePage<{ auth: { user: unknown } }>().props; const page = usePage<{ auth: { user: unknown } }>();
const { auth } = page.props;
const form = useForm({ const form = useForm({
association_type: String(filters.association_type ?? ''), association_type: String(filters.association_type ?? ''),
association_target: String(filters.association_target ?? ''), association_target: String(filters.association_target ?? ''),
@@ -100,6 +102,16 @@ export default function Catalogue({
), ),
}); });
const view = String(filters.view ?? 'grid'); const view = String(filters.view ?? 'grid');
const selectedStructures = [
...(references.zones ?? []).filter((zone) =>
['park_id', 'zee_id', 'zfi_id'].some((key) => filters[key] === zone.id),
).map((zone) => ({ ...zone, url: `/zonas/${zone.id}` })),
...(['clusters', 'corridors', 'projects'] as const).flatMap((group) =>
references[group].filter((record) => filters[
{ clusters: 'cluster_id', corridors: 'corridor_id', projects: 'project_id' }[group]
] === record.id),
),
];
const [territoryPath, setTerritoryPath] = useState(territorySelection); const [territoryPath, setTerritoryPath] = useState(territorySelection);
const [saved, setSaved] = useState(favourites); const [saved, setSaved] = useState(favourites);
const [selected, setSelected] = useState<number[]>([]); const [selected, setSelected] = useState<number[]>([]);
@@ -360,6 +372,17 @@ export default function Catalogue({
total={results.total} total={results.total}
retry={() => runSearch()} retry={() => runSearch()}
/> />
{!searchLoading && !searchError && results.total === 0 && selectedStructures.length > 0 && (
<section className={card} aria-label="Estrutura seleccionada">
<p className="font-semibold">Sem oportunidades publicadas associadas com estes filtros.</p>
<p>A estrutura continua disponível para consulta. A sua selecção não confirma benefícios nem disponibilidade para investimento.</p>
{selectedStructures.map((record) => (
record.url ? <Link key={record.id} className="block underline" href={searchTerritoryHref(record.url, page.url)}>
Consultar ficha: {record.name}
</Link> : <p key={record.id}>{record.name} — sem ficha pública detalhada disponível.</p>
))}
</section>
)}
<div className="flex flex-wrap items-center gap-4"> <div className="flex flex-wrap items-center gap-4">
{!searchLoading && {!searchLoading &&
!searchError && !searchError &&
@@ -696,7 +719,7 @@ export default function Catalogue({
<div className="grid gap-4 md:grid-cols-3"> <div className="grid gap-4 md:grid-cols-3">
{territorial.map((d) => ( {territorial.map((d) => (
<Link <Link
href={`/carteira/${d.id}`} href={searchTerritoryHref(`/carteira/${d.id}`, page.url)}
key={d.id} key={d.id}
className={card} className={card}
> >
+3 -2
View File
@@ -1,4 +1,5 @@
import EducationalGuides from '@/components/educational-guides'; import EducationalGuides from '@/components/educational-guides';
import { searchTerritoryHref } from '@/lib/search-territory';
import type { EducationalArticle } from '@/components/educational-article-card'; import type { EducationalArticle } from '@/components/educational-article-card';
import { ClassificationSummary } from '@/components/opportunity-classification'; import { ClassificationSummary } from '@/components/opportunity-classification';
import { Link, router, usePage } from '@inertiajs/react'; import { Link, router, usePage } from '@inertiajs/react';
@@ -45,7 +46,7 @@ export default function Detail({
<p> <p>
<Link <Link
className="underline" className="underline"
href={`/carteira/${dossierOrigin.id}`} href={searchTerritoryHref(`/carteira/${dossierOrigin.id}`, page.url)}
> >
Voltar ao dossier: {dossierOrigin.title} Voltar ao dossier: {dossierOrigin.title}
</Link> </Link>
@@ -253,7 +254,7 @@ export default function Detail({
<span key={dossier.id}> <span key={dossier.id}>
<Link <Link
className="underline" className="underline"
href={`/carteira/${dossier.id}`} href={searchTerritoryHref(`/carteira/${dossier.id}`, page.url)}
> >
Consultar dossier: {dossier.title} Consultar dossier: {dossier.title}
</Link> </Link>
+1
View File
@@ -19,6 +19,7 @@ export type Option = {
export type Entity = { export type Entity = {
id: string; id: string;
name: string; name: string;
url?: string | null;
dossiers?: { id: string; title: string; source: string }[]; dossiers?: { id: string; title: string; source: string }[];
geography?: StructureGeography | null; geography?: StructureGeography | null;
}; };
+3 -2
View File
@@ -5,6 +5,7 @@ import ParkDetailsEditor, {
} from '@/components/investment-zone-operational-details'; } from '@/components/investment-zone-operational-details';
import { Link, router, useForm, usePage } from '@inertiajs/react'; import { Link, router, useForm, usePage } from '@inertiajs/react';
import { catalogueReturnHref } from '@/lib/catalogue-context'; import { catalogueReturnHref } from '@/lib/catalogue-context';
import { searchTerritoryHref } from '@/lib/search-territory';
import InvestmentTerritory from '@/components/investment-territory'; import InvestmentTerritory from '@/components/investment-territory';
import InvestmentMapPanel from '@/components/investment-map-panel'; import InvestmentMapPanel from '@/components/investment-map-panel';
import { import {
@@ -1772,7 +1773,7 @@ function Editor({
<p key={o.id}> <p key={o.id}>
<Link <Link
className="underline" className="underline"
href={`/oportunidades/${o.slug}?zone_id=${z.id}`} href={searchTerritoryHref(`/oportunidades/${o.slug}?zone_id=${z.id}`, pageUrl)}
> >
{o.title} {o.title}
</Link> </Link>
@@ -1829,7 +1830,7 @@ function Editor({
<p key={r.id}> <p key={r.id}>
<Link <Link
className="underline" className="underline"
href={`/carteira/${r.id}`} href={searchTerritoryHref(`/carteira/${r.id}`, pageUrl)}
> >
{r.title} {r.title}
</Link> </Link>
+10 -5
View File
@@ -1,7 +1,8 @@
import InvestmentZoneInstallation, { import InvestmentZoneInstallation, {
type ParkInstallationPlan, type ParkInstallationPlan,
} from '@/components/investment-zone-installation'; } from '@/components/investment-zone-installation';
import { Link, router } from '@inertiajs/react'; import { Link, router, usePage } from '@inertiajs/react';
import { searchTerritoryHref } from '@/lib/search-territory';
import { useState } from 'react'; import { useState } from 'react';
import { catalogueDetailHref } from '@/lib/catalogue-context'; import { catalogueDetailHref } from '@/lib/catalogue-context';
import { import {
@@ -90,9 +91,13 @@ export default function Zones({
zoneExtensionsAvailable?: boolean; zoneExtensionsAvailable?: boolean;
territorySelection?: TerritoryOption[]; territorySelection?: TerritoryOption[];
}) { }) {
const pageUrl = usePage().url;
const [error, setError] = useState(''); const [error, setError] = useState('');
const [busy, setBusy] = useState(false); const [busy, setBusy] = useState(false);
const exportParams = new URLSearchParams(); const exportParams = new URLSearchParams();
['province_id', 'district_id', 'admin_post_id', 'locality_id'].forEach((field, index) => {
if (territorySelection[index]) exportParams.set(field, territorySelection[index].id);
});
for (const key of [ for (const key of [
'q', 'q',
'category', 'category',
@@ -148,9 +153,9 @@ export default function Zones({
> >
<Link href="/clusters">Por Cluster</Link> <Link href="/clusters">Por Cluster</Link>
<Link href="/corredores">Por Corredor</Link> <Link href="/corredores">Por Corredor</Link>
<Link href="/zonas?category=zee">Por ZEE</Link> <Link href={searchTerritoryHref('/zonas?category=zee', pageUrl)}>Por ZEE</Link>
<Link href="/zonas?category=zfi">Por ZFI</Link> <Link href={searchTerritoryHref('/zonas?category=zfi', pageUrl)}>Por ZFI</Link>
<Link href="/zonas?category=industrial_park"> <Link href={searchTerritoryHref('/zonas?category=industrial_park', pageUrl)}>
Parques industriais Parques industriais
</Link> </Link>
</nav> </nav>
@@ -343,7 +348,7 @@ export default function Zones({
{!management && ( {!management && (
<Link <Link
className="ml-4 underline" className="ml-4 underline"
href={`/oportunidades?${new URLSearchParams({ [zone.category === 'zee' ? 'zee_id' : zone.category === 'zfi' ? 'zfi_id' : 'park_id']: zone.id })}`} href={searchTerritoryHref(`/oportunidades?${new URLSearchParams({ [zone.category === 'zee' ? 'zee_id' : zone.category === 'zfi' ? 'zfi_id' : 'park_id']: zone.id })}`, pageUrl)}
> >
Ver oportunidades associadas Ver oportunidades associadas
</Link> </Link>
+178 -24
View File
@@ -1,3 +1,7 @@
import {
PreparationEditor,
PreparationImpact,
} from '@/components/private-investment-preparation';
import { InvestmentContextAssessment } from '@/components/investment-context-assessment'; import { InvestmentContextAssessment } from '@/components/investment-context-assessment';
import ContextDocuments from '@/components/context-documents'; import ContextDocuments from '@/components/context-documents';
import { Link } from '@inertiajs/react'; import { Link } from '@inertiajs/react';
@@ -36,6 +40,7 @@ export default function ContextEditor({
}) { }) {
const navigation = useNavigationContext(); const navigation = useNavigationContext();
const [view, setView] = useState(initial); const [view, setView] = useState(initial);
const [preparation, setPreparation] = useState(initial.private_investment);
const [options, setOptions] = useState(initialOptions); const [options, setOptions] = useState(initialOptions);
const [query, setQuery] = useState(''); const [query, setQuery] = useState('');
const [changes, setChanges] = useState<Partial<Record<Slot, string>>>(() => const [changes, setChanges] = useState<Partial<Record<Slot, string>>>(() =>
@@ -49,6 +54,9 @@ export default function ContextEditor({
const [declarations, setDeclarations] = useState<Record<string, string>>( const [declarations, setDeclarations] = useState<Record<string, string>>(
{}, {},
); );
const [documentLinks, setDocumentLinks] = useState<
Record<string, string | null>
>({});
const [replace, setReplace] = useState<string[]>([]); const [replace, setReplace] = useState<string[]>([]);
const [plan, setPlan] = useState<ContextPlan | null>(null); const [plan, setPlan] = useState<ContextPlan | null>(null);
const [busy, setBusy] = useState(false); const [busy, setBusy] = useState(false);
@@ -59,6 +67,32 @@ export default function ContextEditor({
string, string,
unknown unknown
> | null>(null); > | null>(null);
const displayValue = (
field: string,
value: string | null | undefined,
): string => {
if (value === null || value === undefined || value === '')
return 'não informado';
const question = view.private_investment?.questions.find(
(q) => q.key === field,
);
return (
question?.options?.[value] ??
(
{
being_formed: 'Em constituição',
existing: 'Existente',
national: 'Nacional',
foreign: 'Estrangeiro',
mixed: 'Misto',
yes: 'Sim',
no: 'Não',
unknown: 'Por determinar',
} as Record<string, string>
)[value] ??
value
);
};
const selected = (slot: Slot) => const selected = (slot: Slot) =>
Object.hasOwn(changes, slot) Object.hasOwn(changes, slot)
? (changes[slot] ?? '') ? (changes[slot] ?? '')
@@ -77,6 +111,7 @@ export default function ContextEditor({
selection: changes, selection: changes,
declarations, declarations,
replace_fields: replace, replace_fields: replace,
document_links: documentLinks,
}; };
try { try {
const result = await contextApi<ContextPlan>( const result = await contextApi<ContextPlan>(
@@ -85,6 +120,9 @@ export default function ContextEditor({
); );
setRequestBody(body); setRequestBody(body);
setPlan(result); setPlan(result);
setPreparation(
result.private_investment?.after ?? view.private_investment,
);
} catch (e) { } catch (e) {
setError( setError(
e instanceof Error ? e.message : 'Não foi possível comparar.', e instanceof Error ? e.message : 'Não foi possível comparar.',
@@ -111,9 +149,11 @@ export default function ContextEditor({
`/investimentos/${view.case.id}/contexto`, `/investimentos/${view.case.id}/contexto`,
); );
setView(next); setView(next);
setPreparation(next.private_investment);
navigation.refresh(); navigation.refresh();
setChanges({}); setChanges({});
setDeclarations({}); setDeclarations({});
setDocumentLinks({});
setReplace([]); setReplace([]);
setPlan(null); setPlan(null);
setOperation(createOperationKey()); setOperation(createOperationKey());
@@ -132,7 +172,10 @@ export default function ContextEditor({
} }
return ( return (
<Frame title="Contexto do investimento"> <Frame title="Contexto do investimento">
<InvestmentContextAssessment contextId={view.case.id} raw={view.prefill.simulator?.context_applicability_snapshot} /> <InvestmentContextAssessment
contextId={view.case.id}
raw={view.prefill.simulator?.context_applicability_snapshot}
/>
<ContextDocuments source={view.context.selection.opportunity} /> <ContextDocuments source={view.context.selection.opportunity} />
<div className="space-y-5 [overflow-wrap:anywhere]"> <div className="space-y-5 [overflow-wrap:anywhere]">
<Link <Link
@@ -337,17 +380,107 @@ export default function ContextEditor({
Estes campos pertencem ao processo. Alterá-los não muda Estes campos pertencem ao processo. Alterá-los não muda
o cadastro da oportunidade nem o perfil da organização. o cadastro da oportunidade nem o perfil da organização.
</p> </p>
<p>Origem do investidor, residência fiscal e constituição da entidade são declarações distintas. A localização não confirma benefícios. A prévia identifica o impacto antes de guardar.</p> <p>
Origem do investidor, residência fiscal e constituição
da entidade são declarações distintas. A localização não
confirma benefícios. A prévia identifica o impacto antes
de guardar.
</p>
{[ {[
['currency', 'Moeda do projecto', null], ['currency', 'Moeda do projecto', null],
['expected_start_date','Data prevista de início',null], [
['investor_origin','Origem do investidor',[['national','Nacional'],['foreign','Estrangeiro'],['mixed','Misto']]], 'expected_start_date',
['person_type','Tipo de entidade',[['singular','Pessoa singular'],['collective','Pessoa colectiva'],['consortium','Consórcio']]], 'Data prevista de início',
['entity_stage','Situação da entidade',[['existing','Existente'],['being_formed','Em constituição']]], null,
['tax_residency_country','País de residência fiscal declarado (ISO de duas letras)',null], ],
].map(([key,label,choices]) => <label className="grid gap-1" key={String(key)}>{String(label)}{Array.isArray(choices) [
? <select className={input} value={declarations[String(key)] ?? view.context.fields[String(key)] ?? ''} onChange={e=>{setDeclarations({...declarations,[String(key)]:e.target.value});setPlan(null);}}><option value="">Por indicar</option>{choices.map(([value,text])=><option key={value} value={value}>{text}</option>)}</select> 'investor_origin',
: <input className={input} type={key==='expected_start_date'?'date':'text'} maxLength={key==='currency'?3:key==='tax_residency_country'?2:10} value={declarations[String(key)] ?? view.context.fields[String(key)] ?? ''} onChange={e=>{setDeclarations({...declarations,[String(key)]:e.target.value});setPlan(null);}} />}</label>)} 'Origem do investidor',
[
['national', 'Nacional'],
['foreign', 'Estrangeiro'],
['mixed', 'Misto'],
],
],
[
'person_type',
'Tipo de entidade',
[
['singular', 'Pessoa singular'],
['collective', 'Pessoa colectiva'],
['consortium', 'Consórcio'],
],
],
[
'entity_stage',
'Situação da entidade',
[
['existing', 'Existente'],
['being_formed', 'Em constituição'],
],
],
[
'tax_residency_country',
'País de residência fiscal declarado (ISO de duas letras)',
null,
],
].map(([key, label, choices]) => (
<label className="grid gap-1" key={String(key)}>
{String(label)}
{Array.isArray(choices) ? (
<select
className={input}
value={
declarations[String(key)] ??
view.context.fields[String(key)] ??
''
}
onChange={(e) => {
setDeclarations({
...declarations,
[String(key)]: e.target.value,
});
setPlan(null);
}}
>
<option value="">Por indicar</option>
{choices.map(([value, text]) => (
<option key={value} value={value}>
{text}
</option>
))}
</select>
) : (
<input
className={input}
type={
key === 'expected_start_date'
? 'date'
: 'text'
}
maxLength={
key === 'currency'
? 3
: key === 'tax_residency_country'
? 2
: 10
}
value={
declarations[String(key)] ??
view.context.fields[String(key)] ??
''
}
onChange={(e) => {
setDeclarations({
...declarations,
[String(key)]: e.target.value,
});
setPlan(null);
}}
/>
)}
</label>
))}
{['project_title', 'project_summary'].map((k) => ( {['project_title', 'project_summary'].map((k) => (
<label className="grid gap-1" key={k}> <label className="grid gap-1" key={k}>
{contextFieldNames[k]} {contextFieldNames[k]}
@@ -379,17 +512,6 @@ export default function ContextEditor({
declarações do utilizador. Autorize somente os declarações do utilizador. Autorize somente os
campos que pretende substituir pelo cadastro. campos que pretende substituir pelo cadastro.
</p> </p>
<p>Origem do investidor, residência fiscal e constituição da entidade são declarações distintas. A localização não confirma benefícios. A prévia identifica o impacto antes de guardar.</p>
{[
['currency','Moeda do projecto',null],
['expected_start_date','Data prevista de início',null],
['investor_origin','Origem do investidor',[['national','Nacional'],['foreign','Estrangeiro'],['mixed','Misto']]],
['person_type','Tipo de entidade',[['singular','Pessoa singular'],['collective','Pessoa colectiva'],['consortium','Consórcio']]],
['entity_stage','Situação da entidade',[['existing','Existente'],['being_formed','Em constituição']]],
['tax_residency_country','País de residência fiscal declarado (ISO de duas letras)',null],
].map(([key,label,choices]) => <label className="grid gap-1" key={String(key)}>{String(label)}{Array.isArray(choices)
? <select className={input} value={declarations[String(key)] ?? view.context.fields[String(key)] ?? ''} onChange={e=>{setDeclarations({...declarations,[String(key)]:e.target.value});setPlan(null);}}><option value="">Por indicar</option>{choices.map(([value,text])=><option key={value} value={value}>{text}</option>)}</select>
: <input className={input} type={key==='expected_start_date'?'date':'text'} maxLength={key==='currency'?3:key==='tax_residency_country'?2:10} value={declarations[String(key)] ?? view.context.fields[String(key)] ?? ''} onChange={e=>{setDeclarations({...declarations,[String(key)]:e.target.value});setPlan(null);}} />}</label>)}
{['project_title', 'project_summary'].map((k) => ( {['project_title', 'project_summary'].map((k) => (
<label className="block" key={k}> <label className="block" key={k}>
<input <input
@@ -411,6 +533,30 @@ export default function ContextEditor({
</label> </label>
))} ))}
</details> </details>
{view.private_investment && (
<PreparationEditor
data={preparation ?? view.private_investment}
fields={view.context.fields}
changes={declarations}
documents={view.preparation_documents ?? []}
links={documentLinks}
disabled={busy || !view.can_write}
onChange={(key, value) => {
setDeclarations({
...declarations,
[key]: value,
});
setPlan(null);
}}
onLink={(key, value) => {
setDocumentLinks({
...documentLinks,
[key]: value,
});
setPlan(null);
}}
/>
)}
<button <button
className={button} className={button}
type="button" type="button"
@@ -467,10 +613,15 @@ export default function ContextEditor({
x.field x.field
] ?? x.field} ] ?? x.field}
:{' '} :{' '}
{x.before ?? {displayValue(
'não informado'}{' '} x.field,
x.before,
)}{' '}
→{' '} →{' '}
{x.after ?? 'não informado'} {displayValue(
x.field,
x.after,
)}
</p> </p>
))} ))}
{Object.values(plan.selection).map( {Object.values(plan.selection).map(
@@ -530,6 +681,9 @@ export default function ContextEditor({
</tbody> </tbody>
</table> </table>
</div> </div>
{plan.private_investment && (
<PreparationImpact {...plan.private_investment} />
)}
<p>{plan.notice}</p> <p>{plan.notice}</p>
<div className="flex flex-wrap gap-3"> <div className="flex flex-wrap gap-3">
<button <button
+31
View File
@@ -1,3 +1,7 @@
import {
PreparationSummary,
type Preparation,
} from '@/components/private-investment-preparation';
import ContextDocuments from '@/components/context-documents'; import ContextDocuments from '@/components/context-documents';
import type { DossierContext } from '@/lib/investor-context'; import type { DossierContext } from '@/lib/investor-context';
import FintechInvestment, { import FintechInvestment, {
@@ -27,6 +31,7 @@ type Step = {
source_paragraph: number; source_paragraph: number;
}; };
type Path = { type Path = {
private_investment?: Preparation | null;
fintech: FintechView | null; fintech: FintechView | null;
investment_context: DossierContext | null; investment_context: DossierContext | null;
zone_contexts?: { zone_contexts?: {
@@ -180,6 +185,28 @@ function Stage({ step, path }: { step: Step; path: Path }) {
independente. independente.
</label> </label>
)} )}
{path.private_investment?.enabled && (
<div className="space-y-2">
{path.private_investment.requirements
.filter((r) => r.stage === step.code)
.map((r) => (
<p className="text-sm" key={r.key}>
<strong>{r.label}:</strong>{' '}
{r.state === 'not_applicable'
? 'não exigido neste contexto; histórico preservado'
: r.state === 'associated'
? 'documento associado; conteúdo por conferir'
: r.state === 'missing'
? 'documento por associar'
: 'aplicabilidade por determinar'}
. {r.reason}{' '}
<a className="underline" href={r.source.url}>
{r.source.reference}
</a>
</p>
))}
</div>
)}
{step.reason && ( {step.reason && (
<p className="text-sm">Fundamento: {step.reason}</p> <p className="text-sm">Fundamento: {step.reason}</p>
)} )}
@@ -415,6 +442,10 @@ export default function InvestmentPath(path: Path) {
<ContextDocuments <ContextDocuments
source={path.investment_context?.selection.opportunity} source={path.investment_context?.selection.opportunity}
/> />
<PreparationSummary
data={path.private_investment}
caseId={path.case.id}
/>
{path.investment_context && ( {path.investment_context && (
<section className="space-y-2 rounded border border-emerald-300 bg-emerald-50 p-4"> <section className="space-y-2 rounded border border-emerald-300 bg-emerald-50 p-4">
<h2 className="font-semibold"> <h2 className="font-semibold">
@@ -0,0 +1,26 @@
import { InvestmentContextGrid } from '@/components/investment-context-cards';
import { PORTAL_MORE_LINK } from '@/lib/portal-presentation';
import { Head } from '@inertiajs/react';
export default function InvestmentContexts() {
return (
<div className="min-h-screen bg-slate-50 text-slate-900">
<Head title="Contextos de investimento" />
<main className="mx-auto max-w-6xl min-w-0 space-y-6 px-5 py-10">
<h1 className="text-3xl font-bold text-[#ed1c24]">
Encontre o contexto do seu investimento
</h1>
<p className="text-slate-600">
Explore os contextos e recursos de apoio ao seu
investimento.
</p>
<InvestmentContextGrid />
<div className="flex justify-center">
<a href="/" className={PORTAL_MORE_LINK}>
Voltar ao início
</a>
</div>
</main>
</div>
);
}
+35 -29
View File
@@ -1,3 +1,5 @@
import { PublicSectorCards } from '@/components/public-sector-cards';
import { PORTAL_MORE_LINK } from '@/lib/portal-presentation';
import { import {
PublicDocumentContent, PublicDocumentContent,
type PublicDocument, type PublicDocument,
@@ -18,7 +20,7 @@ const input =
const button = const button =
'inline-block rounded-lg bg-emerald-800 px-5 py-3 font-semibold text-white disabled:opacity-50'; 'inline-block rounded-lg bg-emerald-800 px-5 py-3 font-semibold text-white disabled:opacity-50';
const titles: Record<string, string> = { const titles: Record<string, string> = {
sectors: 'Sectores Prioritários', sectors: 'Sectores de investimento',
sector: 'Sector prioritário', sector: 'Sector prioritário',
procedures: 'Como Investir em Moçambique', procedures: 'Como Investir em Moçambique',
legislation: 'Legislação e Incentivos', legislation: 'Legislação e Incentivos',
@@ -73,8 +75,9 @@ type Props = {
sectors?: { sectors?: {
name: string; name: string;
slug: string; slug: string;
short_description: string; short_description: string | null;
opportunities_count: number; opportunities_count: number;
url?: string;
specializations?: { id: number; name: string; url: string }[]; specializations?: { id: number; name: string; url: string }[];
}[]; }[];
sector?: { sector?: {
@@ -489,7 +492,15 @@ export default function Services(p: Props) {
<Head title={title} /> <Head title={title} />
<PortalMenu /> <PortalMenu />
<main className="mx-auto max-w-6xl min-w-0 space-y-8 overflow-x-clip px-5 py-10"> <main className="mx-auto max-w-6xl min-w-0 space-y-8 overflow-x-clip px-5 py-10">
<h1 className="text-3xl font-bold">{title}</h1> <h1
className={
p.section === 'sectors'
? 'text-3xl font-bold text-[#ed1c24]'
: 'text-3xl font-bold'
}
>
{title}
</h1>
{flash?.success && ( {flash?.success && (
<p <p
role="status" role="status"
@@ -499,38 +510,33 @@ export default function Services(p: Props) {
</p> </p>
)} )}
{p.section === 'sectors' && ( {p.section === 'sectors' && (
<div className="grid gap-5 md:grid-cols-3"> <section
{p.sectors?.map((s) => ( aria-label="Todos os sectores de investimento"
<article className="space-y-6"
className="rounded-xl border bg-white p-6"
key={s.slug}
> >
<h2 className="text-xl font-bold"> <p className="text-slate-600">
<Link href={`/sectores/${s.slug}`}> Explore o potencial estratégico de cada sector em
{s.name} Moçambique.
</Link>
</h2>
<p className="my-3">{s.short_description}</p>
{s.specializations?.map((child) => (
<p key={child.id}>
<Link
className="font-semibold underline"
href={child.url}
>
{child.name}
</Link>
</p> </p>
))} <PublicSectorCards
<p> sectors={(p.sectors ?? []).map((sector) => ({
{s.opportunities_count} oportunidades slug: sector.slug,
publicadas name: sector.name,
</p> description: sector.short_description,
</article> opportunitiesCount: sector.opportunities_count,
))} specializations: sector.specializations,
url: sector.url,
}))}
/>
{!p.sectors?.length && ( {!p.sectors?.length && (
<p>Não existem sectores publicados.</p> <p>Não existem sectores publicados.</p>
)} )}
<div className="flex justify-center">
<a href="/" className={PORTAL_MORE_LINK}>
Voltar ao início
</a>
</div> </div>
</section>
)} )}
{p.section === 'sector' && p.sector && ( {p.section === 'sector' && p.sector && (
<> <>
+6 -4
View File
@@ -1,4 +1,5 @@
import { Link, useForm } from '@inertiajs/react'; import { Link, useForm, usePage } from '@inertiajs/react';
import { searchTerritoryHref } from '@/lib/search-territory';
import { catalogueDetailHref } from '@/lib/catalogue-context'; import { catalogueDetailHref } from '@/lib/catalogue-context';
import { Management } from '../management/shared'; import { Management } from '../management/shared';
import type { Paginated } from '../management/shared'; import type { Paginated } from '../management/shared';
@@ -35,6 +36,7 @@ export default function Index({
locality_id: filters.locality_id ?? '', locality_id: filters.locality_id ?? '',
}); });
const base = management ? '/management/portfolio' : '/carteira'; const base = management ? '/management/portfolio' : '/carteira';
const { url } = usePage();
const Frame = management ? Management : Layout; const Frame = management ? Management : Layout;
return ( return (
<Frame title="Corredores, clusters e projectos âncora"> <Frame title="Corredores, clusters e projectos âncora">
@@ -151,7 +153,7 @@ export default function Index({
(r.corridor_id || r.cluster_id || r.project_id) && ( (r.corridor_id || r.cluster_id || r.project_id) && (
<Link <Link
className="ml-4 underline" className="ml-4 underline"
href={`/oportunidades?${new URLSearchParams(r.corridor_id ? { corridor_id: r.corridor_id } : r.cluster_id ? { cluster_id: r.cluster_id } : { project_id: r.project_id! })}`} href={searchTerritoryHref(`/oportunidades?${new URLSearchParams(r.corridor_id ? { corridor_id: r.corridor_id } : r.cluster_id ? { cluster_id: r.cluster_id } : { project_id: r.project_id! })}`, url)}
> >
Ver oportunidades associadas Ver oportunidades associadas
</Link> </Link>
@@ -174,10 +176,10 @@ export default function Index({
aria-label="Alternativas de exploração" aria-label="Alternativas de exploração"
className="flex flex-wrap gap-4" className="flex flex-wrap gap-4"
> >
<Link className="underline" href="/oportunidades"> <Link className="underline" href={searchTerritoryHref('/oportunidades', url)}>
Ver oportunidades publicadas Ver oportunidades publicadas
</Link> </Link>
<Link className="underline" href="/zonas"> <Link className="underline" href={searchTerritoryHref('/zonas', url)}>
Consultar ZEE, ZFI e parques Consultar ZEE, ZFI e parques
</Link> </Link>
<Link className="underline" href="/Simulador"> <Link className="underline" href="/Simulador">
+4 -3
View File
@@ -1,6 +1,7 @@
import { Link, useForm, router, usePage } from '@inertiajs/react'; import { Link, useForm, router, usePage } from '@inertiajs/react';
import { useState } from 'react'; import { useState } from 'react';
import { catalogueReturnHref } from '@/lib/catalogue-context'; import { catalogueReturnHref } from '@/lib/catalogue-context';
import { searchTerritoryHref } from '@/lib/search-territory';
import InvestmentMapPanel from '@/components/investment-map-panel'; import InvestmentMapPanel from '@/components/investment-map-panel';
import StructureGeographyPanel, { import StructureGeographyPanel, {
type StructureGeography, type StructureGeography,
@@ -190,7 +191,7 @@ function Editor({
</h2> </h2>
{zones.map((z) => ( {zones.map((z) => (
<p key={z.id}> <p key={z.id}>
<Link className="underline" href={`/zonas/${z.id}`}> <Link className="underline" href={searchTerritoryHref(`/zonas/${z.id}`, pageUrl)}>
{z.name} {z.name}
</Link>{' '} </Link>{' '}
· {z.association_type} · Fonte: {z.source_reference} · {z.association_type} · Fonte: {z.source_reference}
@@ -297,7 +298,7 @@ function Editor({
<article key={opportunity.id}> <article key={opportunity.id}>
<Link <Link
className="font-semibold underline" className="font-semibold underline"
href={`/oportunidades/${opportunity.slug}?from_dossier=${record.id}`} href={searchTerritoryHref(`/oportunidades/${opportunity.slug}?from_dossier=${record.id}`, pageUrl)}
> >
{opportunity.title} {opportunity.title}
</Link> </Link>
@@ -485,7 +486,7 @@ function Editor({
{kind(r)}:{' '} {kind(r)}:{' '}
<Link <Link
className="underline" className="underline"
href={`${base}/${r.id}${management ? '' : `?from=${record.id}`}`} href={searchTerritoryHref(`${base}/${r.id}${management ? '' : `?from=${record.id}`}`, pageUrl)}
> >
{r.title} {r.title}
</Link> </Link>
+1
View File
@@ -47,6 +47,7 @@ use Laravel\Fortify\Features;
// Route::inertia('/', 'welcome')->name('home'); // Route::inertia('/', 'welcome')->name('home');
Route::get('/', [PortalServicesController::class, 'home'])->name('home'); Route::get('/', [PortalServicesController::class, 'home'])->name('home');
Route::inertia('/contextos-de-investimento', 'portal/investment-contexts')->name('portal.investment-contexts');
Route::inertia('/politica-de-privacidade', 'portal/privacy-policy')->name('legal.privacy'); Route::inertia('/politica-de-privacidade', 'portal/privacy-policy')->name('legal.privacy');
Route::inertia('/termos-de-uso', 'portal/terms-of-use')->name('legal.terms'); Route::inertia('/termos-de-uso', 'portal/terms-of-use')->name('legal.terms');
foreach (['sectores' => 'sectors', 'como-investir' => 'procedures', 'legislacao' => 'legislation', 'documentos' => 'documents', foreach (['sectores' => 'sectors', 'como-investir' => 'procedures', 'legislacao' => 'legislation', 'documentos' => 'documents',
@@ -0,0 +1,93 @@
<?php
namespace Tests\Feature;
use App\Services\InvestmentCatalogue;
use App\Services\InvestmentZones;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Tests\TestCase;
class CatalogueSelectorReferencesTest extends TestCase
{
use DatabaseTransactions;
protected function setUp(): void
{
parent::setUp();
$db = DB::selectOne('select current_database() as name, inet_server_port() as port');
$this->assertSame('simulator_fiscal_delta_20261021_test', $db->name);
$this->assertSame(55441, (int) $db->port);
$this->withoutVite();
}
public function test_public_parks_remain_selectable_with_zero_results_without_exposing_private_or_other_territories(): void
{
$province = '059b02ca-7095-577a-8705-4d4c46896747';
$template = app(InvestmentZones::class)->visible()->firstOrFail();
$ids = [];
foreach (['public', 'private', 'other'] as $case) {
$zone = $template->replicate();
$zone->id = (string) Str::uuid();
$zone->code = 'SINT-SELECTOR-'.Str::random(12);
$zone->name = 'SINTÉTICO QA '.$case;
$zone->category = 'industrial_park';
$zone->primary_territory_id = $case === 'other' ? '9e42dac8-fd9b-523f-bf59-71a7d3aa0fb8' : $province;
$zone->publication_status = $case === 'private' ? 'draft' : 'published';
$zone->source_evidence = [['source_type' => 'government', 'url' => 'https://example.test/qa-only', 'supports' => 'Synthetic QA fixture, not a legal source']];
$zone->save();
$ids[$case] = $zone->id;
}
$scope = ['province_id' => $province, 'park_id' => $ids['public'], 'q' => 'no-matching-opportunity-'.Str::uuid()];
$this->assertSame(0, app(InvestmentCatalogue::class)->query($scope)->count());
$response = $this->getJson('/api/v1/investment/references?'.http_build_query($scope))->assertOk();
$available = array_column($response->json('zones'), 'id');
$this->assertContains($ids['public'], $available);
$this->assertNotContains($ids['private'], $available);
$this->assertNotContains($ids['other'], $available);
$this->assertContains($ids['other'], array_column($this->getJson('/api/v1/investment/references')->assertOk()->json('zones'), 'id'));
$this->get('/zonas/'.$ids['public'])->assertOk();
$this->get('/zonas/'.$ids['private'])->assertNotFound();
}
public function test_activity_catalogue_does_not_disappear_when_opportunity_search_has_no_matches(): void
{
$catalogue = app(InvestmentCatalogue::class);
$global = collect($catalogue->references()['classification']['targets']['activity'])->pluck('id')->all();
$this->assertNotEmpty($global);
foreach (['059b02ca-7095-577a-8705-4d4c46896747', '9e42dac8-fd9b-523f-bf59-71a7d3aa0fb8'] as $province) {
$scope = ['province_id' => $province, 'q' => 'no-matching-opportunity-'.Str::uuid(), 'sector' => 'tourism'];
$this->assertSame(0, $catalogue->query($scope)->count());
$this->assertSame($global, collect($catalogue->references(false, $scope)['classification']['targets']['activity'])->pluck('id')->all());
}
}
public function test_public_master_structures_and_chain_are_available_without_opportunities_or_published_dossiers(): void
{
$province = '059b02ca-7095-577a-8705-4d4c46896747';
$clusters = [];
foreach (['public', 'internal'] as $visibility) {
$id = (string) Str::uuid();
DB::table('economic_clusters')->insert(['id' => $id, 'code' => 'SINT-'.Str::random(12), 'name' => 'SINTÉTICO QA cluster',
'sector' => 'QA', 'status' => 'active', 'data_classification' => $visibility, 'primary_territory_id' => $province]);
$clusters[$visibility] = $id;
}
$corridor = (string) Str::uuid();
DB::table('development_corridors')->insert(['id' => $corridor, 'code' => 'SINT-'.Str::random(12), 'name' => 'SINTÉTICO QA corredor',
'status' => 'active', 'data_classification' => 'public', 'primary_territory_id' => $province]);
$project = \App\Models\Project::factory()->create(['data_classification' => 'public', 'primary_territory_id' => $province]);
$chain = (string) Str::uuid();
DB::table('value_chains')->insert(['id' => $chain, 'cluster_id' => $clusters['public'], 'code' => 'SINT-'.Str::random(12),
'name' => 'SINTÉTICO QA cadeia', 'stage' => 'production', 'data_classification' => 'public']);
$refs = app(InvestmentCatalogue::class)->references(false, ['province_id' => $province, 'q' => 'no-matching-opportunity']);
$this->assertContains($clusters['public'], $refs['clusters']->pluck('id')->all());
$this->assertNotContains($clusters['internal'], $refs['clusters']->pluck('id')->all());
$this->assertContains($corridor, $refs['corridors']->pluck('id')->all());
$this->assertContains($project->id, $refs['projects']->pluck('id')->all());
$this->assertContains($chain, collect($refs['classification']['targets']['chain'])->pluck('id')->all());
$other = app(InvestmentCatalogue::class)->references(false, ['province_id' => '9e42dac8-fd9b-523f-bf59-71a7d3aa0fb8']);
$this->assertNotContains($clusters['public'], $other['clusters']->pluck('id')->all());
$this->assertNotContains($chain, collect($other['classification']['targets']['chain'])->pluck('id')->all());
}
}
@@ -0,0 +1,145 @@
<?php
namespace Tests\Feature;
use App\Models\User;
use App\Services\PrivateInvestmentPreparation;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Tests\TestCase;
class PrivateInvestmentPreparationTest extends TestCase
{
use DatabaseTransactions;
protected function setUp(): void
{
parent::setUp();
$this->withoutVite();
$db = DB::selectOne('select current_database() as name, inet_server_port() as port');
$this->assertSame('simulator_fiscal_delta_20261021_test', $db->name);
$this->assertSame(55441, (int) $db->port);
config(['investor-path.enabled' => true, 'investor-path.private_preparation' => true, 'suitecrm.enabled' => false, 'investmoz_ai.enabled' => false]);
}
private function declarations(): array
{
return ['investment_form' => 'direct', 'investment_preparation' => 'yes', 'investment_activity_scope' => 'general', 'implementation_mode' => 'domestic_entity', 'capital_origin' => 'national', 'site_tenure' => 'lease', 'project_concession' => 'no', 'significant_implications' => 'no', 'land_extension' => 'no', 'forest_concession' => 'no', 'total_investment' => '1000000', 'currency' => 'MZN', 'expected_start_date' => '2026-01-01', 'entity_stage' => 'being_formed'];
}
private function dossier(User $user): string
{
return $this->actingAs($user)->postJson('/investimentos', ['title' => 'SINTÉTICO C — percurso adaptativo', 'client_key' => (string) Str::uuid(), 'reuse_consent' => true])->assertCreated()->json('id');
}
private function save(string $id, array $declarations, array $links = []): array
{
$view = $this->getJson('/investimentos/'.$id.'/contexto')->assertOk()->json();
$body = ['version' => $view['case']['version'], 'selection' => [], 'declarations' => $declarations, 'document_links' => $links];
$plan = $this->postJson('/investimentos/'.$id.'/contexto/previa', $body)->assertOk()->json();
// The preview is read-only.
$this->getJson('/investimentos/'.$id.'/contexto')->assertJsonPath('context.revision', $view['context']['revision']);
$control = [...$body, 'preview_hash' => $plan['preview_hash'], 'operation_key' => (string) Str::uuid(), 'confirm' => true];
$this->postJson('/investimentos/'.$id.'/contexto/confirmar', $control)->assertOk();
$this->postJson('/investimentos/'.$id.'/contexto/confirmar', $control)->assertOk()->assertJsonPath('replayed', true);
return $plan;
}
public function test_boundaries_unknown_conditions_and_scope_are_not_silently_presumed(): void
{
$service = app(PrivateInvestmentPreparation::class);
$assess = fn (array $changes = []) => $service->assess(['fields' => [...$this->declarations(), ...$changes]]);
$this->assertSame('registration', $assess(['total_investment' => '32000000000'])['mode']);
$this->assertSame('authorization', $assess(['total_investment' => '32000000000.0001'])['mode']);
$this->assertSame('authorization', $assess(['land_extension' => 'yes', 'area_required' => '10000', 'area_unit' => 'ha'])['mode']);
$this->assertSame('registration', $assess(['forest_concession' => 'yes', 'forest_concession_hectares' => '100000'])['mode']);
$this->assertSame('authorization', $assess(['forest_concession' => 'yes', 'forest_concession_hectares' => '100000.01'])['mode']);
$this->assertSame('indeterminate', $assess(['significant_implications' => 'unknown'])['mode']);
$this->assertSame('indeterminate', $assess(['currency' => 'USD'])['mode']);
$this->assertSame('indeterminate', $assess(['investment_form' => 'unknown'])['mode']);
$this->assertSame('indeterminate', $assess(['investment_form' => 'indirect'])['mode']);
$this->assertSame('authorization', $assess(['investment_form' => 'indirect', 'project_concession' => 'yes'])['mode']);
foreach ([['investment_activity_scope' => 'extractive'], ['expected_start_date' => '2027-01-01']] as $changes) {
$result = $assess($changes);
$this->assertSame('indeterminate', $result['mode']);
$this->assertFalse(collect($result['requirements'])->contains('required', true));
}
$this->assertSame('registration', $assess(['investor_origin' => 'foreign', 'tax_residency_country' => 'ZA'])['mode']);
$this->assertFalse(collect($assess(['investor_origin' => 'foreign'])['requirements'])->firstWhere('key', 'representation_license')['required']);
foreach (['zee', 'zfi'] as $regime) {
$zone = $service->assess(['fields' => $this->declarations(), 'selection' => ['park' => ['fields' => ['investment_regime' => $regime]]]]);
$this->assertStringContainsString('APIEX', $zone['authority']);
$this->assertStringContainsString('condicionado', $zone['authority']);
$this->assertArrayNotHasKey('benefit_rate', $zone);
}
$park = $service->assess(['fields' => $this->declarations(), 'selection' => ['park' => ['fields' => ['investment_regime' => 'industrial_park']]]]);
$this->assertSame('Governador da Província', $park['authority']);
}
public function test_context_changes_adapt_requirements_and_preserve_association_history_and_results(): void
{
$owner = User::factory()->create();
$id = $this->dossier($owner);
$doc = (string) Str::uuid();
DB::table('documents')->insert(['id' => $doc, 'file_name' => 'SINTETICO-C-QA.txt', 'media_type' => 'text/plain', 'storage_key' => 'synthetic-test-no-download', 'sha256' => hash('sha256', 'synthetic'), 'status' => 'quarantined']);
DB::table('desk_documents')->insert(['id' => (string) Str::uuid(), 'case_id' => $id, 'document_id' => $doc, 'category' => 'support', 'source_reference' => 'Synthetic QA only', 'linked_by' => $owner->id]);
$initial = $this->save($id, $this->declarations(), ['lease' => $doc]);
$this->assertSame('registration', $initial['private_investment']['after']['mode']);
$view = $this->getJson('/investimentos/'.$id.'/contexto')->json();
$this->assertSame('associated', collect($view['private_investment']['requirements'])->firstWhere('key', 'lease')['state']);
$this->assertLessThan(20000, mb_strlen($view['prefill']['simulator']['context_applicability_snapshot']));
$this->assertArrayNotHasKey('investment_preparation', $view['prefill']['simulator']);
$personalKeys = ['person_type', 'investor_origin', 'tax_residency_country', 'fiscal_residency_country', 'entity_stage'];
$this->postJson('/api/v1/simulation-drafts', ['context' => $id, 'personal_snapshot' => Arr::only($view['prefill']['simulator'], $personalKeys), 'economic_snapshot' => ['purpose' => 'simulate_only', ...Arr::except($view['prefill']['simulator'], $personalKeys)]], ['Idempotency-Key' => (string) Str::uuid()])->assertCreated();
$plan = $this->save($id, ['project_concession' => 'yes', 'implementation_mode' => 'foreign_representation', 'site_tenure' => 'duat']);
$this->assertFalse($plan['calculation_inputs_changed'], 'Procedural changes do not change the inputs of the existing IVA calculation.');
$this->assertContains('S06', $plan['review_steps']);
$after = $plan['private_investment']['after'];
$this->assertSame('authorization', $after['mode']);
$this->assertSame('Conselho de Ministros', $after['authority']);
foreach (['feasibility', 'financial_capacity', 'representation_license', 'name_reservation', 'duat'] as $key) {
$this->assertTrue(collect($after['requirements'])->firstWhere('key', $key)['required']);
}
$lease = collect($after['requirements'])->firstWhere('key', 'lease');
$this->assertSame('not_applicable', $lease['state']);
$this->assertSame($doc, $lease['document_id']);
$this->assertSame(1, DB::table('desk_documents')->where('case_id', $id)->count());
$back = $this->save($id, ['project_concession' => 'no', 'implementation_mode' => 'domestic_entity', 'site_tenure' => 'lease', 'entity_stage' => 'existing']);
$this->assertTrue(collect($back['private_investment']['after']['requirements'])->firstWhere('key', 'registration')['required']);
$this->assertFalse(collect($back['private_investment']['after']['requirements'])->firstWhere('key', 'name_reservation')['required']);
$this->assertSame('associated', collect($back['private_investment']['after']['requirements'])->firstWhere('key', 'lease')['state']);
$this->assertSame('not_applicable', collect($back['private_investment']['after']['requirements'])->firstWhere('key', 'feasibility')['state']);
$events = DB::table('desk_events')->where('case_id', $id)->where('action', 'investment_context_changed')->count();
$this->assertSame(3, $events);
$this->getJson('/investimentos/'.$id)->assertOk()->assertJsonPath('private_investment.mode', 'registration');
$this->actingAs(User::factory()->create())->getJson('/investimentos/'.$id.'/contexto')->assertForbidden();
$this->actingAs($owner)->getJson('/investimentos/'.$id.'/contexto')->assertOk()->assertJsonPath('private_investment.mode', 'registration');
config(['investor-path.private_preparation' => false]);
$this->save($id, ['project_title' => 'Edição independente durante suspensão']);
$this->getJson('/investimentos/'.$id.'/contexto')->assertOk()->assertJsonPath('private_investment', null)->assertJsonPath('context.preparation_snapshot.mode', 'registration')->assertJsonPath('context.preparation_documents.lease', $doc);
}
public function test_foreign_document_and_tampered_preview_cannot_be_committed_and_disabled_feature_does_not_accept_writes(): void
{
$owner = User::factory()->create();
$id = $this->dossier($owner);
$view = $this->getJson('/investimentos/'.$id.'/contexto')->json();
$body = ['version' => $view['case']['version'], 'selection' => [], 'declarations' => $this->declarations()];
$this->postJson('/investimentos/'.$id.'/contexto/previa', [...$body, 'document_links' => ['identity' => (string) Str::uuid()]])->assertUnprocessable();
$other = $this->dossier($owner);
$foreignDocument = (string) Str::uuid();
DB::table('documents')->insert(['id' => $foreignDocument, 'file_name' => 'OUTRO-DOSSIER-SINTETICO-QA.txt', 'media_type' => 'text/plain', 'storage_key' => 'synthetic-no-download', 'sha256' => hash('sha256', 'other synthetic'), 'status' => 'quarantined']);
DB::table('desk_documents')->insert(['id' => (string) Str::uuid(), 'case_id' => $other, 'document_id' => $foreignDocument, 'category' => 'support', 'source_reference' => 'Synthetic isolated QA', 'linked_by' => $owner->id]);
$this->postJson('/investimentos/'.$id.'/contexto/previa', [...$body, 'document_links' => ['identity' => $foreignDocument]])->assertUnprocessable();
$plan = $this->postJson('/investimentos/'.$id.'/contexto/previa', $body)->assertOk()->json();
$this->postJson('/investimentos/'.$id.'/contexto/confirmar', [...$body, 'declarations' => [...$body['declarations'], 'currency' => 'USD'], 'preview_hash' => $plan['preview_hash'], 'operation_key' => (string) Str::uuid(), 'confirm' => true])->assertConflict();
$this->getJson('/investimentos/'.$id.'/contexto')->assertJsonPath('context.revision', 0);
config(['investor-path.private_preparation' => false]);
$this->postJson('/investimentos/'.$id.'/contexto/previa', $body)->assertConflict();
$this->postJson('/investimentos/'.$id.'/contexto/previa', [...$body, 'declarations' => 'invalid'])->assertUnprocessable();
$this->getJson('/investimentos/'.$id.'/contexto')->assertOk()->assertJsonPath('private_investment', null);
}
}

Some files were not shown because too many files have changed in this diff Show More