Scope parks and downstream investment requests to the treated opportunity

This commit is contained in:
2026-10-23 17:49:22 +02:00
parent ad4160f040
commit 4a01e9e2b7
25 changed files with 408 additions and 39 deletions
+5
View File
@@ -32,6 +32,7 @@ export default function Detail({
}) {
const page = usePage<{ auth: { user: unknown } }>();
const { auth } = page.props;
const dossierContext = new URLSearchParams(page.url.split('?')[1] ?? '').get('context');
const [sharing, setSharing] = useState('');
return (
<Frame title={r.title}>
@@ -43,6 +44,10 @@ export default function Detail({
Iniciar ou continuar investimento com esta oportunidade
</Link>
<PartnershipSourceLinks type="investment" id={r.id} />
{auth.user&&dossierContext&&<nav aria-label="Preparar esta oportunidade" className="flex flex-wrap gap-4">
<Link className="underline" href={`/investidor/terra-duat/novo?context=${encodeURIComponent(dossierContext)}&opportunity=opportunity%3A${r.id}`}>Terra/DUAT desta oportunidade</Link>
<Link className="underline" href={`/balcao-virtual/dossiers/${encodeURIComponent(dossierContext)}?opportunity=opportunity%3A${r.id}`}>Balcão desta oportunidade</Link>
</nav>}
<Link href={returnUrl} className="underline">
Voltar à pesquisa
</Link>
@@ -9,6 +9,8 @@ import { Conversation } from './conversation';
import type { Message } from './conversation';
import CountrySelect, { type Country } from '@/components/country-select';
type Payload = {
context_opportunity?: string;
context_opportunity_snapshot?: string;
simple_participation?: boolean;
opportunity_title?: string;
opportunity_reference?: string;
@@ -79,6 +81,7 @@ type Props = {
id: string;
version: number;
payload: Partial<Payload>;
opportunity_id?: number | null;
status: string;
};
references: References;
@@ -461,6 +464,7 @@ function Editor({
<DossierPrefill
contextId={contextDossierId}
consumer="submission"
initialOpportunity={s.opportunity_id ? `opportunity:${s.opportunity_id}` : undefined}
values={form.data.payload}
boundRevision={boundContextRevision}
readOnly={readonly}