feat: consolidar desenvolvimentos do portal InvestMoz

This commit is contained in:
2026-11-03 23:32:32 +02:00
parent 1da273f1f3
commit 36c8cadb49
345 changed files with 110714 additions and 2799 deletions
+40 -1
View File
@@ -1,7 +1,12 @@
import { createOperationKey } from '@/lib/operation-key';
import { Head, Link, router, useForm } from '@inertiajs/react';
import { useState } from 'react';
import {
companyComparisonUrl,
type CompanyAnswers,
} from '@/lib/company-comparison';
import type { LegacyArticle } from '@/pages/portal/legacy';
import { guideUrl, type GuideSelection } from '@/lib/investment-guides';
export type InvestmentContext = {
id: string;
@@ -15,8 +20,12 @@ export default function InvestmentContexts({
contentSource,
sectorSource,
zoneSource,
companyComparisonAnswers,
guideSelection,
}: {
contexts: InvestmentContext[];
companyComparisonAnswers?: CompanyAnswers | null;
guideSelection?: GuideSelection | null;
contentSource?: LegacyArticle;
zoneSource?: {
zone_id: string;
@@ -37,11 +46,29 @@ export default function InvestmentContexts({
reuse_consent: false,
content_resource_id: contentSource?.id,
sector_slug: sectorSource?.slug,
...(companyComparisonAnswers
? { company_comparison: companyComparisonAnswers }
: {}),
...(guideSelection ? { investment_guide: guideSelection } : {}),
});
return (
<main className="mx-auto max-w-5xl space-y-6 p-4 md:p-8">
<Head title="Os meus investimentos" />
<h1 className="text-2xl font-semibold">Os meus investimentos</h1>
{guideSelection && (
<p>
Escolha ou crie o dossier onde pretende preparar esta
referência. O guia e a nota só serão guardados quando
confirmar nesse dossier.
</p>
)}
{companyComparisonAnswers && (
<p>
Escolha o dossier para continuar a comparação de formas
jurídicas. As respostas só serão guardadas quando confirmar
nesse dossier.
</p>
)}
{zoneSource && (
<section className="rounded border p-4">
<h2>Parque escolhido: {zoneSource.title}</h2>
@@ -78,7 +105,19 @@ export default function InvestmentContexts({
<li key={item.id} className="rounded-xl border p-4">
<Link
className="font-semibold underline"
href={`/investimentos/${item.id}`}
href={
guideSelection
? guideUrl(
`/investimentos/${item.id}/guias/${guideSelection.slug}`,
guideSelection,
)
: companyComparisonAnswers
? companyComparisonUrl(
`/investimentos/${item.id}/forma-juridica`,
companyComparisonAnswers,
)
: `/investimentos/${item.id}`
}
>
{item.title}
</Link>
+23
View File
@@ -930,6 +930,29 @@ export default function InvestmentPath(path: Path) {
</section>
<section className="space-y-3 rounded-xl border p-4">
<h2 className="text-lg font-semibold">Documentos</h2>
<Link
className="block underline"
href={`/investimentos/${path.case.id}/guias/capitalizacao`}
>
Preparar capitalização e financiamento
</Link>
<Link
className="block underline"
href={`/investimentos/${path.case.id}/guias/bolsa`}
>
Preparar a admissão à Bolsa de Valores de Moçambique
</Link>
<Link
className="block underline"
href={`/investimentos/${path.case.id}/preparar-empresa`}
>
Preparar os dados para a constituição da empresa
</Link>
{path.tools.company && (
<Link className="underline" href={path.tools.company}>
Comparar formas jurídicas para este investimento
</Link>
)}
<ul>
{path.documents.map((doc) => (
<li key={doc.id}>