Integrate supplied institutions by location category and type through investor dossiers

This commit is contained in:
2026-11-10 20:59:24 +02:00
parent 5ff9402fd0
commit 5a5cc9e815
26 changed files with 33731 additions and 80 deletions
+15 -1
View File
@@ -279,7 +279,9 @@ function Editor({
}
function text(
key: {
[K in keyof Draft]: Draft[K] extends string ? K : never;
[K in keyof Draft]-?: Draft[K] extends string | null | undefined
? K
: never;
}[keyof Draft],
label: string,
type = 'text',
@@ -427,6 +429,18 @@ function Editor({
{!draft.manager_organization_id &&
text('manager_name', 'Gestor indicado pela fonte')}
{text('source_url', 'Endereço da fonte', 'url')}
{!draft.source_url && (
<>
{text(
'source_document_name',
'Documento de origem',
)}
{text(
'source_document_sha256',
'SHA-256 do documento',
)}
</>
)}
{text('source_reference', 'Documento, edição e referência')}
{text(
'source_checked_on',
+89 -1
View File
@@ -1,3 +1,7 @@
import {
financialCategories,
financialTypes,
} from '@/components/funding-classification';
import { Link, useForm } from '@inertiajs/react';
import { Frame, card, button } from '@/pages/investment/shared';
import { type Programme, windowLabels } from './shared';
@@ -24,6 +28,10 @@ export default function Index({
need?: string;
context?: string;
opportunity?: string;
category?: string;
institution_type?: string;
location_mode?: string;
include_historical?: string;
};
options: {
sectors: { id: number; name: string }[];
@@ -34,6 +42,10 @@ export default function Index({
management: boolean;
}) {
const form = useForm({
category: filters.category ?? '',
institution_type: filters.institution_type ?? '',
location_mode: filters.location_mode ?? 'coverage',
include_historical: filters.include_historical ?? '0',
context: filters.context ?? '',
opportunity: filters.opportunity ?? '',
need: filters.need ?? '',
@@ -66,7 +78,74 @@ export default function Index({
}}
>
<label>
Necessidade de financiamento
Categoria
<select
className="block rounded border p-2"
value={form.data.category}
onChange={(e) =>
form.setData('category', e.target.value)
}
>
<option value="">Todas</option>
{Object.entries(financialCategories).map(
([id, label]) => (
<option key={id} value={id}>
{label}
</option>
),
)}
</select>
</label>
<label>
Tipo
<select
className="block rounded border p-2"
value={form.data.institution_type}
onChange={(e) =>
form.setData('institution_type', e.target.value)
}
>
<option value="">Todos</option>
{Object.entries(financialTypes).map(([id, label]) => (
<option key={id} value={id}>
{label}
</option>
))}
</select>
</label>
<label>
Localização a pesquisar
<select
className="block rounded border p-2"
value={form.data.location_mode}
onChange={(e) =>
form.setData('location_mode', e.target.value)
}
>
<option value="physical">
Sede, balcão ou presença física
</option>
<option value="coverage">
Cobertura do financiamento/produto
</option>
</select>
</label>
<label>
<input
type="checkbox"
checked={form.data.include_historical === '1'}
onChange={(e) =>
form.setData(
'include_historical',
e.target.checked ? '1' : '0',
)
}
/>
Incluir instituições históricas/fundidas, identificadas como
tal
</label>
<label>
Necessidade do processo
<select
className="block rounded border p-2"
value={form.data.need}
@@ -195,6 +274,15 @@ export default function Index({
</Link>
</h2>
<p>{item.payload.summary}</p>
<p>
{(item.payload.institution_categories ?? [])
.map((k) => financialCategories[k] ?? k)
.join(' · ')}{' '}
·{' '}
{(item.payload.institution_types ?? [])
.map((k) => financialTypes[k] ?? k)
.join(' · ')}
</p>
<p>Gestor: {item.payload.manager_name}</p>
{Object.entries(item.filter_explanation ?? {}).map(
([key, message]) => (
+8 -2
View File
@@ -85,13 +85,19 @@ export default function Show({
<p>
<a
className="underline"
href={payload.source_url}
href={payload.source_url || undefined}
target="_blank"
rel="noopener noreferrer"
>
Consultar fonte: {payload.source_reference}
</a>
. Consultada em {payload.source_checked_on}.
. Consultada em {payload.source_checked_on}.{' '}
{payload.source_document_name && (
<span>
Documento: {payload.source_document_name} · SHA-256{' '}
{payload.source_document_sha256}
</span>
)}
</p>
<section className={card}>
<h2 className="text-xl font-semibold">