Present financial institutions with professional investor-facing descriptions and products
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-11 11:19:27 +02:00
parent 8ebe734d0d
commit a59142caa2
16 changed files with 306 additions and 126 deletions
@@ -4,6 +4,7 @@ import {
evidenceLabels,
type Classification,
} from '@/components/funding-classification';
import {fundingPublicPresentation} from '@/lib/funding-public-presentation';
import { card, input, button } from '@/pages/investment/shared';
export type FundingSource = {
@@ -551,40 +552,7 @@ export function InstitutionFields({
</section>
);
}
function Source({ value }: { value: FundingSource }) {
return (
<div>
<p>
{value.source_url ? (
<a
className="underline"
href={value.source_url}
target="_blank"
rel="noopener noreferrer"
>
{value.source_reference}
</a>
) : (
value.source_reference
)}{' '}
· consulta {value.checked_on}
</p>
{value.source_document_name && (
<p>
Documento: {value.source_document_name} · SHA-256{' '}
{value.source_document_sha256}
</p>
)}
{value.evidence_status && (
<p>
{evidenceLabels[value.evidence_status] ??
value.evidence_status}{' '}
· {value.origin}
</p>
)}
</div>
);
}
function Source({value}:{value:FundingSource}){return <>{value.source_url&&<details><summary>Informação institucional</summary><a className="underline" href={value.source_url} target="_blank" rel="noopener noreferrer">Consultar informação da entidade</a><p>Consulta em {value.checked_on}.</p></details>}{value.evidence_status==='historical'&&<p>Informação histórica.</p>}{value.evidence_status==='conflict'&&<p>Informação por esclarecer junto da instituição.</p>}</>;}
export function InstitutionView({ value }: { value: InstitutionDetails }) {
return (
<section className={card}>
@@ -643,29 +611,28 @@ export function InstitutionView({ value }: { value: InstitutionDetails }) {
: l.role === 'branch'
? 'Balcão'
: 'Ponto de contacto institucional'}
: {l.label} · {l.address}
: {l.label && !/^(Morada|Localização).*(documento|fonte)/i.test(l.label) ? l.label+' · ' : ''}{l.address}
</p>
<p>
{l.territory_path?.map((n) => n.name).join(' / ') ||
'Correspondência ao cadastro territorial por confirmar'}
'Localização detalhada a confirmar'}
</p>
{l.location_text && (
<p>Local indicado: {l.location_text}</p>
)}
{l.hours && (
<p>
Horário indicado na fonte (pode ter mudado):{' '}
Horário de atendimento:{' '}
{l.hours}
</p>
)}
<Source value={l} />
</article>
))}
<h3>Produtos e programas</h3>
<h3>Produtos e serviços</h3>
{value.products.length === 0 && (
<p>
Produtos e condições por confirmar; a identificação da
instituição não confirma oferta disponível.
{fundingPublicPresentation({...value,title:"",kind:"institution",summary:""}).services.join(" · ") || "Consulte as soluções disponíveis junto da instituição."}
</p>
)}
{value.products.map((p) => (