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
+30 -1
View File
@@ -10,6 +10,10 @@ import type { BusinessVerification } from './business-verifications';
import BusinessWizard from './business-wizard';
import type { FormSchema } from './business-wizard';
import type { Country } from '@/components/country-select';
import BusinessPointSummary, {
type RegisteredBusinessLocation,
} from '@/components/business-point-summary';
import { businessPointTerritoryLabel } from '@/lib/business-locations';
type Props = {
countries: Country[];
@@ -18,6 +22,8 @@ type Props = {
sectors: { id: number; name: string }[];
record: Business;
canEdit: boolean;
registeredLocation?: RegisteredBusinessLocation | null;
pointPublicationAvailable?: boolean;
owner: boolean;
canReview: boolean;
canTriage: boolean;
@@ -68,6 +74,8 @@ function Editor({
verifications,
formSchema,
sectors,
registeredLocation,
pointPublicationAvailable,
}: Props) {
const [payload, setPayload] = useState(record.payload);
const [modality, setModality] = useState(record.modality);
@@ -131,6 +139,16 @@ function Editor({
{businessStates[record.status]} · versão {record.version_no} ·
informação reservada
</p>
<BusinessPointSummary
payload={record.payload}
registered={registeredLocation}
available={pointPublicationAvailable}
published={record.status === 'published'}
territoryLabel={businessPointTerritoryLabel(
record.payload,
record.territory_paths,
)}
/>
<p>
Informação declarada, pendente de validação. Não constitui
anúncio público, certificação, avaliação ou autorização de
@@ -148,7 +166,18 @@ function Editor({
</div>
{Object.entries(formSchema)
.filter(
([key]) =>
([key, field]) =>
!key.startsWith('location_point_') &&
![
'location_latitude',
'location_longitude',
].includes(key) &&
Object.entries(field.when ?? {}).every(
([dependency, values]) =>
values.includes(
record.payload[dependency] ?? '',
),
) &&
![
'title',
'description',