from pathlib import Path qa=Path('C:/Users/macbook/.config/investmoz/negocios-classificacao-QA-20261016/source') p=qa/'resources/js/pages/investment/business-classification.tsx';s=p.read_text('utf-8') s=s.replace('publication: PublicClassification[]; publication_version:', 'publication: PublicClassification[]; preview: PublicClassification[]; publication_version:') a=s.index(' const previewRows: PublicClassification[] =');b=s.index(' return >(() => Object.fromEntries(['sector', 'association_type', 'association_target', 'association_purpose', 'association_state', 'chain_id', 'authority_id', 'subsector_id'].map((key) => [key, filters[key] ?? ''])));\n const [query, setQuery]") s=s.replace(' ...territory,',' ...territory,\n ...classification,',1) s=s.replace(' ...territory,',' ...territory,\n ...classification,') needle=' ' assert s.count(needle)==1 fieldset=''' {classificationOptions &&
Classificação multidimensional — filtros combinados

Critérios diferentes combinam-se por «e». Tipo, referência, finalidade e estado têm de corresponder à mesma relação pública. O setor principal mantém o seu significado.

{([ ['sector', 'Setor principal do anúncio', classificationOptions.targets.sector ?? []], ['association_type', 'Tipo de associação', Object.keys(classificationOptions.types).map((id) => ({ id, label: ({ corridor: 'Corredor', location: 'Localização', cluster: 'Cluster', project: 'Projeto âncora', chain: 'Cadeia de valor', park: 'Parque industrial', zone: 'Regime de zona', sector: 'Setor associado', activity: 'Subsector ou atividade' } as Record)[id] ?? id }))], ['association_target', 'Referência da associação', classificationOptions.targets[classification.association_type] ?? []], ['association_purpose', 'Finalidade', Object.entries(classificationOptions.purposes).map(([id, label]) => ({ id, label }))], ['association_state', 'Estado da associação', Object.entries(classificationStates).filter(([id]) => !['archived', 'revoked'].includes(id)).map(([id, label]) => ({ id, label }))], ['chain_id', 'Cadeia de valor', classificationOptions.targets.chain ?? []], ['subsector_id', 'Subsector ou atividade', classificationOptions.targets.activity ?? []], ['authority_id', 'Entidade competente', authorities.map((a) => ({ id: a.id, label: a.label_pt_mz }))], ] as [string, string, { id: string | number; label: string }[]][]).map(([key, label, options]) => )}
} ''' s=s.replace(needle,fieldset+needle) s=s.replace(' {record.objective && (',' {!!record.multidimensional?.length && }\n {record.objective && (') p.write_text(s,'utf-8') # Build in the private source using the production directory contract, without invoking Wayfinder/artisan. s=(qa/'vite.config.ts').read_text('utf-8').replace("const qaBuild = process.env.INVESTMOZ_QA_BUILD === '1';",'const qaBuild = false;').replace('...(!qaBuild ? [wayfinder','...(false ? [wayfinder') (qa/'vite.deliver.config.ts').write_text(s,'utf-8') print('Private QA interface and isolated build configuration prepared')