oportunidades 7
tests / ci (push) Waiting to run

This commit is contained in:
2026-10-13 11:40:29 +02:00
parent 20971d523f
commit 287e991486
2902 changed files with 1085456 additions and 25957 deletions
@@ -0,0 +1,35 @@
# Abertura do workflow isolado — entrega 2e2f16c83483
Código a02ef2300d6c, baseado no ativo2876cdfa900a. O delta original e o seu manifesto de preparação permanecem selados; esta entrega reúne a aceitação posterior e o backup renovado, sem modificar código ou recompilar novamente.
## Âmbito e alterações
Nove ficheiros de código e159recursos compilados. C129 adiciona cadastro/reutilização do contacto no editor, usando contactos e relações CRM existentes, com permissões/MFA/etag/auditoria e sem publicação automática. C130 vincula a revisão de acesso também quando a administração está ligada e o workflow desligado; revogações continuam a invalidar sessões. Formatação de ficheiros afetados conservada; nenhuma diferença de código fora dos nove ficheiros declarados.
Abrir conjuntamente PORTAL_PROFILE_ACCESS_ENABLED, PORTAL_OPPORTUNITY_DASHBOARD_ACCESS_ENABLED e PORTAL_OPPORTUNITY_SPECIALIZED_DRAFTS_ENABLED. COUNTRY02 e administração permanecem ligados. Restantes experiências, notificações, legado, percurso190000, restauração e partilha individual continuam desligados. Nenhuma migration, importação, publicação de oportunidades, conta, organização, representação, papel, chave, TLS, cookie, DLL ou alteração de serviços nesta disponibilização.
Aurora14 cria/submete, Palmira15 revê/corrige/aprova e Mario16 publica, dentro dos papéis já atribuídos e das seis categorias base. A designação e o bootstrap não são repetidos. Publicação pública exige oportunidade preparada para esse âmbito e ação própria do Publicador; o pacote não publica automaticamente oportunidades.
## Provas e limites
Confirmação manual do responsável para Promotor45/QA18118: contacto, seleção, gravação, logout/nova sessão/recuperação no rascunho7; persistência e auditoria independentes. HTTP demonstra repetição/403/409/422. C130: fixture de evento antes/depois e FortifyHTTP QA temporário18119 com administraçãoON/workflowOFF, revisão>0, login/MFA/perfil/refresh/invalidação/nova sessão/logout. A confirmação visual do login é do roteiroON; não se apresenta observação visual da combinaçãoOFF. O servidor de controlo foi encerrado e não alterou a sessão do ensaio manual.
Backup real do destino verificado às 2026-10-12T11:10:30+00:00, restauro exclusivo em internal_designation_target_20261012_110953_test:55441:295tabelas,31sequências,1391ficheiros,4originais,6envelopesMFAlegíveis,0ficheiros em falta. Este é o snapshot anterior à intervenção, com código ativo2876; código/bundle novo vêm do delta selado e dos ensaios QA. Validade até 2026-10-13T11:10:30+00:00 ou alteração pertinente. Todos os ficheiros de código substituídos estão incluídos no restauro e correspondem aos hashes antes da alteração.
Limitações: contrato normativo integral Response/§27 e cargo do contacto continuam parciais; variantes imobiliárias não demonstradas, restauração e partilha individual indisponíveis. Mapas no destino não têm as camadas QA importadas; cartografia exige pacote próprio. Endereço.test é local. Primeiro processo/documentos legítimos no destino ainda precisam de acompanhamento; não se substituem por dados sintéticos. Ofertas, módulos experimentais, competências modulares e SLA mantêm decisões separadas. A/B e C37 preservados.
## Procedimento único, após autorização
1. Conferir destino, hashes, backup e atualidade dos grants, fila/classes/failed_jobs, ClamD e worker. Perante divergência, parar antes de substituir ficheiros/habilitar gates.
2. Manter os três gates desligados durante a cópia do payload correspondente. Preservar os ficheiros e bundle anteriores; conferir hashes finais, dependências dos recursos e aplicação efetivamente carregada. O autoloader PSR4 existente suporta a classe nova; nenhuma atualização de dependências/vendor é necessária.
3. Recarregar apenas a configuração/cache da aplicação pelo procedimento habitual, preservando cifragem e configuração de sessão/HTTPS. Não há mudança ou reinício de serviços previsto neste delta.
4. Habilitar conjuntamente os três gates e verificar a configuração efetiva. As operações continuam pelos mecanismos autenticados;030000/040000/050000 já estão instaladas e não são reaplicadas. Não incluir190000.
5. Verificar acesso e navegação por perfil, com os respetivos titulares e MFA próprios. O primeiro processo legítimo confirma criação/gravação/recuperação, envio/scan/derivadas e revisão/publicação independentes no destino. Registar o que for efetivamente observado, sem criar oportunidades fictícias nem atribuir ações humanas a testes.
## Contenção e reversão
Desligar os três gates conjuntamente, conservando COUNTRY02/administração/HTTPS, a correção de sessão, colunas, dados, documentos e auditoria. Não revogar atribuições nem eliminar contactos automaticamente. Preservados código/bundle2876 e backup para uma reversão técnica deliberada; restaurar o código antigo pode reintroduzir C130 e deve ser avaliado. Restauro completo da base exige decisão separada.
## Decisão pendente
Autorizar esta entrega adicional e a abertura do âmbito designado. A confirmação manual encerra o ensaio positivo QA e não equivale a autorização de disponibilização ativa. Estado: preparado para decisão; nada aplicado no destino.
@@ -0,0 +1,741 @@
{
"code_revision": "a02ef2300d6c10cb21fc1aaf2bbe14cb19e0a6e28ab34d7ae0c72ee921d79927",
"code_zip_sha256": "3dd59a5d7af550327e1bab816f5a7b0fe9003affbe7cf2cfc96945157fe7fbed",
"code_manifest_sha256": "8b0a16c8ea796dc1f967c0d82cb0dd8b8ffaa984e0a6b1aa9e8987b72d3ea13e",
"base_revision": "2876cdfa900a",
"flags": {
"PORTAL_PROFILE_ACCESS_ENABLED": true,
"PORTAL_OPPORTUNITY_DASHBOARD_ACCESS_ENABLED": true,
"PORTAL_OPPORTUNITY_SPECIALIZED_DRAFTS_ENABLED": true
},
"evidence": {
"manual-acceptance-20261012.json": "416e2dd23b43ca7e1673948838622cd1c85c06cf322864bf8ebcabf57bd2d444",
"manual-contact-readonly.json": "8f8cee719a87ffed673d69c6b91eddb4dfb385d85b834a9dd13e88c13e269e99",
"contact-policy-qa.json": "5965d95067dac7613aafca3d15a7c5cb311dbeea020448e24f946e6e27b5fa45",
"contact-http-qa.json": "6a6ba1a7403a7f6e7da1c0e517549ace7f5948d10e27bd60643cf5b2485add3e",
"session-gate-before.json": "f53c49323c2419e05af8fbb5e44bf991edb1e938c538192b083d6b9cfee58099",
"session-gate-after.json": "9aaa691a0c6d4a6bd0352b21b1f2f054246f68c66e94e741a9502ca1effed60f",
"c130-http-governance-only-qa.json": "d074aa8677d5d13eb8ac2971b1004f6b73eb588933ff619fa43024ffcb8d9117",
"worker-readonly.json": "c0f84144f833506bd1e91681c9bb8b1112980573610ee5f5478fca611d4ebc5a",
"autoload-readonly.json": "dcb337d494dd5a6ede97749587696e1993899948e2fb14565ce364c8c3cef7c9",
"source-boundary-check.json": "29e5031a709eb0fe3175dd9d84fcf75b751d44530f5f3a8b20f5980979794747"
},
"backup": {
"verified_at": "2026-10-12T11:10:30+00:00",
"clone": {
"database": "internal_designation_target_20261012_110953_test",
"port": 55441
},
"dump_sha256": "1e0d2a1630c96955875e873f46b631d937cefabf8b7be7026a1b99bed00d31b8",
"files_sha256": "2ae062c45150de89689c63a07a124ee1d54012f35088c099514b77c5a6c00a1a"
},
"delivery_revision": "2e2f16c8348394b648b18abe8adef0ea48abe59f763714e3c1963ed6f0929275",
"code_revision_short": "a02ef2300d6c",
"delivery_revision_short": "2e2f16c83483",
"source_files": [
{
"path": "app/Services/OpportunityContacts.php",
"before_sha256": null,
"after_sha256": "e6bd6d786cb8b0ecfcb1e4bbe6778e2bf1cf5460650db2fd9f0e443e096e7827"
},
{
"path": "app/Services/OpportunityCanonicalContract.php",
"before_sha256": "64128271cbb63aaf81ccfc79478788a25044c9f46567d5d2b571395a1d8d707f",
"after_sha256": "ca68669ad413534d8fa340ebeae6245b802a14568d4d33b050fa17b37dbdeb53"
},
{
"path": "app/Services/PortalProfileAccess.php",
"before_sha256": "6bc8db1b9c4a900c8446262b8f2ce756001fcb3bf06b8d7ddce5442a5cf0bbde",
"after_sha256": "9140ac0eb9f55d22bda1d97a5d97b263f7c3120384f28684dae61950ab51d1c3"
},
{
"path": "app/Providers/AppServiceProvider.php",
"before_sha256": "e66f6d88d2da9e039b783f0a03603c22e140de2c09379b380277f5e2ee0e0f01",
"after_sha256": "78b436ad0a20df484d01a0f994f3fb46fe452a4181dda4146052424d14d182cf"
},
{
"path": "app/Http/Controllers/PortalProfileController.php",
"before_sha256": "94f02be39da0d24e54b76afbb780868449987b7dddb924904a5628a991cbd2b0",
"after_sha256": "cb1ecd7975fbfc5aebcf81c7d9956de7eaebc8ddf6034d103cc7c226de7881e0"
},
{
"path": "routes/web.php",
"before_sha256": "350eae3d66d747d5f29d17a64e5859994e2a1c63916a50896414027cabbde632",
"after_sha256": "b5710eeb6432c5643cc91a23ee93a2013d813504336897ce10811d567cb89c9f"
},
{
"path": "resources/js/components/opportunity-contact-form.tsx",
"before_sha256": null,
"after_sha256": "a4029bef84283c70973d709e9fe6cbd60a564641e806eba640b38b8e4b733910"
},
{
"path": "resources/js/components/opportunity-canonical-fields.tsx",
"before_sha256": "d915c02e7c01499018bb090e1e71bdd376e15c9c36ed32830adbdf627ad3ac05",
"after_sha256": "421641f8d71477d94604d9ea641112405b4bcb42372b42c44c25eaee506e900f"
},
{
"path": "resources/js/pages/management/opportunity-draft.tsx",
"before_sha256": "f23be93c0d343ca7cb22655d0e7386b4de0b77f8c820ebf339429a9408d837ed",
"after_sha256": "057614b472d66260a2e744e0978f527b05e23fe626ab21e676660c4f38b93d26"
}
],
"compiled_resources": [
{
"path": "public/build/assets/administration-DSc3Ni9i.js",
"sha256": "cd6099c733f4053ba60b53bec9502f09f17817e8ea2cdf7adf889aa201c3afaf"
},
{
"path": "public/build/assets/ai-CvU_0EcO.js",
"sha256": "b1789150b49cf6eb3492becdba6b84b141ec22db275f1175a7c523372a5296e6"
},
{
"path": "public/build/assets/analysis-B7u9LnZR.js",
"sha256": "012e2963d2c6bec45965691dc6fe331f9941fe03d3534c269dacbdba9d044723"
},
{
"path": "public/build/assets/app-BcQMRTdl.js",
"sha256": "82cb1e160385771d2b4387caf053bc2293c1fbfe2a88f06813ddb5c258cf3e63"
},
{
"path": "public/build/assets/app-CwvCF_VN.css",
"sha256": "823e4af60ee2f6f5f2fec18410e0a3bdca43ea2061dc9389c6c62431251e0d6c"
},
{
"path": "public/build/assets/appearance-D5OxPqoW.js",
"sha256": "b7c257f76838b4a9395d31ae78f0a200ac691b6ef4c9e1506259b30abe502134"
},
{
"path": "public/build/assets/audit-CmnL1Mj6.js",
"sha256": "6ecb112a5968935d21ad1e8ec22a95b443bb3fe41c38c2161daacc61cf313206"
},
{
"path": "public/build/assets/blank-2jFZEe2q.js",
"sha256": "9e53a0a455027f070e3041db1f445e8b63702f83e264442d8df87e20048ccbe9"
},
{
"path": "public/build/assets/bootstrap-confirmation-CGMl6Ihp.js",
"sha256": "47f80a418f888688ad2bed82e06be724295ece56d8ed2d515fc29d4a0dbb7dbc"
},
{
"path": "public/build/assets/business-DPqt1i3i.js",
"sha256": "f65fb16aa423c61ee6fc0e2286ba173c06de14f37c60b9d7ce714b5646ea11c7"
},
{
"path": "public/build/assets/business-interest-DVLkOqeI.js",
"sha256": "50876de3872a07f721a152e0cc25ec60e5907f5fcefaf7c3ce37568f3bbfcbf2"
},
{
"path": "public/build/assets/business-marketplace-C9QTsuPs.js",
"sha256": "ec24f2561b1bb75c7635451787a996c94002999503a6611ddeee2dfaac966403"
},
{
"path": "public/build/assets/business-objects-CM9n463L.js",
"sha256": "64c7fa774a60d19ab1a77fd029f7861d97066487230f5e330e07f744649304c9"
},
{
"path": "public/build/assets/business-opportunity-DDCYElF1.js",
"sha256": "f8a172185ae9e06bfc46bd5fd58c1dfb242ed23e4eeec0f19eb991e88a7d6d9f"
},
{
"path": "public/build/assets/business-types-SGCXhH6X.js",
"sha256": "c792ab88a79f57c74d865c47e89e7f2b9aea190acb5c8c676071d4b0a802d58c"
},
{
"path": "public/build/assets/business-verifications--47tQ8hy.js",
"sha256": "6e797cc916ae6954525978bf5c893b92644e589c23aaa229211adecbe649b9bf"
},
{
"path": "public/build/assets/business-wizard-CZ6E3Li7.js",
"sha256": "79a29ab468ce66454f9420e2a4ed3cd6100845222e80e29fba9f262f1f9c4ad9"
},
{
"path": "public/build/assets/businesses-nIrmmHP5.js",
"sha256": "c0e6ccc2d7c11f1185dd22f3b97ccbe4f03d2fa994c6d6dd00763a5485486c36"
},
{
"path": "public/build/assets/button-DAU4R6e9.js",
"sha256": "79b615d0b88db74491fb4b312ae70515d43332e8730f8baed64c81eec510171d"
},
{
"path": "public/build/assets/case-CIScUI-F.js",
"sha256": "a9b9ab1265e334198e1f577e043510a1f9f8bc31c97fd0405041fbb23ca2e185"
},
{
"path": "public/build/assets/case-DS94AX1P.js",
"sha256": "d6e8a45b3f3c9b29c08b57c552476a73a36db9b8248f115713a99d6bfd0fd7ba"
},
{
"path": "public/build/assets/catalog-BkC5k0mU.js",
"sha256": "85425a8b8a078a4558a68a8c49f19a84696eec813e6b575e73a1f9ae0fc3ef9a"
},
{
"path": "public/build/assets/catalogue-BOxkBb-X.js",
"sha256": "e14edd33fce56921a06dac0cd100447fff73d2d51d193b62f4c68d8c6417765d"
},
{
"path": "public/build/assets/catalogue-C8Wvx4bU.js",
"sha256": "b8ea7c3da4ed2d3adc4dc89714cd5f58b21607f75862bba137a76d854c924fdd"
},
{
"path": "public/build/assets/catalogue-CNYCv9BM.js",
"sha256": "857f262c5a0e1147a071a3b948e80377e8aeae1ad1e227a9f138ac74ec89def0"
},
{
"path": "public/build/assets/check-PcBNn_NG.js",
"sha256": "402150a0f6387f9f098fea689a3282723ee063c84e57651f25d35729cdd85063"
},
{
"path": "public/build/assets/compiler-runtime-sKsOXjDo.js",
"sha256": "cc5f3db4bfb3bc5ae09b4594e5e137ad20037e8dfc3f0791781665706b860b6d"
},
{
"path": "public/build/assets/confirm-Culw9Q-x.js",
"sha256": "263fd058f1562c5729a4091d5d60f5365cc3957ad2cfcb5ffdec04a28f1858c4"
},
{
"path": "public/build/assets/confirm-password-BVaC7Q-R.js",
"sha256": "88484906b380b3e1e6e64509c2785d0e8b6139011c2c92e48b028a2440042aff"
},
{
"path": "public/build/assets/context-C8PTUcDC.js",
"sha256": "f4e93c87b4df13cf176bd42d734a49b5637e406d1d437d7feb5234a528b33f85"
},
{
"path": "public/build/assets/conversation-DqOsdxRj.js",
"sha256": "c8840ccf4c98271d20aa4d21736078a1ecd3ceea42e87a2887dbbe9abda4ea0e"
},
{
"path": "public/build/assets/convert-CoIaJ15W.js",
"sha256": "6601a90833d4ad9a28322ef41f4aed31fced33b972c627418e53128c721581fc"
},
{
"path": "public/build/assets/country-select-C3BLoPPG.js",
"sha256": "87822f75957659509b95011d1489f6bed2ff824c215fce862a7fd29186f5189f"
},
{
"path": "public/build/assets/createLucideIcon-oMeAlXbs.js",
"sha256": "9398e5f9d8be91b886b9f6283574d6eb89b8fa02a4c21866ab9e376c95b74b56"
},
{
"path": "public/build/assets/dashboard-BsLMnxJa.js",
"sha256": "9717b3a61274acb9428d2fb74f9ae33555ec9a9562c30e5ce0a2ff80afb792ab"
},
{
"path": "public/build/assets/dashboard-e3jX6X-g.js",
"sha256": "1a6455c6dea5c404239555181bd2cd52c7f3e9e6385570289254d232ad992bd5"
},
{
"path": "public/build/assets/desk-internal-operations-BfNLRXfX.js",
"sha256": "9cc974056470a9fac68590361a9d74371790bbad11d8142f8c1e7edbe3f8ab0d"
},
{
"path": "public/build/assets/detail-Bkn0-p5f.js",
"sha256": "064df7747cdd90f58ab472f4cff195ddb8c4b9e421ca8f5f9d70358aa0b9d5b9"
},
{
"path": "public/build/assets/detail-ClCaT5sP.js",
"sha256": "81bbf89bcf2993d79d7de018540ea5993190e0918f2d17b83529d59d5677a842"
},
{
"path": "public/build/assets/dialog-CrNJoSdo.js",
"sha256": "e699bda783e9e4277bf612564907d9fed49d39e2d8c0c169b559e176c4d095f9"
},
{
"path": "public/build/assets/display-value-DRR1EAAK.js",
"sha256": "202c77561454ec7c1ef9cb39faa4f1833ea066dbb83e17f0eb4440b314b189f6"
},
{
"path": "public/build/assets/dist-BRfsww6z.js",
"sha256": "1b5218b53553fd01fd50cb0ce2102864c5359d450d4d71f00806f812f1e1870a"
},
{
"path": "public/build/assets/dist-Ddn_hEUd.js",
"sha256": "ee0c56af5abd78d01704f2fb0f764ea0746908244078a8014393a672994235d6"
},
{
"path": "public/build/assets/dist-DDq_DSJX.js",
"sha256": "0ea9c4863c02cabf343ba678aa470b682ef3ae1588380bee5b0781d356e9ba46"
},
{
"path": "public/build/assets/document-CEwdMANI.js",
"sha256": "004dbe2df4dabeb1457d505137d0fee248c25eb38071d58c9c7f1c86b18e4798"
},
{
"path": "public/build/assets/editor-AWauBCmb.js",
"sha256": "f1c44ed72f9a9da2c5ccf9c1c0d3d07072c76c47e34bc0be64fe19bade72e538"
},
{
"path": "public/build/assets/editor-D-YwLEFc.js",
"sha256": "129430f49d6906fc88f9d892320ce4376869a6915069be708d7bd4ada45a52c7"
},
{
"path": "public/build/assets/editor-DdyV7OPN.js",
"sha256": "243c2d96019bbce2604c41e4ad1bfc161b338dbe760c58421e4157ecd7f22d72"
},
{
"path": "public/build/assets/education-CykRdq7s.js",
"sha256": "f329279dea9c34c05640711f3bd94b1e483b8701e01a8681961d7e08eb4677e2"
},
{
"path": "public/build/assets/financial-calculators-CsDOUJxx.js",
"sha256": "e76679a1914b5c4dc6c3e74b1b2de8d3d792fcc891dcc61d0fa27042232e2b9a"
},
{
"path": "public/build/assets/fonts-C9MNnjVw.css",
"sha256": "3846a9bb60bfad92960eadcccaf0b4e129d74b11d48791506c8d1a827a385cc8"
},
{
"path": "public/build/assets/forgot-password-B_RgM-Z1.js",
"sha256": "279965d2e69ac08385b4eef474cf0106a5035cc9ab876ec3d07d99c1e53857b8"
},
{
"path": "public/build/assets/form-D82ZGVOj.js",
"sha256": "fe18aabb0dbb1d49a7be681f42952a3956336ae139c76c271e6219bd6dea6ad4"
},
{
"path": "public/build/assets/guide-mndEuKFT.js",
"sha256": "fe519ab69363e83bb705b7dee5ab3fe17249eeb53687846b539668c435ccbd2b"
},
{
"path": "public/build/assets/history-BkWH9NK0.js",
"sha256": "e0ff270d9f5d26e878953dd4869cbdee1af9104fa573a78ed33beb6178ceba70"
},
{
"path": "public/build/assets/input-error-U1QKS0ED.js",
"sha256": "4acac92fa624552b14ac1a390e961f9e387d6eefeac384ad4e95bc73fdffa86e"
},
{
"path": "public/build/assets/install-CVNNM_IZ.js",
"sha256": "3b11a94d81adc0c5799c400928a834c631fbb6c9b6fc4e59103285660c602ef4"
},
{
"path": "public/build/assets/installation-B39QWLri.js",
"sha256": "caf04b0e38417bd6daa1677eae590814ccab8b0bea4f8e51286d19f0d6f11b7d"
},
{
"path": "public/build/assets/installation-CTy9PTGp.js",
"sha256": "c9211ab0db40d459e2a9d8b5eb806fd2bfdddb0e77c5ca218de8fcb432669881"
},
{
"path": "public/build/assets/instrument-sans-400-normal-D1W7dsQl.woff",
"sha256": "797bd3eaa70edbd4757650ab44dad75fbfbfdf18bacedb4b71022c04621d30ad"
},
{
"path": "public/build/assets/instrument-sans-400-normal-DRC__1Mx.woff2",
"sha256": "9a91efaa3599a6ef01b2f49e9ec670e3a2f39baeef09c73198f1052cf3bb0850"
},
{
"path": "public/build/assets/instrument-sans-500-normal-Dk9ku72i.woff2",
"sha256": "9d3547da16d950d12a677c772a3ff9b69846e60e7dcd1b5efd540993f7286532"
},
{
"path": "public/build/assets/instrument-sans-500-normal-Z6ESRlEs.woff",
"sha256": "bd6a8dc8b0dc0cced0c32d3eda93f0e0e82c58ddefea8b53b3307b0c48da3089"
},
{
"path": "public/build/assets/instrument-sans-600-normal-B7fBEWYG.woff2",
"sha256": "efb770916eda95a0e31d80cccde9651d4e8617010b21220e9f227c4820d675da"
},
{
"path": "public/build/assets/instrument-sans-600-normal-B9e8oLYv.woff",
"sha256": "9b4ce1f2b26be7cb087fd87d6f99a202136292ec820af75bd38ab9e53895cf28"
},
{
"path": "public/build/assets/interactive-investment-map-1DTFk8zz.css",
"sha256": "13748a8189dc8c690fc902a1682d30ba289721688f32df4f2459a36de8e383de"
},
{
"path": "public/build/assets/interactive-investment-map-DFT3VzR2.js",
"sha256": "66b806b1a605110e6c2b5bac8293e4ce6346a89d990f02b673161e63edab4dfc"
},
{
"path": "public/build/assets/interest-0ZsdJZZm.js",
"sha256": "f185137984f0bffa5146d9a50c384bc6575eb54c09536d5a1eb70971730dfa62"
},
{
"path": "public/build/assets/interests-B0Z0CmLf.js",
"sha256": "d24b42307cfe73bd5594b44f2c9812bb9aac4a6a7e5678505a3a42498c35c1fe"
},
{
"path": "public/build/assets/investment-map-panel-j-wQfGPo.js",
"sha256": "e7d2504281598a1f26db3e1da855a3f674c30fc63fb51b339c73d82a25f81362"
},
{
"path": "public/build/assets/investment-maturity-CydhhEfV.js",
"sha256": "c2cc75070cb664ab0b53466dde584dd5473f1b5fd992bf6a59ca8a01b7e19623"
},
{
"path": "public/build/assets/investment-territory-B6sG8qJ9.js",
"sha256": "948781f819fb93c760cca169a9fed9571c7f9a23bc1bd883f7427356c3140230"
},
{
"path": "public/build/assets/investor-path-CAHGk6qB.js",
"sha256": "d097b941ba9393ef82351cbd6c1b3e96d17cc3a7d605e721a2ef282557db8422"
},
{
"path": "public/build/assets/investor-wDLipbzX.js",
"sha256": "8b28b017594016c6f491d71c7b972b94e60a8743d0aee5f8309c787dd4e05fb7"
},
{
"path": "public/build/assets/investors-XzWQMblw.js",
"sha256": "d2f25d88fa8cbe8eae45e9a90a0865127fd763f54c9058ed71ed44703bb90a8e"
},
{
"path": "public/build/assets/jsx-runtime-BpzPEenQ.js",
"sha256": "60a64ced602d5e913f2a0328d2ec4a7b670c893614a26c47794317523d276398"
},
{
"path": "public/build/assets/label-D-C_NQs4.js",
"sha256": "6b4996b6f05276fd6edc8dd935f37f83a6c673cad5cf2f9dfa7cf4bdc92816ef"
},
{
"path": "public/build/assets/labels-DxqjesIG.js",
"sha256": "deace12e77e3f2e0515b1090cbc376cfeff29b59f57b1a2561b1145459c531b8"
},
{
"path": "public/build/assets/layers-2x-Bpkbi35X.png",
"sha256": "066daca850d8ffbef007af00b06eac0015728dee279c51f3cb6c716df7c42edf"
},
{
"path": "public/build/assets/layers-BWBAp2CZ.png",
"sha256": "1dbbe9d028e292f36fcba8f8b3a28d5e8932754fc2215b9ac69e4cdecf5107c6"
},
{
"path": "public/build/assets/lead-D2Tih-xB.js",
"sha256": "9e8fb1bc85b7586090cf2b104817f3d77ce77e9c5c022822421db75e5b7bd664"
},
{
"path": "public/build/assets/leads-C7hlhKpX.js",
"sha256": "191e61d4297343a495df3f2eb0adf85ec2679e2ecdfd139d5dd2c4994dae076f"
},
{
"path": "public/build/assets/leaflet-src-CUWrUTR2.js",
"sha256": "a26eda55b9706e8778766e4d32038202d20411081d7da16faaa39b977af36245"
},
{
"path": "public/build/assets/legacy-CX8Pcqkj.js",
"sha256": "977cb3622e6ab01bf0a83421e8ce7e998b98755e18cef18e83db6238b3e29f33"
},
{
"path": "public/build/assets/loader-circle-DS8Tf4er.js",
"sha256": "cd9fb22e9d7d12342d5e0941aac953ebb5184550cc8008b5c0f8f5ea6acd8ed2"
},
{
"path": "public/build/assets/login-D77Sm-ny.js",
"sha256": "7cf286646caefc40060ce6e25bf47d170f25a1de6f0cb214c3ee5ce8464b76e6"
},
{
"path": "public/build/assets/manage-s1znriBq.js",
"sha256": "44895bac66f3b272951511f933535bc3b8105a4f8cfaa936d316025fb540135f"
},
{
"path": "public/build/assets/management-access-Dl70YCx1.js",
"sha256": "1d50024d467e7f6fa4be11cca48534b0b697520cf894282b33ba33cc95db026d"
},
{
"path": "public/build/assets/management-CvdeRZYq.js",
"sha256": "0c193b26e40abae535aa6b51d1734bd930e4d2570dd0033cf0b41efc47aa16cd"
},
{
"path": "public/build/assets/marker-icon-hN30_KVU.png",
"sha256": "574c3a5cca85f4114085b6841596d62f00d7c892c7b03f28cbfa301deb1dc437"
},
{
"path": "public/build/assets/notifications-BzC3R4M-.js",
"sha256": "ffb415a7e93a04494af66470c308ef21d338769c51550733d667b54a49e0e6a5"
},
{
"path": "public/build/assets/operation-key-Dr4VtGxa.js",
"sha256": "416fed7a5197657971af7f378998557c9dba2f99e266e39149b727e598bea439"
},
{
"path": "public/build/assets/opportunities-C9lXK566.js",
"sha256": "c3bc51fd650209013dab119479dad266e7bd3fe5ae31a644617c82dbb6c291ea"
},
{
"path": "public/build/assets/opportunity-draft-CWWv64vh.js",
"sha256": "195b9c33290f764e48fb04642103a9bf23a36ca1afa7f4d79ffa26bcd9039aaa"
},
{
"path": "public/build/assets/opportunity-install-DUbq9a2C.js",
"sha256": "192fe77d67e590561ff9c8e3dc1c2e816c98ea20f3dac33e24591059bd67d3c0"
},
{
"path": "public/build/assets/opportunity-origin-0DDjVKi9.js",
"sha256": "445a6c1cb480aeb1712962b6b2fe68c37097ab9e85453c6d85c28db271dadee4"
},
{
"path": "public/build/assets/opportunity-resources-B1aKABTO.js",
"sha256": "630b7600dfded76137aaed5674eb402dc8a53324e475286e6c48d6f88fbf9554"
},
{
"path": "public/build/assets/panel-CjlfzneZ.js",
"sha256": "16f0b8aeff82509ccae5a7fbfaa6fdf969f16fa36e23e4fe880520178fb20656"
},
{
"path": "public/build/assets/partnership-source-links-VfrXk2FZ.js",
"sha256": "a4d6c8500f2417983312ae667b96f035df9654f37aa4a7bc86f0cc01fda0ddd8"
},
{
"path": "public/build/assets/passkey-verify-CTDJARa-.js",
"sha256": "d0d2856bd365d137c1bb96669dd98de571a218fd2afec6630c3f00982dcf53e7"
},
{
"path": "public/build/assets/password-CB_NxgQN.js",
"sha256": "4415e495723009fc084111bafd2b7714221a3712e5f1d2a4dfa0e698f6308c7a"
},
{
"path": "public/build/assets/password-input-ytrVyGCI.js",
"sha256": "370afc1ff0edbc35b7291f7afcae358ab51ad260d881625961d7bc0884ce465b"
},
{
"path": "public/build/assets/portal-api-tEuwFTsU.js",
"sha256": "190505d0a96d610ef2893cf06c63edab30f427593452bbc0dafc9d8f8a826c70"
},
{
"path": "public/build/assets/PortalInvestidor-DXjtFEO6.js",
"sha256": "f4410dfb8f7708ff49e1fa73bc24428e706574428adea68153abb3ae3c06bb85"
},
{
"path": "public/build/assets/portfolio-CYhinxCj.js",
"sha256": "1480210c14afa668a00fac3c95acbb1be19265b447fc1ca9f6d28e013168677f"
},
{
"path": "public/build/assets/print-EIzSB6Ku.js",
"sha256": "bad87486159deb855589aa92fc7032ea28de222693c2816f2ff54b1583ef6513"
},
{
"path": "public/build/assets/profile-BefZFs4T.js",
"sha256": "4c18c70bac14cdffeca59510925648d8e720b8db8c863cbde32568aa73eb36c2"
},
{
"path": "public/build/assets/profile-CtlF7eKv.js",
"sha256": "d79e2c72240df91fe08329d4be3e84a31af64f165c01ae13a204749af2c9b83a"
},
{
"path": "public/build/assets/profile-json-Bb5H6-rZ.js",
"sha256": "0c4720d8d5baabfcc199d66bc171b014152f3cf2ff40b542d38e86cc1e04a77a"
},
{
"path": "public/build/assets/project-dossier-BRpAqBvm.js",
"sha256": "9906a87fcb5b99bea2eca25e68dc49c149c7b250056a8ac0977d2c8b6cf4e732"
},
{
"path": "public/build/assets/react-CjVep8xp.js",
"sha256": "3378f8538b0d8c51e3051e5005dfaebb8fec48c35789a3ba63945fd724f48e6f"
},
{
"path": "public/build/assets/references-B5MS22w9.js",
"sha256": "fa55c761d620d3b128624f5bba834e1b9d827e5f476905b84e5e9f1c66a1456b"
},
{
"path": "public/build/assets/register-DCPZrD0a.js",
"sha256": "e6a1f602eda3cbb6b12adab01e8988491395791a89e1725a65848329358bfd67"
},
{
"path": "public/build/assets/relationship-repair-GOvWjM52.js",
"sha256": "85557cf553926fd7ffb1e8ea8989f7adffc6a989ef463a1ef932fb7bde35e55e"
},
{
"path": "public/build/assets/request-C3B6Yur9.js",
"sha256": "6b69666c41cc93cc859aa51b9eb05a8545570934e88f320755b6ca287575dd6d"
},
{
"path": "public/build/assets/request-DTkbzuAg.js",
"sha256": "bf047a247b5508bef2a0f3476a8f9dc46b7615c67f3fc2fe04db610aeb263dee"
},
{
"path": "public/build/assets/reset-password-Bc6EmnDS.js",
"sha256": "97451a15cff88124d6f19bc9e192cf2a553c1960482acba974586eec44b373ae"
},
{
"path": "public/build/assets/result-BUxzIVRu.js",
"sha256": "37a663041cac3e91c65b05f7cc3771398d6329884ad799f5a913e3b7cc657394"
},
{
"path": "public/build/assets/rolldown-runtime-Dd_uD5pT.js",
"sha256": "c5f0356f5d0918a3137e4e811fd18950efe8ac8f6bf84d1d4da7811c477a24d8"
},
{
"path": "public/build/assets/room-B9wM3cp1.js",
"sha256": "2a9fae4593529dd51a5ac76f5cc1e07ed1f5a6ea94e1b1635e3c69f73e1b0295"
},
{
"path": "public/build/assets/security-DYDm6VQ2.js",
"sha256": "201fd8eebc218810b77f3175a4da5a0c48cc4d4c5edcf02ce8b4a3c543dfbd95"
},
{
"path": "public/build/assets/services-D8vIP2CV.js",
"sha256": "e3e5ba322dbd99479d9f6e0edd8e615e932cf02ef6d399e68df02471713df06b"
},
{
"path": "public/build/assets/shared-BqWH8W8E.js",
"sha256": "db7e7d4ddbb26c2855603982b91d9f71fdcba18857ad89f1411035ef51766c88"
},
{
"path": "public/build/assets/shared-Bux3M99i.js",
"sha256": "8877ed79a10047d41b06dfe296788a9c1d5477c570cd79e3904bb7f98d645aab"
},
{
"path": "public/build/assets/shared-CANbkD3F.js",
"sha256": "ba4fe1a47bd69463053d0a83a22ce0b64641ecd0fc012d744549243793edbb12"
},
{
"path": "public/build/assets/shared-CKR8SVWL.js",
"sha256": "0469e5c4b7b00b15c60f2176908cf765f2e5ca679bd2d6ac81f1642ca248d495"
},
{
"path": "public/build/assets/show-ChiKlf2m.js",
"sha256": "de35d2a085b85ada8031eb162a7bd15c2d92bd38bec2a0891415bcff8a2c9ab5"
},
{
"path": "public/build/assets/show-DrfHy5n2.js",
"sha256": "9dd0d17d891848de9048a57b202477007515643b8b2ba6346f04eb9b167667f6"
},
{
"path": "public/build/assets/sources-DE9fmPGT.js",
"sha256": "e2caff103b2570df9b78efc63ec5cc4d4a93efde928fec06204fa3cde9980572"
},
{
"path": "public/build/assets/spinner-hD8hHC_m.js",
"sha256": "0091bbe0e4125cbe30ecd10ec9ff65cff9b7bd270125913d85b4449144aa91fd"
},
{
"path": "public/build/assets/structure-geography-DupeFK-Z.js",
"sha256": "f65d72b37acdd8379ff4654ef859ab8dcca5f1e6a2e2f51b60d91828039043ef"
},
{
"path": "public/build/assets/structures-D08yRP7d.js",
"sha256": "a52a0b664f6daf8fffe85ba7b2197711d30f71efbd7e320fa6020aa61dcb2705"
},
{
"path": "public/build/assets/submission-eASssihs.js",
"sha256": "b9c7cfcb712b56277254f83f8a6694b23d6c143a782be3ae664fa8cd91ef6e91"
},
{
"path": "public/build/assets/territorial-source-evidence-eKB4ZB36.js",
"sha256": "14048631c51933a0389cea37ae1909a02ea86d564a5a05452a48b40f055cd605"
},
{
"path": "public/build/assets/territory-associations-72yodrv5.js",
"sha256": "029ae7ee496193da460f3c1ed29a4ce5a4b4af00e0dde5a51e08a8ed7deb7141"
},
{
"path": "public/build/assets/territory-geometry-import-DCYDtoRH.js",
"sha256": "f5a56a8332acc2c8afc5870591c95990f4c8c1ddede00092474b1100414ed673"
},
{
"path": "public/build/assets/territory-geometry-preview-DVGcGZ40.js",
"sha256": "03bb3ad0572f1b2f6e9fc599df677c1e0cb6eaf821680d92eb5a21bc846e5364"
},
{
"path": "public/build/assets/text-link-BBvcP60s.js",
"sha256": "0e7b5234d766855dbcbd5a78fe3e8c54fa6ffa1ad6163009d7b312eafd19f307"
},
{
"path": "public/build/assets/two-factor-challenge-CsTuVOyS.js",
"sha256": "48d1a311ae8a985e9d07cb962db760357f6255340c81bdb7f028307aff590e13"
},
{
"path": "public/build/assets/types-BoD_IJFv.js",
"sha256": "75c4a127c1aa0b90fe0b4f956c7e3ae9c67bc0f862c89cd0a594709027b983da"
},
{
"path": "public/build/assets/types-Cxp_Nskt.js",
"sha256": "cf4ae8cb539c697ca751dcf96e1db3af9eb1ff00807c088268dd859e7c4a5dab"
},
{
"path": "public/build/assets/use-two-factor-auth-kpel6Zcb.js",
"sha256": "771c519273e76ec8a5bea59c35605f01e5a55b353443c742c8f22d7bd9691504"
},
{
"path": "public/build/assets/utils-CCDJ05Ll.js",
"sha256": "ef54f43266d404b8ffe4e5487b346060eaf81d819317f523c966aa3e7490deb8"
},
{
"path": "public/build/assets/value-network-DG6bWNFJ.js",
"sha256": "54db54c5f72925dd5f9dda2b2d021996fb1241371d2b2ac76c4bc59fa569854d"
},
{
"path": "public/build/assets/value-text-BztaYdGl.js",
"sha256": "873576810a6ba4eb8c9c116f53cdc649b21ab2995aa2adadd4c85130b04bacd2"
},
{
"path": "public/build/assets/verification-BOcn3HIw.js",
"sha256": "10addac3d8f1865e855943e0685e88a268ffd8013ff7a7d51fb89d755b12074e"
},
{
"path": "public/build/assets/verify-email-BnXvK---.js",
"sha256": "d3380fbed6f643e6fb0a79adda612e8db70863003574d0e2e27467d770ad4e44"
},
{
"path": "public/build/assets/wayfinder-Dp7PqxvV.js",
"sha256": "3d4c90228fda731e37f541f3087fdf5387d9d59433e35b267b64a97196f70781"
},
{
"path": "public/build/assets/welcome-BuuOE117.js",
"sha256": "295476286a388019d99f71ea35fb01b9685d46cbe329826c3b6d22a34cde1ade"
},
{
"path": "public/build/assets/workspace-4_R1CLYI.js",
"sha256": "5d4c742569d9ad33ac7bac01c6433c646f79f939d2f57b7878860c0d25dcee22"
},
{
"path": "public/build/assets/workspace-CRrGlSsm.js",
"sha256": "a919e4cff888819d7d5ee5612300c4b659bf1018d80ece5cda787bb74f3c3cc0"
},
{
"path": "public/build/assets/workspace-Dt8tyM3p.js",
"sha256": "6eadc1eefa45223fef5c88607e171599ee1f4e40768ac790e2939f1cd297fe0d"
},
{
"path": "public/build/assets/zone-attachments-Di9qTwNr.js",
"sha256": "fdb3b3830e650ff6199c50c3a2ca13e0a55e7fcdc524028362d442f949bb5419"
},
{
"path": "public/build/assets/zone-CyQQYSHS.js",
"sha256": "0a9b945d05a431301653c875106cc47ac8baf6cbf5272786bbf4f54e8f4cc3fe"
},
{
"path": "public/build/assets/zone-map-CPlwVMT3.js",
"sha256": "32945face05715140d69b469d53fcd8774f191a4c04dc4296ec76eab83272db2"
},
{
"path": "public/build/assets/zone-relations-C17bCQOu.js",
"sha256": "db90b4a7ba0f99fdae0d8fdc43d13af0bad5acc84f2e8010a3f651d1f4c6cf77"
},
{
"path": "public/build/assets/zones-DLdgiWOD.js",
"sha256": "8f9d3e88204abbd952c5a98462484b36e79d47ae8f401a0daf12f46377fb2c59"
},
{
"path": "public/build/fonts-manifest.json",
"sha256": "66edf17c93351fe01158be7414a441a762f106417c74351881876b405b8b10ca"
},
{
"path": "public/build/manifest.json",
"sha256": "e21d388f2e71bcd762c476d3e0bd1ae7c608ca57cafc2381c2a8888ce5d4efbf"
}
],
"target": "https://portal-investidor.test; investemoz:5432",
"schema_changes": 0,
"migrations": [],
"new_active_accounts_organizations_or_grants": 0,
"service_changes": 0,
"active_changes_applied": false,
"ready_for_owner_decision": true,
"activation_authorized": false,
"procedure_sha256": "e8734f53b03d0cd6f048bc64667c13e40794117458090b8ac71c5fae55f1234d",
"remaining_operational_proof": "First legitimate process/document processing in the target; distinct from QA proofs",
"manual_acceptance_scope": [
"Login/MFA com a entrada 2FAS correspondente à conta Promotor",
"Cadastro e seleção do contacto pelo formulário existente em QA",
"Guardar a seleção no rascunho",
"Logout, nova sessão e recuperação conforme o roteiro indicado"
],
"limitations": [
"Contact job title from the normative specification is not a column of the current master; full normative contract remains partial",
"Existing variant exclusions, individual sharing and opportunity restoration remain disabled",
"Four modular categories, integrated journey 190000, legacy, offers and SLA are separate"
]
}
@@ -0,0 +1,14 @@
{
"delivery_revision": "2e2f16c83483",
"code_revision": "a02ef2300d6c",
"source_files": 9,
"compiled_resources": 159,
"package_sha256": "13ddf150f0f7ab03de83437064bf32f34a382727880e9c7470faf87a9d035819",
"manifest_sha256": "1da64a6def3d1ffe814e0fea8ac7b0f654320715032bfe7d89dabf750988cd64",
"backup_verified_at": "2026-10-12T11:10:30+00:00",
"backup_clone": "internal_designation_target_20261012_110953_test",
"ready_for_owner_decision": true,
"activation_authorized": false,
"active_changes": 0,
"directory": "C:\\laragon\\www\\portal-investidor\\outputs\\investmoz-staff-preparation-20261012\\abertura-workflow-2e2f16c83483"
}
@@ -0,0 +1,8 @@
{
"result": "passed",
"delivery": "2e2f16c83483",
"code": "a02ef2300d6c",
"all_payload_and_evidence_hashes_verified": true,
"active_changes": 0,
"activation_authorized": false
}
@@ -0,0 +1,14 @@
{
"delivery_revision": "2e2f16c83483",
"code_revision": "a02ef2300d6c",
"source_files": 9,
"compiled_resources": 159,
"package_sha256": "13ddf150f0f7ab03de83437064bf32f34a382727880e9c7470faf87a9d035819",
"manifest_sha256": "1da64a6def3d1ffe814e0fea8ac7b0f654320715032bfe7d89dabf750988cd64",
"backup_verified_at": "2026-10-12T11:10:30+00:00",
"backup_clone": "internal_designation_target_20261012_110953_test",
"ready_for_owner_decision": true,
"activation_authorized": false,
"active_changes": 0,
"directory": "C:\\laragon\\www\\portal-investidor\\outputs\\investmoz-staff-preparation-20261012\\abertura-workflow-2e2f16c83483"
}
@@ -0,0 +1,30 @@
{
"result": "setup_pages_accessible",
"QA_only": false,
"routes": [
{
"person": "aurora",
"status": 200,
"component": "auth/reset-password",
"password_setup_page": true,
"TLS_bypass": false
},
{
"person": "palmira",
"status": 200,
"component": "auth/reset-password",
"password_setup_page": true,
"TLS_bypass": false
},
{
"person": "mario",
"status": 200,
"component": "auth/reset-password",
"password_setup_page": true,
"TLS_bypass": false
}
],
"credentials_printed": false,
"passwords_changed": 0,
"emails_sent": 0
}
@@ -0,0 +1,105 @@
{
"at": "2026-10-12T11:16:15+00:00",
"read_only": true,
"target": "investemoz:5432",
"request": {
"id": "5f97b315-c930-4aa1-827f-761c24f8d8ed",
"kind": "bootstrap",
"requested_by": 13,
"subject_user_id": 2,
"approved_by": 2,
"expires_at": "2026-10-11 18:32:30+00",
"consumed_at": "2026-10-11 18:19:06+00",
"created_at": "2026-10-11 18:17:30+00",
"updated_at": "2026-10-11 18:19:06+00"
},
"superuser_pair": [
{
"id": 1,
"first_user_id": 13,
"second_user_id": 2,
"approved_by": 2,
"version": 1,
"created_at": "2026-10-11 18:19:06+00",
"updated_at": "2026-10-11 18:19:06+00"
}
],
"initialization_audit": [
{
"action": "superuser_pair_initialized",
"actor_user_id": 2,
"occurred_at": "2026-10-11 18:19:04.101684+00"
}
],
"organizations": [
{
"id": "9b28d62b-ae68-438d-bb32-36d4fca026a6",
"name": "Tempo Lda",
"external_id": "400993114"
}
],
"staff_assignments": [
{
"id": "b9452ad6-a7f0-4430-837e-be2f1b5b789d",
"user_id": 14,
"role": "promoter",
"organization_id": "9b28d62b-ae68-438d-bb32-36d4fca026a6",
"opportunity_types": "[\"investment_project\", \"real_estate\", \"land_rights\", \"business_sale\", \"business_partnership\", \"franchise\"]",
"responsibilities": "[]",
"source": "internal-portal-designation",
"starts_at": "2026-10-12 08:42:06+00",
"expires_at": null,
"revoked_at": null
},
{
"id": "8141feda-a8d7-4199-9f1d-308470228066",
"user_id": 15,
"role": "validator",
"organization_id": "9b28d62b-ae68-438d-bb32-36d4fca026a6",
"opportunity_types": "[\"investment_project\", \"real_estate\", \"land_rights\", \"business_sale\", \"business_partnership\", \"franchise\", \"concession\", \"financing\", \"supply\", \"other\"]",
"responsibilities": "[\"validation_coordinator\", \"technical_reviewer\", \"legal_reviewer\", \"appeal_reviewer\"]",
"source": "independent-administration",
"starts_at": "2026-10-12 08:43:56+00",
"expires_at": "2028-01-12 10:42:00+00",
"revoked_at": null
},
{
"id": "33a38bb4-3b17-46e1-8586-33c77ccb9b93",
"user_id": 15,
"role": "validator",
"organization_id": "9b28d62b-ae68-438d-bb32-36d4fca026a6",
"opportunity_types": "[\"investment_project\", \"real_estate\", \"land_rights\", \"business_sale\", \"business_partnership\", \"franchise\", \"concession\", \"financing\", \"supply\", \"other\"]",
"responsibilities": "[\"validation_coordinator\", \"technical_reviewer\", \"legal_reviewer\", \"appeal_reviewer\"]",
"source": "independent-administration",
"starts_at": "2026-10-12 08:45:14+00",
"expires_at": "2028-01-12 10:42:00+00",
"revoked_at": null
},
{
"id": "49a83595-4469-44c6-94f2-08bfc52e5270",
"user_id": 15,
"role": "validator",
"organization_id": null,
"opportunity_types": "[\"investment_project\", \"real_estate\", \"land_rights\", \"business_sale\", \"business_partnership\", \"franchise\", \"concession\", \"financing\", \"supply\", \"other\"]",
"responsibilities": "[\"validation_coordinator\", \"technical_reviewer\", \"legal_reviewer\", \"appeal_reviewer\"]",
"source": "independent-administration",
"starts_at": "2026-10-12 08:50:11+00",
"expires_at": "2028-01-12 10:49:00+00",
"revoked_at": null
},
{
"id": "7eb37201-12fd-426d-a8e1-c29abff626da",
"user_id": 16,
"role": "publisher",
"organization_id": null,
"opportunity_types": "[\"investment_project\", \"real_estate\", \"land_rights\", \"business_sale\", \"business_partnership\", \"franchise\"]",
"responsibilities": "[]",
"source": "internal-portal-designation",
"starts_at": "2026-10-12 09:03:14+00",
"expires_at": null,
"revoked_at": null
}
],
"workflow_enabled": false,
"COUNTRY02": true
}
@@ -0,0 +1 @@
{"autoload_authoritative":false,"app_psr4_points_to_active_app":true,"database_bootstrapped":false,"active_writes":0}
@@ -0,0 +1,48 @@
<?php
ini_set('zend.exception_ignore_args', '1');
try {
$portal = dirname(__DIR__, 2);
$plan = json_decode(file_get_contents($portal.'/storage/app/private/investmoz-v2/portal-audit/internal-designation-plan.json'), true, 512, JSON_THROW_ON_ERROR);
$qa = $plan['source'];
if (!str_contains($qa, 'onboarding-qa-internal-20261011_191450')) throw new RuntimeException('QA source refused');
require $qa.'/qa-autoload.php';
$app = require $qa.'/bootstrap/app.php';
(new Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables)->bootstrap($app);
(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app);
$c = config('database.connections.'.config('database.default'));
if ($c['driver'] !== 'pgsql' || (int)$c['port'] !== 55441 || $c['database'] !== 'onboarding_internal_20261011_191450_test' || !empty($c['url']) || !in_array($c['host'], ['127.0.0.1','localhost'], true)) throw new RuntimeException('QA target refused');
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
if ((int)Illuminate\Support\Facades\DB::selectOne('SELECT inet_server_port() AS port')->port !== 55441) throw new RuntimeException('Actual server refused');
$file = $qa.'/storage/app/private/c130-http-fixture-local.json';
$mode = $argv[1] ?? 'prepare';
if ($mode === 'prepare') {
if (is_file($file)) {
$fixture = json_decode(file_get_contents($file), true, 512, JSON_THROW_ON_ERROR);
$actor = App\Models\User::findOrFail($fixture['id']);
if ($actor->email !== 'c130-governance-probe@example.invalid' || !Illuminate\Support\Facades\Hash::check($fixture['password'], $actor->password)) throw new RuntimeException('Fixture mismatch');
} else {
$password = 'QA-'.bin2hex(random_bytes(24));
$actor = App\Models\User::factory()->create(['name' => 'Synthetic C130 HTTP governance probe QA', 'email' => 'c130-governance-probe@example.invalid', 'password' => $password]);
app(Laravel\Fortify\Actions\EnableTwoFactorAuthentication::class)($actor);
$actor->refresh();
$secret = Laravel\Fortify\Fortify::currentEncrypter()->decrypt($actor->two_factor_secret);
app(Laravel\Fortify\Actions\ConfirmTwoFactorAuthentication::class)($actor, app(PragmaRX\Google2FA\Google2FA::class)->getCurrentOtp($secret));
$fixture = ['id' => $actor->id, 'email' => $actor->email, 'password' => $password];
file_put_contents($file, json_encode($fixture, JSON_THROW_ON_ERROR));
unset($secret,$password);
}
$actor->forceFill(['portal_access_revision' => 2])->save();
echo json_encode(['prepared' => true, 'synthetic_account_id' => $actor->id, 'target' => $c['database'].':55441', 'active_writes' => 0, 'real_user_sessions_changed' => 0]);
} elseif (in_array($mode, ['otp', 'advance-revision'], true)) {
$fixture = json_decode(file_get_contents($file), true, 512, JSON_THROW_ON_ERROR);
$actor = App\Models\User::findOrFail($fixture['id']);
if ($actor->email !== 'c130-governance-probe@example.invalid') throw new RuntimeException('Fixture identity mismatch');
if ($mode === 'otp') {
// Consumed by the local test process in memory; never printed in evidence.
echo app(PragmaRX\Google2FA\Google2FA::class)->getCurrentOtp(Laravel\Fortify\Fortify::currentEncrypter()->decrypt($actor->two_factor_secret));
} else {
$actor->increment('portal_access_revision');
echo json_encode(['synthetic_revision_advanced' => true, 'active_writes' => 0]);
}
} else throw new RuntimeException('Unsupported fixture mode');
} catch (Throwable $e) { echo json_encode(['result' => 'stopped', 'type' => $e::class, 'line' => $e->getLine()]); exit(1); }
@@ -0,0 +1,19 @@
{
"QA_only": true,
"active_writes": 0,
"server": "http://127.0.0.1:18119",
"workflow_on": false,
"administration_on": true,
"real_user_sessions_changed": 0,
"browser_demonstration": false,
"criteria": {
"login_mfa_administration_only": true,
"page_refresh_authenticated": true,
"workflow_remains_disabled": true,
"stale_revision_rejected": true,
"new_login_binds_current_revision": true,
"logout_protects_profile": true
},
"result": "passed",
"secrets_recorded": false
}
@@ -0,0 +1,23 @@
{
"QA_only": true,
"active_writes": 0,
"browser_demonstration": false,
"server": "http://127.0.0.1:18118",
"criteria": {
"contact_repetition_without_duplicates": true,
"selection_saved_to_correct_draft": true,
"recovered_in_new_session": true,
"validator_cannot_register_contact": 403
},
"authentication_status": {
"promoter_password": 200,
"promoter_mfa": 204,
"validator_password": 200,
"validator_mfa": 204
},
"result": "passed",
"record_id": 7,
"contact_id": "92c4dff8-a796-49ec-a3aa-a3182682f394",
"secrets_recorded": false,
"notifications_sent": 0
}
@@ -0,0 +1,37 @@
{
"QA_only": true,
"active_writes": 0,
"browser_demonstration": false,
"criteria": {
"stale_opportunity": 409,
"invalid_phone": 422,
"master_not_overwritten": 422,
"validator_cannot_create_contact": 403,
"unrelated_contact_not_associated": 422,
"foreign_investor_rejected": 403
},
"result": "passed",
"at": "2026-10-12T09:49:07+00:00",
"target": "onboarding_internal_20261011_191450_test:55441",
"record_id": 7,
"policy_fixture_not_real_login": true,
"created_recovered_repeated": true,
"no_fabricated_interest_or_lead": true,
"before": {
"contacts": 1,
"investors": 1,
"links": 1,
"leads": 0,
"interests": 0,
"jobs": 0
},
"after": {
"contacts": 2,
"investors": 1,
"links": 2,
"leads": 0,
"interests": 0,
"jobs": 0
},
"rolled_back": true
}
@@ -0,0 +1,730 @@
{
"base_revision": "2876cdfa900a",
"files": [
{
"path": "app/Services/OpportunityContacts.php",
"before_sha256": null,
"after_sha256": "e6bd6d786cb8b0ecfcb1e4bbe6778e2bf1cf5460650db2fd9f0e443e096e7827"
},
{
"path": "app/Services/OpportunityCanonicalContract.php",
"before_sha256": "64128271cbb63aaf81ccfc79478788a25044c9f46567d5d2b571395a1d8d707f",
"after_sha256": "ca68669ad413534d8fa340ebeae6245b802a14568d4d33b050fa17b37dbdeb53"
},
{
"path": "app/Services/PortalProfileAccess.php",
"before_sha256": "6bc8db1b9c4a900c8446262b8f2ce756001fcb3bf06b8d7ddce5442a5cf0bbde",
"after_sha256": "9140ac0eb9f55d22bda1d97a5d97b263f7c3120384f28684dae61950ab51d1c3"
},
{
"path": "app/Providers/AppServiceProvider.php",
"before_sha256": "e66f6d88d2da9e039b783f0a03603c22e140de2c09379b380277f5e2ee0e0f01",
"after_sha256": "78b436ad0a20df484d01a0f994f3fb46fe452a4181dda4146052424d14d182cf"
},
{
"path": "app/Http/Controllers/PortalProfileController.php",
"before_sha256": "94f02be39da0d24e54b76afbb780868449987b7dddb924904a5628a991cbd2b0",
"after_sha256": "cb1ecd7975fbfc5aebcf81c7d9956de7eaebc8ddf6034d103cc7c226de7881e0"
},
{
"path": "routes/web.php",
"before_sha256": "350eae3d66d747d5f29d17a64e5859994e2a1c63916a50896414027cabbde632",
"after_sha256": "b5710eeb6432c5643cc91a23ee93a2013d813504336897ce10811d567cb89c9f"
},
{
"path": "resources/js/components/opportunity-contact-form.tsx",
"before_sha256": null,
"after_sha256": "a4029bef84283c70973d709e9fe6cbd60a564641e806eba640b38b8e4b733910"
},
{
"path": "resources/js/components/opportunity-canonical-fields.tsx",
"before_sha256": "d915c02e7c01499018bb090e1e71bdd376e15c9c36ed32830adbdf627ad3ac05",
"after_sha256": "421641f8d71477d94604d9ea641112405b4bcb42372b42c44c25eaee506e900f"
},
{
"path": "resources/js/pages/management/opportunity-draft.tsx",
"before_sha256": "f23be93c0d343ca7cb22655d0e7386b4de0b77f8c820ebf339429a9408d837ed",
"after_sha256": "057614b472d66260a2e744e0978f527b05e23fe626ab21e676660c4f38b93d26"
}
],
"build": [
{
"path": "public/build/assets/administration-DSc3Ni9i.js",
"sha256": "cd6099c733f4053ba60b53bec9502f09f17817e8ea2cdf7adf889aa201c3afaf"
},
{
"path": "public/build/assets/ai-CvU_0EcO.js",
"sha256": "b1789150b49cf6eb3492becdba6b84b141ec22db275f1175a7c523372a5296e6"
},
{
"path": "public/build/assets/analysis-B7u9LnZR.js",
"sha256": "012e2963d2c6bec45965691dc6fe331f9941fe03d3534c269dacbdba9d044723"
},
{
"path": "public/build/assets/app-BcQMRTdl.js",
"sha256": "82cb1e160385771d2b4387caf053bc2293c1fbfe2a88f06813ddb5c258cf3e63"
},
{
"path": "public/build/assets/app-CwvCF_VN.css",
"sha256": "823e4af60ee2f6f5f2fec18410e0a3bdca43ea2061dc9389c6c62431251e0d6c"
},
{
"path": "public/build/assets/appearance-D5OxPqoW.js",
"sha256": "b7c257f76838b4a9395d31ae78f0a200ac691b6ef4c9e1506259b30abe502134"
},
{
"path": "public/build/assets/audit-CmnL1Mj6.js",
"sha256": "6ecb112a5968935d21ad1e8ec22a95b443bb3fe41c38c2161daacc61cf313206"
},
{
"path": "public/build/assets/blank-2jFZEe2q.js",
"sha256": "9e53a0a455027f070e3041db1f445e8b63702f83e264442d8df87e20048ccbe9"
},
{
"path": "public/build/assets/bootstrap-confirmation-CGMl6Ihp.js",
"sha256": "47f80a418f888688ad2bed82e06be724295ece56d8ed2d515fc29d4a0dbb7dbc"
},
{
"path": "public/build/assets/business-DPqt1i3i.js",
"sha256": "f65fb16aa423c61ee6fc0e2286ba173c06de14f37c60b9d7ce714b5646ea11c7"
},
{
"path": "public/build/assets/business-interest-DVLkOqeI.js",
"sha256": "50876de3872a07f721a152e0cc25ec60e5907f5fcefaf7c3ce37568f3bbfcbf2"
},
{
"path": "public/build/assets/business-marketplace-C9QTsuPs.js",
"sha256": "ec24f2561b1bb75c7635451787a996c94002999503a6611ddeee2dfaac966403"
},
{
"path": "public/build/assets/business-objects-CM9n463L.js",
"sha256": "64c7fa774a60d19ab1a77fd029f7861d97066487230f5e330e07f744649304c9"
},
{
"path": "public/build/assets/business-opportunity-DDCYElF1.js",
"sha256": "f8a172185ae9e06bfc46bd5fd58c1dfb242ed23e4eeec0f19eb991e88a7d6d9f"
},
{
"path": "public/build/assets/business-types-SGCXhH6X.js",
"sha256": "c792ab88a79f57c74d865c47e89e7f2b9aea190acb5c8c676071d4b0a802d58c"
},
{
"path": "public/build/assets/business-verifications--47tQ8hy.js",
"sha256": "6e797cc916ae6954525978bf5c893b92644e589c23aaa229211adecbe649b9bf"
},
{
"path": "public/build/assets/business-wizard-CZ6E3Li7.js",
"sha256": "79a29ab468ce66454f9420e2a4ed3cd6100845222e80e29fba9f262f1f9c4ad9"
},
{
"path": "public/build/assets/businesses-nIrmmHP5.js",
"sha256": "c0e6ccc2d7c11f1185dd22f3b97ccbe4f03d2fa994c6d6dd00763a5485486c36"
},
{
"path": "public/build/assets/button-DAU4R6e9.js",
"sha256": "79b615d0b88db74491fb4b312ae70515d43332e8730f8baed64c81eec510171d"
},
{
"path": "public/build/assets/case-CIScUI-F.js",
"sha256": "a9b9ab1265e334198e1f577e043510a1f9f8bc31c97fd0405041fbb23ca2e185"
},
{
"path": "public/build/assets/case-DS94AX1P.js",
"sha256": "d6e8a45b3f3c9b29c08b57c552476a73a36db9b8248f115713a99d6bfd0fd7ba"
},
{
"path": "public/build/assets/catalog-BkC5k0mU.js",
"sha256": "85425a8b8a078a4558a68a8c49f19a84696eec813e6b575e73a1f9ae0fc3ef9a"
},
{
"path": "public/build/assets/catalogue-BOxkBb-X.js",
"sha256": "e14edd33fce56921a06dac0cd100447fff73d2d51d193b62f4c68d8c6417765d"
},
{
"path": "public/build/assets/catalogue-C8Wvx4bU.js",
"sha256": "b8ea7c3da4ed2d3adc4dc89714cd5f58b21607f75862bba137a76d854c924fdd"
},
{
"path": "public/build/assets/catalogue-CNYCv9BM.js",
"sha256": "857f262c5a0e1147a071a3b948e80377e8aeae1ad1e227a9f138ac74ec89def0"
},
{
"path": "public/build/assets/check-PcBNn_NG.js",
"sha256": "402150a0f6387f9f098fea689a3282723ee063c84e57651f25d35729cdd85063"
},
{
"path": "public/build/assets/compiler-runtime-sKsOXjDo.js",
"sha256": "cc5f3db4bfb3bc5ae09b4594e5e137ad20037e8dfc3f0791781665706b860b6d"
},
{
"path": "public/build/assets/confirm-Culw9Q-x.js",
"sha256": "263fd058f1562c5729a4091d5d60f5365cc3957ad2cfcb5ffdec04a28f1858c4"
},
{
"path": "public/build/assets/confirm-password-BVaC7Q-R.js",
"sha256": "88484906b380b3e1e6e64509c2785d0e8b6139011c2c92e48b028a2440042aff"
},
{
"path": "public/build/assets/context-C8PTUcDC.js",
"sha256": "f4e93c87b4df13cf176bd42d734a49b5637e406d1d437d7feb5234a528b33f85"
},
{
"path": "public/build/assets/conversation-DqOsdxRj.js",
"sha256": "c8840ccf4c98271d20aa4d21736078a1ecd3ceea42e87a2887dbbe9abda4ea0e"
},
{
"path": "public/build/assets/convert-CoIaJ15W.js",
"sha256": "6601a90833d4ad9a28322ef41f4aed31fced33b972c627418e53128c721581fc"
},
{
"path": "public/build/assets/country-select-C3BLoPPG.js",
"sha256": "87822f75957659509b95011d1489f6bed2ff824c215fce862a7fd29186f5189f"
},
{
"path": "public/build/assets/createLucideIcon-oMeAlXbs.js",
"sha256": "9398e5f9d8be91b886b9f6283574d6eb89b8fa02a4c21866ab9e376c95b74b56"
},
{
"path": "public/build/assets/dashboard-BsLMnxJa.js",
"sha256": "9717b3a61274acb9428d2fb74f9ae33555ec9a9562c30e5ce0a2ff80afb792ab"
},
{
"path": "public/build/assets/dashboard-e3jX6X-g.js",
"sha256": "1a6455c6dea5c404239555181bd2cd52c7f3e9e6385570289254d232ad992bd5"
},
{
"path": "public/build/assets/desk-internal-operations-BfNLRXfX.js",
"sha256": "9cc974056470a9fac68590361a9d74371790bbad11d8142f8c1e7edbe3f8ab0d"
},
{
"path": "public/build/assets/detail-Bkn0-p5f.js",
"sha256": "064df7747cdd90f58ab472f4cff195ddb8c4b9e421ca8f5f9d70358aa0b9d5b9"
},
{
"path": "public/build/assets/detail-ClCaT5sP.js",
"sha256": "81bbf89bcf2993d79d7de018540ea5993190e0918f2d17b83529d59d5677a842"
},
{
"path": "public/build/assets/dialog-CrNJoSdo.js",
"sha256": "e699bda783e9e4277bf612564907d9fed49d39e2d8c0c169b559e176c4d095f9"
},
{
"path": "public/build/assets/display-value-DRR1EAAK.js",
"sha256": "202c77561454ec7c1ef9cb39faa4f1833ea066dbb83e17f0eb4440b314b189f6"
},
{
"path": "public/build/assets/dist-BRfsww6z.js",
"sha256": "1b5218b53553fd01fd50cb0ce2102864c5359d450d4d71f00806f812f1e1870a"
},
{
"path": "public/build/assets/dist-Ddn_hEUd.js",
"sha256": "ee0c56af5abd78d01704f2fb0f764ea0746908244078a8014393a672994235d6"
},
{
"path": "public/build/assets/dist-DDq_DSJX.js",
"sha256": "0ea9c4863c02cabf343ba678aa470b682ef3ae1588380bee5b0781d356e9ba46"
},
{
"path": "public/build/assets/document-CEwdMANI.js",
"sha256": "004dbe2df4dabeb1457d505137d0fee248c25eb38071d58c9c7f1c86b18e4798"
},
{
"path": "public/build/assets/editor-AWauBCmb.js",
"sha256": "f1c44ed72f9a9da2c5ccf9c1c0d3d07072c76c47e34bc0be64fe19bade72e538"
},
{
"path": "public/build/assets/editor-D-YwLEFc.js",
"sha256": "129430f49d6906fc88f9d892320ce4376869a6915069be708d7bd4ada45a52c7"
},
{
"path": "public/build/assets/editor-DdyV7OPN.js",
"sha256": "243c2d96019bbce2604c41e4ad1bfc161b338dbe760c58421e4157ecd7f22d72"
},
{
"path": "public/build/assets/education-CykRdq7s.js",
"sha256": "f329279dea9c34c05640711f3bd94b1e483b8701e01a8681961d7e08eb4677e2"
},
{
"path": "public/build/assets/financial-calculators-CsDOUJxx.js",
"sha256": "e76679a1914b5c4dc6c3e74b1b2de8d3d792fcc891dcc61d0fa27042232e2b9a"
},
{
"path": "public/build/assets/fonts-C9MNnjVw.css",
"sha256": "3846a9bb60bfad92960eadcccaf0b4e129d74b11d48791506c8d1a827a385cc8"
},
{
"path": "public/build/assets/forgot-password-B_RgM-Z1.js",
"sha256": "279965d2e69ac08385b4eef474cf0106a5035cc9ab876ec3d07d99c1e53857b8"
},
{
"path": "public/build/assets/form-D82ZGVOj.js",
"sha256": "fe18aabb0dbb1d49a7be681f42952a3956336ae139c76c271e6219bd6dea6ad4"
},
{
"path": "public/build/assets/guide-mndEuKFT.js",
"sha256": "fe519ab69363e83bb705b7dee5ab3fe17249eeb53687846b539668c435ccbd2b"
},
{
"path": "public/build/assets/history-BkWH9NK0.js",
"sha256": "e0ff270d9f5d26e878953dd4869cbdee1af9104fa573a78ed33beb6178ceba70"
},
{
"path": "public/build/assets/input-error-U1QKS0ED.js",
"sha256": "4acac92fa624552b14ac1a390e961f9e387d6eefeac384ad4e95bc73fdffa86e"
},
{
"path": "public/build/assets/install-CVNNM_IZ.js",
"sha256": "3b11a94d81adc0c5799c400928a834c631fbb6c9b6fc4e59103285660c602ef4"
},
{
"path": "public/build/assets/installation-B39QWLri.js",
"sha256": "caf04b0e38417bd6daa1677eae590814ccab8b0bea4f8e51286d19f0d6f11b7d"
},
{
"path": "public/build/assets/installation-CTy9PTGp.js",
"sha256": "c9211ab0db40d459e2a9d8b5eb806fd2bfdddb0e77c5ca218de8fcb432669881"
},
{
"path": "public/build/assets/instrument-sans-400-normal-D1W7dsQl.woff",
"sha256": "797bd3eaa70edbd4757650ab44dad75fbfbfdf18bacedb4b71022c04621d30ad"
},
{
"path": "public/build/assets/instrument-sans-400-normal-DRC__1Mx.woff2",
"sha256": "9a91efaa3599a6ef01b2f49e9ec670e3a2f39baeef09c73198f1052cf3bb0850"
},
{
"path": "public/build/assets/instrument-sans-500-normal-Dk9ku72i.woff2",
"sha256": "9d3547da16d950d12a677c772a3ff9b69846e60e7dcd1b5efd540993f7286532"
},
{
"path": "public/build/assets/instrument-sans-500-normal-Z6ESRlEs.woff",
"sha256": "bd6a8dc8b0dc0cced0c32d3eda93f0e0e82c58ddefea8b53b3307b0c48da3089"
},
{
"path": "public/build/assets/instrument-sans-600-normal-B7fBEWYG.woff2",
"sha256": "efb770916eda95a0e31d80cccde9651d4e8617010b21220e9f227c4820d675da"
},
{
"path": "public/build/assets/instrument-sans-600-normal-B9e8oLYv.woff",
"sha256": "9b4ce1f2b26be7cb087fd87d6f99a202136292ec820af75bd38ab9e53895cf28"
},
{
"path": "public/build/assets/interactive-investment-map-1DTFk8zz.css",
"sha256": "13748a8189dc8c690fc902a1682d30ba289721688f32df4f2459a36de8e383de"
},
{
"path": "public/build/assets/interactive-investment-map-DFT3VzR2.js",
"sha256": "66b806b1a605110e6c2b5bac8293e4ce6346a89d990f02b673161e63edab4dfc"
},
{
"path": "public/build/assets/interest-0ZsdJZZm.js",
"sha256": "f185137984f0bffa5146d9a50c384bc6575eb54c09536d5a1eb70971730dfa62"
},
{
"path": "public/build/assets/interests-B0Z0CmLf.js",
"sha256": "d24b42307cfe73bd5594b44f2c9812bb9aac4a6a7e5678505a3a42498c35c1fe"
},
{
"path": "public/build/assets/investment-map-panel-j-wQfGPo.js",
"sha256": "e7d2504281598a1f26db3e1da855a3f674c30fc63fb51b339c73d82a25f81362"
},
{
"path": "public/build/assets/investment-maturity-CydhhEfV.js",
"sha256": "c2cc75070cb664ab0b53466dde584dd5473f1b5fd992bf6a59ca8a01b7e19623"
},
{
"path": "public/build/assets/investment-territory-B6sG8qJ9.js",
"sha256": "948781f819fb93c760cca169a9fed9571c7f9a23bc1bd883f7427356c3140230"
},
{
"path": "public/build/assets/investor-path-CAHGk6qB.js",
"sha256": "d097b941ba9393ef82351cbd6c1b3e96d17cc3a7d605e721a2ef282557db8422"
},
{
"path": "public/build/assets/investor-wDLipbzX.js",
"sha256": "8b28b017594016c6f491d71c7b972b94e60a8743d0aee5f8309c787dd4e05fb7"
},
{
"path": "public/build/assets/investors-XzWQMblw.js",
"sha256": "d2f25d88fa8cbe8eae45e9a90a0865127fd763f54c9058ed71ed44703bb90a8e"
},
{
"path": "public/build/assets/jsx-runtime-BpzPEenQ.js",
"sha256": "60a64ced602d5e913f2a0328d2ec4a7b670c893614a26c47794317523d276398"
},
{
"path": "public/build/assets/label-D-C_NQs4.js",
"sha256": "6b4996b6f05276fd6edc8dd935f37f83a6c673cad5cf2f9dfa7cf4bdc92816ef"
},
{
"path": "public/build/assets/labels-DxqjesIG.js",
"sha256": "deace12e77e3f2e0515b1090cbc376cfeff29b59f57b1a2561b1145459c531b8"
},
{
"path": "public/build/assets/layers-2x-Bpkbi35X.png",
"sha256": "066daca850d8ffbef007af00b06eac0015728dee279c51f3cb6c716df7c42edf"
},
{
"path": "public/build/assets/layers-BWBAp2CZ.png",
"sha256": "1dbbe9d028e292f36fcba8f8b3a28d5e8932754fc2215b9ac69e4cdecf5107c6"
},
{
"path": "public/build/assets/lead-D2Tih-xB.js",
"sha256": "9e8fb1bc85b7586090cf2b104817f3d77ce77e9c5c022822421db75e5b7bd664"
},
{
"path": "public/build/assets/leads-C7hlhKpX.js",
"sha256": "191e61d4297343a495df3f2eb0adf85ec2679e2ecdfd139d5dd2c4994dae076f"
},
{
"path": "public/build/assets/leaflet-src-CUWrUTR2.js",
"sha256": "a26eda55b9706e8778766e4d32038202d20411081d7da16faaa39b977af36245"
},
{
"path": "public/build/assets/legacy-CX8Pcqkj.js",
"sha256": "977cb3622e6ab01bf0a83421e8ce7e998b98755e18cef18e83db6238b3e29f33"
},
{
"path": "public/build/assets/loader-circle-DS8Tf4er.js",
"sha256": "cd9fb22e9d7d12342d5e0941aac953ebb5184550cc8008b5c0f8f5ea6acd8ed2"
},
{
"path": "public/build/assets/login-D77Sm-ny.js",
"sha256": "7cf286646caefc40060ce6e25bf47d170f25a1de6f0cb214c3ee5ce8464b76e6"
},
{
"path": "public/build/assets/manage-s1znriBq.js",
"sha256": "44895bac66f3b272951511f933535bc3b8105a4f8cfaa936d316025fb540135f"
},
{
"path": "public/build/assets/management-access-Dl70YCx1.js",
"sha256": "1d50024d467e7f6fa4be11cca48534b0b697520cf894282b33ba33cc95db026d"
},
{
"path": "public/build/assets/management-CvdeRZYq.js",
"sha256": "0c193b26e40abae535aa6b51d1734bd930e4d2570dd0033cf0b41efc47aa16cd"
},
{
"path": "public/build/assets/marker-icon-hN30_KVU.png",
"sha256": "574c3a5cca85f4114085b6841596d62f00d7c892c7b03f28cbfa301deb1dc437"
},
{
"path": "public/build/assets/notifications-BzC3R4M-.js",
"sha256": "ffb415a7e93a04494af66470c308ef21d338769c51550733d667b54a49e0e6a5"
},
{
"path": "public/build/assets/operation-key-Dr4VtGxa.js",
"sha256": "416fed7a5197657971af7f378998557c9dba2f99e266e39149b727e598bea439"
},
{
"path": "public/build/assets/opportunities-C9lXK566.js",
"sha256": "c3bc51fd650209013dab119479dad266e7bd3fe5ae31a644617c82dbb6c291ea"
},
{
"path": "public/build/assets/opportunity-draft-CWWv64vh.js",
"sha256": "195b9c33290f764e48fb04642103a9bf23a36ca1afa7f4d79ffa26bcd9039aaa"
},
{
"path": "public/build/assets/opportunity-install-DUbq9a2C.js",
"sha256": "192fe77d67e590561ff9c8e3dc1c2e816c98ea20f3dac33e24591059bd67d3c0"
},
{
"path": "public/build/assets/opportunity-origin-0DDjVKi9.js",
"sha256": "445a6c1cb480aeb1712962b6b2fe68c37097ab9e85453c6d85c28db271dadee4"
},
{
"path": "public/build/assets/opportunity-resources-B1aKABTO.js",
"sha256": "630b7600dfded76137aaed5674eb402dc8a53324e475286e6c48d6f88fbf9554"
},
{
"path": "public/build/assets/panel-CjlfzneZ.js",
"sha256": "16f0b8aeff82509ccae5a7fbfaa6fdf969f16fa36e23e4fe880520178fb20656"
},
{
"path": "public/build/assets/partnership-source-links-VfrXk2FZ.js",
"sha256": "a4d6c8500f2417983312ae667b96f035df9654f37aa4a7bc86f0cc01fda0ddd8"
},
{
"path": "public/build/assets/passkey-verify-CTDJARa-.js",
"sha256": "d0d2856bd365d137c1bb96669dd98de571a218fd2afec6630c3f00982dcf53e7"
},
{
"path": "public/build/assets/password-CB_NxgQN.js",
"sha256": "4415e495723009fc084111bafd2b7714221a3712e5f1d2a4dfa0e698f6308c7a"
},
{
"path": "public/build/assets/password-input-ytrVyGCI.js",
"sha256": "370afc1ff0edbc35b7291f7afcae358ab51ad260d881625961d7bc0884ce465b"
},
{
"path": "public/build/assets/portal-api-tEuwFTsU.js",
"sha256": "190505d0a96d610ef2893cf06c63edab30f427593452bbc0dafc9d8f8a826c70"
},
{
"path": "public/build/assets/PortalInvestidor-DXjtFEO6.js",
"sha256": "f4410dfb8f7708ff49e1fa73bc24428e706574428adea68153abb3ae3c06bb85"
},
{
"path": "public/build/assets/portfolio-CYhinxCj.js",
"sha256": "1480210c14afa668a00fac3c95acbb1be19265b447fc1ca9f6d28e013168677f"
},
{
"path": "public/build/assets/print-EIzSB6Ku.js",
"sha256": "bad87486159deb855589aa92fc7032ea28de222693c2816f2ff54b1583ef6513"
},
{
"path": "public/build/assets/profile-BefZFs4T.js",
"sha256": "4c18c70bac14cdffeca59510925648d8e720b8db8c863cbde32568aa73eb36c2"
},
{
"path": "public/build/assets/profile-CtlF7eKv.js",
"sha256": "d79e2c72240df91fe08329d4be3e84a31af64f165c01ae13a204749af2c9b83a"
},
{
"path": "public/build/assets/profile-json-Bb5H6-rZ.js",
"sha256": "0c4720d8d5baabfcc199d66bc171b014152f3cf2ff40b542d38e86cc1e04a77a"
},
{
"path": "public/build/assets/project-dossier-BRpAqBvm.js",
"sha256": "9906a87fcb5b99bea2eca25e68dc49c149c7b250056a8ac0977d2c8b6cf4e732"
},
{
"path": "public/build/assets/react-CjVep8xp.js",
"sha256": "3378f8538b0d8c51e3051e5005dfaebb8fec48c35789a3ba63945fd724f48e6f"
},
{
"path": "public/build/assets/references-B5MS22w9.js",
"sha256": "fa55c761d620d3b128624f5bba834e1b9d827e5f476905b84e5e9f1c66a1456b"
},
{
"path": "public/build/assets/register-DCPZrD0a.js",
"sha256": "e6a1f602eda3cbb6b12adab01e8988491395791a89e1725a65848329358bfd67"
},
{
"path": "public/build/assets/relationship-repair-GOvWjM52.js",
"sha256": "85557cf553926fd7ffb1e8ea8989f7adffc6a989ef463a1ef932fb7bde35e55e"
},
{
"path": "public/build/assets/request-C3B6Yur9.js",
"sha256": "6b69666c41cc93cc859aa51b9eb05a8545570934e88f320755b6ca287575dd6d"
},
{
"path": "public/build/assets/request-DTkbzuAg.js",
"sha256": "bf047a247b5508bef2a0f3476a8f9dc46b7615c67f3fc2fe04db610aeb263dee"
},
{
"path": "public/build/assets/reset-password-Bc6EmnDS.js",
"sha256": "97451a15cff88124d6f19bc9e192cf2a553c1960482acba974586eec44b373ae"
},
{
"path": "public/build/assets/result-BUxzIVRu.js",
"sha256": "37a663041cac3e91c65b05f7cc3771398d6329884ad799f5a913e3b7cc657394"
},
{
"path": "public/build/assets/rolldown-runtime-Dd_uD5pT.js",
"sha256": "c5f0356f5d0918a3137e4e811fd18950efe8ac8f6bf84d1d4da7811c477a24d8"
},
{
"path": "public/build/assets/room-B9wM3cp1.js",
"sha256": "2a9fae4593529dd51a5ac76f5cc1e07ed1f5a6ea94e1b1635e3c69f73e1b0295"
},
{
"path": "public/build/assets/security-DYDm6VQ2.js",
"sha256": "201fd8eebc218810b77f3175a4da5a0c48cc4d4c5edcf02ce8b4a3c543dfbd95"
},
{
"path": "public/build/assets/services-D8vIP2CV.js",
"sha256": "e3e5ba322dbd99479d9f6e0edd8e615e932cf02ef6d399e68df02471713df06b"
},
{
"path": "public/build/assets/shared-BqWH8W8E.js",
"sha256": "db7e7d4ddbb26c2855603982b91d9f71fdcba18857ad89f1411035ef51766c88"
},
{
"path": "public/build/assets/shared-Bux3M99i.js",
"sha256": "8877ed79a10047d41b06dfe296788a9c1d5477c570cd79e3904bb7f98d645aab"
},
{
"path": "public/build/assets/shared-CANbkD3F.js",
"sha256": "ba4fe1a47bd69463053d0a83a22ce0b64641ecd0fc012d744549243793edbb12"
},
{
"path": "public/build/assets/shared-CKR8SVWL.js",
"sha256": "0469e5c4b7b00b15c60f2176908cf765f2e5ca679bd2d6ac81f1642ca248d495"
},
{
"path": "public/build/assets/show-ChiKlf2m.js",
"sha256": "de35d2a085b85ada8031eb162a7bd15c2d92bd38bec2a0891415bcff8a2c9ab5"
},
{
"path": "public/build/assets/show-DrfHy5n2.js",
"sha256": "9dd0d17d891848de9048a57b202477007515643b8b2ba6346f04eb9b167667f6"
},
{
"path": "public/build/assets/sources-DE9fmPGT.js",
"sha256": "e2caff103b2570df9b78efc63ec5cc4d4a93efde928fec06204fa3cde9980572"
},
{
"path": "public/build/assets/spinner-hD8hHC_m.js",
"sha256": "0091bbe0e4125cbe30ecd10ec9ff65cff9b7bd270125913d85b4449144aa91fd"
},
{
"path": "public/build/assets/structure-geography-DupeFK-Z.js",
"sha256": "f65d72b37acdd8379ff4654ef859ab8dcca5f1e6a2e2f51b60d91828039043ef"
},
{
"path": "public/build/assets/structures-D08yRP7d.js",
"sha256": "a52a0b664f6daf8fffe85ba7b2197711d30f71efbd7e320fa6020aa61dcb2705"
},
{
"path": "public/build/assets/submission-eASssihs.js",
"sha256": "b9c7cfcb712b56277254f83f8a6694b23d6c143a782be3ae664fa8cd91ef6e91"
},
{
"path": "public/build/assets/territorial-source-evidence-eKB4ZB36.js",
"sha256": "14048631c51933a0389cea37ae1909a02ea86d564a5a05452a48b40f055cd605"
},
{
"path": "public/build/assets/territory-associations-72yodrv5.js",
"sha256": "029ae7ee496193da460f3c1ed29a4ce5a4b4af00e0dde5a51e08a8ed7deb7141"
},
{
"path": "public/build/assets/territory-geometry-import-DCYDtoRH.js",
"sha256": "f5a56a8332acc2c8afc5870591c95990f4c8c1ddede00092474b1100414ed673"
},
{
"path": "public/build/assets/territory-geometry-preview-DVGcGZ40.js",
"sha256": "03bb3ad0572f1b2f6e9fc599df677c1e0cb6eaf821680d92eb5a21bc846e5364"
},
{
"path": "public/build/assets/text-link-BBvcP60s.js",
"sha256": "0e7b5234d766855dbcbd5a78fe3e8c54fa6ffa1ad6163009d7b312eafd19f307"
},
{
"path": "public/build/assets/two-factor-challenge-CsTuVOyS.js",
"sha256": "48d1a311ae8a985e9d07cb962db760357f6255340c81bdb7f028307aff590e13"
},
{
"path": "public/build/assets/types-BoD_IJFv.js",
"sha256": "75c4a127c1aa0b90fe0b4f956c7e3ae9c67bc0f862c89cd0a594709027b983da"
},
{
"path": "public/build/assets/types-Cxp_Nskt.js",
"sha256": "cf4ae8cb539c697ca751dcf96e1db3af9eb1ff00807c088268dd859e7c4a5dab"
},
{
"path": "public/build/assets/use-two-factor-auth-kpel6Zcb.js",
"sha256": "771c519273e76ec8a5bea59c35605f01e5a55b353443c742c8f22d7bd9691504"
},
{
"path": "public/build/assets/utils-CCDJ05Ll.js",
"sha256": "ef54f43266d404b8ffe4e5487b346060eaf81d819317f523c966aa3e7490deb8"
},
{
"path": "public/build/assets/value-network-DG6bWNFJ.js",
"sha256": "54db54c5f72925dd5f9dda2b2d021996fb1241371d2b2ac76c4bc59fa569854d"
},
{
"path": "public/build/assets/value-text-BztaYdGl.js",
"sha256": "873576810a6ba4eb8c9c116f53cdc649b21ab2995aa2adadd4c85130b04bacd2"
},
{
"path": "public/build/assets/verification-BOcn3HIw.js",
"sha256": "10addac3d8f1865e855943e0685e88a268ffd8013ff7a7d51fb89d755b12074e"
},
{
"path": "public/build/assets/verify-email-BnXvK---.js",
"sha256": "d3380fbed6f643e6fb0a79adda612e8db70863003574d0e2e27467d770ad4e44"
},
{
"path": "public/build/assets/wayfinder-Dp7PqxvV.js",
"sha256": "3d4c90228fda731e37f541f3087fdf5387d9d59433e35b267b64a97196f70781"
},
{
"path": "public/build/assets/welcome-BuuOE117.js",
"sha256": "295476286a388019d99f71ea35fb01b9685d46cbe329826c3b6d22a34cde1ade"
},
{
"path": "public/build/assets/workspace-4_R1CLYI.js",
"sha256": "5d4c742569d9ad33ac7bac01c6433c646f79f939d2f57b7878860c0d25dcee22"
},
{
"path": "public/build/assets/workspace-CRrGlSsm.js",
"sha256": "a919e4cff888819d7d5ee5612300c4b659bf1018d80ece5cda787bb74f3c3cc0"
},
{
"path": "public/build/assets/workspace-Dt8tyM3p.js",
"sha256": "6eadc1eefa45223fef5c88607e171599ee1f4e40768ac790e2939f1cd297fe0d"
},
{
"path": "public/build/assets/zone-attachments-Di9qTwNr.js",
"sha256": "fdb3b3830e650ff6199c50c3a2ca13e0a55e7fcdc524028362d442f949bb5419"
},
{
"path": "public/build/assets/zone-CyQQYSHS.js",
"sha256": "0a9b945d05a431301653c875106cc47ac8baf6cbf5272786bbf4f54e8f4cc3fe"
},
{
"path": "public/build/assets/zone-map-CPlwVMT3.js",
"sha256": "32945face05715140d69b469d53fcd8774f191a4c04dc4296ec76eab83272db2"
},
{
"path": "public/build/assets/zone-relations-C17bCQOu.js",
"sha256": "db90b4a7ba0f99fdae0d8fdc43d13af0bad5acc84f2e8010a3f651d1f4c6cf77"
},
{
"path": "public/build/assets/zones-DLdgiWOD.js",
"sha256": "8f9d3e88204abbd952c5a98462484b36e79d47ae8f401a0daf12f46377fb2c59"
},
{
"path": "public/build/fonts-manifest.json",
"sha256": "66edf17c93351fe01158be7414a441a762f106417c74351881876b405b8b10ca"
},
{
"path": "public/build/manifest.json",
"sha256": "e21d388f2e71bcd762c476d3e0bd1ae7c608ca57cafc2381c2a8888ce5d4efbf"
}
],
"flags_proposed": [
"PORTAL_PROFILE_ACCESS_ENABLED",
"PORTAL_OPPORTUNITY_DASHBOARD_ACCESS_ENABLED",
"PORTAL_OPPORTUNITY_SPECIALIZED_DRAFTS_ENABLED"
],
"revision": "a02ef2300d6c10cb21fc1aaf2bbe14cb19e0a6e28ab34d7ae0c72ee921d79927",
"at": "2026-10-12T09:57:17.132065+00:00",
"target": "https://portal-investidor.test; investemoz:5432",
"source": "guarded QA 55441 *_test",
"schema_changes": 0,
"migrations": 0,
"service_changes": 0,
"new_active_accounts_or_grants": 0,
"active_writes": 0,
"included": [
"C129 contact creation/reuse through existing CRM master from editable draft",
"C130 access revision bound with governance enabled",
"existing isolated workflow of six base categories"
],
"pending": [
"visual demonstration of the new contact form and affected authentication state",
"final correspondence of the fixed delta with backup and pre-deployment target",
"explicit authorization of new delta and three operational gates"
],
"ready_for_activation": false,
"backup_pre_change": {
"verified_at": "2026-10-12T09:10:48+00:00",
"valid_until": "2026-10-13T09:10:48+00:00",
"restored_target": {
"database": "internal_designation_target_20261012_090957_test",
"port": 55441
},
"restoration_verified": true,
"code_revision_backed_up": "2876cdfa900a8b75bac8a8af681a159cc7abb17cf4b04b0f41b8415384c3ce83",
"dump_sha256": "6730939df5ad57c36a789c9c1c7e0c8790f9a39744442e2d5f0059e7ad6a40db",
"files_sha256": "222ba54940c6fcd4d2217e615eb7b505781e06f4152cfa85f909f1405bb2734d"
},
"limitations": [
"Contact job title from the normative specification is not a column of the current master; full normative contract remains partial",
"Existing variant exclusions, individual sharing and opportunity restoration remain disabled",
"Four modular categories, integrated journey 190000, legacy, offers and SLA are separate"
]
}
@@ -0,0 +1,10 @@
{
"revision": "a02ef2300d6c",
"full_revision": "a02ef2300d6c10cb21fc1aaf2bbe14cb19e0a6e28ab34d7ae0c72ee921d79927",
"source_files": 9,
"compiled_resources": 159,
"zip_sha256": "3dd59a5d7af550327e1bab816f5a7b0fe9003affbe7cf2cfc96945157fe7fbed",
"manifest_sha256": "8b0a16c8ea796dc1f967c0d82cb0dd8b8ffaa984e0a6b1aa9e8987b72d3ea13e",
"ready_for_activation": false,
"active_unchanged": true
}
@@ -0,0 +1,176 @@
<?php
namespace App\Http\Controllers;
use App\Models\Opportunity;
use App\Services\OpportunityCanonicalContract;
use App\Services\OpportunityContacts;
use App\Services\OpportunityManagement;
use App\Services\OpportunityProfileWorkflow;
use App\Services\PortalInternalDesignation;
use App\Services\PortalProfileAccess;
use App\Services\PortalProfileAdministration;
use App\Services\PortalSuperusers;
use App\Services\VerifiedDocumentBinary;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Inertia\Inertia;
use Inertia\Response;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
class PortalProfileController extends Controller
{
public function requests(Request $request, PortalProfileAccess $access): Response
{
return Inertia::render('profiles/request', ['requests' => DB::table('portal_profile_requests')->where('user_id', $request->user()->id)->latest()->get(),
'types' => OpportunityManagement::CATEGORIES,
'organizations' => DB::table('memberships as m')->join('organizations as o', 'o.id', '=', 'm.organization_id')->where('m.user_id', $request->user()->id)
->whereNull('m.deleted_at')->whereNull('o.deleted_at')->whereIn('m.role', ['admin', 'manager', 'officer'])->get(['o.id', 'o.name']),
'documents' => DB::table('documents')->where('uploaded_by', $request->user()->id)->whereNull('deleted_at')->where('status', 'active')->where('malware_scan_status', 'clean')
->whereColumn('sha256', 'malware_scanned_sha256')->get(['id', 'file_name']), 'grants' => $access->grants($request->user(), 'promoter')]);
}
public function requestProfile(Request $request, PortalProfileAdministration $service): JsonResponse
{
return response()->json(['id' => $service->request($request->user(), $request->all()), 'message' => 'Pedido recebido; perfil ainda não ativado.'], 201);
}
public function requestStatus(Request $request, string $id): JsonResponse
{
$row = DB::table('portal_profile_requests')->where('id', $id)->where('user_id', $request->user()->id)->first();
abort_unless($row !== null, 403);
return response()->json($row);
}
public function administration(Request $request, PortalProfileAdministration $service): Response
{
$service->administrative($request->user());
return Inertia::render('profiles/administration', ['requests' => DB::table('portal_profile_requests')->latest()->get(),
'assignments' => DB::table('portal_role_assignments')->get(), 'pair' => DB::table('portal_superuser_pair')->first(),
'operatorOrganizations' => app(PortalInternalDesignation::class)->organizations(),
'internalTypes' => OpportunityCanonicalContract::BASE_CATEGORIES,
'actorId' => $request->user()->id, 'types' => OpportunityManagement::CATEGORIES,
'organizations' => DB::table('organizations')->whereNull('deleted_at')->get(['id', 'name']),
'securityRequests' => DB::table('portal_security_approvals')->latest()->limit(30)->get(),
'securityAlerts' => DB::table('audit_events')->where('source_system', 'portal-profiles-v1')->whereIn('action', ['superuser_pair_initialized', 'superuser_replaced', 'role_revoked'])->latest('occurred_at')->limit(20)->get(['id', 'action', 'actor_user_id', 'occurred_at'])]);
}
public function decide(Request $request, string $id, PortalProfileAdministration $service): JsonResponse
{
$service->decide($request->user(), $id, $request->all());
return response()->json(['message' => 'Decisão registada; somente os tipos aprovados ficam autorizados.']);
}
public function audit(Request $request, PortalProfileAccess $access): Response|JsonResponse
{
abort_unless($access->has($request->user(), 'auditor') || ($access->superuser($request->user()) && $access->mfa($request->user())), 403);
$filters = $request->validate(['actor_id' => 'nullable|integer|min:1', 'action' => 'nullable|string|max:100', 'record_id' => 'nullable|integer|min:1', 'from' => 'nullable|date', 'until' => 'nullable|date|after_or_equal:from', 'format' => 'nullable|in:json']);
$query = DB::table('audit_events')->when($filters['actor_id'] ?? null, fn ($q, $v) => $q->where('actor_user_id', $v))
->when($filters['action'] ?? null, fn ($q, $v) => $q->where('action', $v))
->when($filters['record_id'] ?? null, fn ($q, $v) => $q->where('after_data->record_id', $v))
->when($filters['from'] ?? null, fn ($q, $v) => $q->where('occurred_at', '>=', $v))
->when($filters['until'] ?? null, fn ($q, $v) => $q->where('occurred_at', '<=', $v));
// Minimized metadata: never decrypt private snapshots or export authentication bodies.
$query->select(['id', 'source_system', 'action', 'actor_user_id', 'entity_type', 'occurred_at', 'correlation_id']);
if (($filters['format'] ?? null) === 'json') {
$records = $query->orderByDesc('occurred_at')->limit(1000)->get();
$access->audit($request->user(), 'audit_metadata_exported', ['filters' => $filters, 'count' => $records->count()]);
return response()->json(['filters' => $filters, 'records' => $records, 'limit' => 1000])->header('Content-Disposition', 'attachment; filename="audit-metadata.json"')->header('Cache-Control', 'private, no-store');
}
$records = $query->orderByDesc('occurred_at')->paginate(30)->withQueryString();
$access->audit($request->user(), 'audit_metadata_read', ['filters' => $filters, 'count' => $records->count()]);
return Inertia::render('profiles/audit', ['records' => $records, 'filters' => $filters]);
}
public function registerOperatorOrganization(Request $request, PortalInternalDesignation $service): JsonResponse
{
return response()->json($service->registerOrganization($request->user(), $request->all()), 201);
}
public function grant(Request $request, PortalProfileAdministration $service): JsonResponse
{
return response()->json(['id' => $service->grant($request->user(), $request->all())], 201);
}
public function requestDocument(Request $request, string $id, string $documentId, PortalProfileAdministration $service): \Illuminate\Http\Response|BinaryFileResponse
{
$service->administrative($request->user());
$row = DB::table('portal_profile_requests')->where('id', $id)->first();
abort_unless($row && in_array($documentId, json_decode($row->document_ids, true), true), 404);
$document = DB::table('documents')->where('id', $documentId)->first();
abort_unless($document !== null, 404);
return app(VerifiedDocumentBinary::class)->respond($document, true);
}
public function revoke(Request $request, string $id, PortalProfileAdministration $service): JsonResponse
{
$service->revoke($request->user(), $id, (string) $request->input('reason'));
return response()->json(['message' => 'Papel revogado; sessões e tokens anteriores invalidados.']);
}
public function opportunities(Request $request, PortalProfileAccess $access): Response
{
abort_unless($access->grants($request->user()) !== [] || $access->superuser($request->user()), 403);
return app(OpportunityManagementController::class)->index($request, app(OpportunityManagement::class));
}
public function edit(Request $request, PortalProfileAccess $access, ?int $id = null): Response
{
if ($id) {
$access->authorize($request->user(), str_ends_with($request->path(), '/view') ? 'view' : 'edit', Opportunity::withTrashed()->findOrFail($id));
} else {
abort_unless($access->navigation($request->user())['contexts'] ?? [], 403);
}
return app(OpportunityManagementController::class)->edit($request, app(OpportunityManagement::class), $id);
}
public function workflow(Request $request, int $id, OpportunityProfileWorkflow $service): JsonResponse
{
$record = $service->transition($request->user(), $id, $request->all());
return response()->json(['id' => $id, 'status' => app(PortalProfileAccess::class)->state($record), 'publication_status' => $record->status, 'etag' => app(OpportunityManagement::class)->etag($record), 'message' => 'Ação interna registada; não representa decisão externa.']);
}
public function contact(Request $request, int $id, OpportunityContacts $service): JsonResponse
{
return response()->json($service->save($request->user(), $id, $request->all()));
}
public function replacement(Request $request, PortalSuperusers $service): JsonResponse
{
$data = $request->validate(['old_user_id' => 'required|integer', 'new_user_id' => 'required|integer', 'reason' => 'required|string|min:20|max:1000']);
return response()->json(['id' => $service->requestReplacement($request->user(), $data['old_user_id'], $data['new_user_id'], $data['reason'])], 201);
}
public function approveSecurity(Request $request, string $id, PortalSuperusers $service): JsonResponse
{
$service->approve($request->user(), $id);
return response()->json(['message' => 'Aprovação independente registada.']);
}
public function replace(Request $request, string $id, PortalSuperusers $service): JsonResponse
{
$service->applyReplacement($request->user(), $id);
return response()->json(['message' => 'Titular substituído atomicamente; continuam dois titulares.']);
}
public function elevation(Request $request, PortalSuperusers $service): JsonResponse
{
$data = $request->validate(['action' => 'required|string', 'record_id' => 'nullable|integer|exists:opportunities,id', 'reason' => 'required|string|min:20|max:1000']);
return response()->json(['id' => $service->requestElevation($request->user(), $data['action'], $data['record_id'] ?? null, $data['reason'])], 201);
}
}
@@ -0,0 +1,147 @@
<?php
namespace App\Providers;
use App\Models\Opportunity;
use App\Models\Sector;
use App\Models\User;
use App\Services\Malware\ClamDScanner;
use App\Services\Malware\MalwareScanner;
use App\Services\Mne\BusinessRepository;
use App\Services\Mne\CompatibleBusinessRepository;
use App\Services\PortalProfileAccess;
use Carbon\CarbonImmutable;
use Illuminate\Auth\Events\Login;
use Illuminate\Cache\RateLimiting\Limit;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\ServiceProvider;
use Illuminate\Validation\Rules\Password;
use Laravel\Fortify\Events\ValidTwoFactorAuthenticationCodeProvided;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
$this->app->bind(MalwareScanner::class, ClamDScanner::class);
$this->app->bind(BusinessRepository::class, CompatibleBusinessRepository::class);
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
$this->configureDefaults();
// Fortify calls this response AFTER invalidating/regenerating the server session.
// Clear the client's encryption key too, so Back must reauthorize private pages.
$this->app->bind(\Laravel\Fortify\Contracts\LogoutResponse::class, function () {
return new class extends \Laravel\Fortify\Http\Responses\LogoutResponse
{
public function toResponse($request)
{
\Inertia\Inertia::clearHistory();
return parent::toResponse($request);
}
};
});
Event::listen(ValidTwoFactorAuthenticationCodeProvided::class, function ($event): void {
// The authenticated installers also operate before the optional profile schema exists.
// Record a completed Fortify challenge, never enrollment or a password-only login.
session()->put(['portal.mfa_actor' => $event->user->id, 'portal.mfa_at' => time()]);
});
Event::listen(Login::class, function ($event): void {
if (app(PortalProfileAccess::class)->governanceAvailable()) {
session()->put('portal.access_revision', (int) DB::table('users')->where('id', $event->user->id)->value('portal_access_revision'));
}
});
Gate::define('manage-portal', fn (User $user) => $user->hasVerifiedEmail()
&& in_array(strtolower($user->email), config('portal.managers', []), true));
foreach ([Sector::class, Opportunity::class] as $model) {
$invalidate = function () {
Cache::forget('portal_home_pt');
Cache::forget('portal_home_en');
Cache::forget('portal_home_v2_pt');
Cache::forget('portal_home_v2_en');
};
$model::saved($invalidate);
$model::deleted($invalidate);
}
$requestLimitKey = static function (Request $request): string {
if ($user = $request->user()) {
return 'user:'.$user->getAuthIdentifier();
}
$token = $request->header('X-Simulation-Token');
return is_string($token) && $token !== ''
? 'anonymous:'.hash('sha256', $token)
: 'ip:'.$request->ip();
};
RateLimiter::for('api', function (Request $request) use ($requestLimitKey) {
return Limit::perMinute(60)->by($requestLimitKey($request))
->response(fn (Request $request, array $headers) => response()->json([
'message' => 'Demasiadas solicitações. Aguarde um pouco e tente novamente.',
], 429, $headers));
});
RateLimiter::for('simulation-draft-writes', function (Request $request) use ($requestLimitKey) {
return Limit::perMinute(30)->by('simulation-draft:'.$requestLimitKey($request))
->response(fn (Request $request, array $headers) => response()->json([
'message' => 'Foram guardadas demasiadas alterações em pouco tempo. Aguarde um minuto e tente novamente.',
], 429, $headers));
});
RateLimiter::for('simulation-calculations', function (Request $request) use ($requestLimitKey) {
return Limit::perMinute(10)->by('simulation-calculation:'.$requestLimitKey($request))
->response(fn (Request $request, array $headers) => response()->json([
'message' => 'Foram solicitados demasiados cálculos em pouco tempo. Aguarde antes de tentar novamente.',
], 429, $headers));
});
RateLimiter::for('simulation-scenario-updates', function (Request $request) use ($requestLimitKey) {
return Limit::perMinute(10)->by('simulation-scenario-update:'.$requestLimitKey($request))
->response(fn (Request $request, array $headers) => response()->json([
'message' => 'Foram solicitadas demasiadas alterações de cenário em pouco tempo. Aguarde antes de tentar novamente.',
], 429, $headers));
});
}
/**
* Configure default behaviors for production-ready applications.
*/
protected function configureDefaults(): void
{
Date::use(CarbonImmutable::class);
DB::prohibitDestructiveCommands(
app()->isProduction(),
);
Password::defaults(fn (): ?Password => app()->isProduction()
? Password::min(12)
->mixedCase()
->letters()
->numbers()
->symbols()
->uncompromised()
: null,
);
}
}
@@ -0,0 +1,505 @@
<?php
namespace App\Services;
use App\Models\Opportunity;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
use Opis\JsonSchema\CompliantValidator;
use Opis\JsonSchema\Errors\ErrorFormatter;
use Opis\JsonSchema\Errors\ValidationError;
/** Explicit adapter of §25/26 to existing IDs and resource collections; never renumbers records. */
class OpportunityCanonicalContract
{
public const BASE_CATEGORIES = ['investment_project', 'real_estate', 'land_rights', 'business_sale', 'business_partnership', 'franchise'];
/** Availability of this bounded base-category delivery, without rewriting existing contracts/data. */
public function deliveryBlockers(array $payload): array
{
$errors = [];
if (! in_array($payload['opportunity_category'] ?? '', self::BASE_CATEGORIES, true) && ! app(OpportunityModularProfiles::class)->enabled()) {
$errors['canonical.opportunity_category'] = 'Categoria fora desta entrega: concessão, financiamento, fornecimento e outros permanecem indisponíveis. Os registos anteriores são preservados.';
}
if (($payload['opportunity_category'] ?? '') === 'real_estate') {
$property = $payload['real_estate'] ?? [];
foreach (['construction_status' => ['completed'], 'occupancy_status' => ['vacant'], 'transaction_type' => ['sale', 'lease']] as $field => $values) {
if (! empty($property[$field]) && ! in_array($property[$field], $values, true)) {
$errors['canonical.real_estate.'.$field] = 'Variante indisponível para submissão nesta entrega. Pode guardar e recuperar a preparação; estão incluídas venda e arrendamento de imóvel concluído e desocupado.';
}
}
if (array_filter($property['encumbrances'] ?? [], fn ($row) => ! empty($row['type']) && $row['type'] !== 'none')) {
$errors['canonical.real_estate.encumbrances'] = 'Imóvel com encargos: pode preparar e guardar; a submissão deste ramo não está incluída nesta entrega.';
}
if (! empty($property['max_built_area']) || ! empty($property['urban_limit_document_id'])) {
$errors['canonical.real_estate.max_built_area'] = 'Limitações urbanísticas adicionais: preparação disponível; este ramo de submissão aguarda demonstração própria.';
}
}
return $errors;
}
public const VERSION = 'opportunity-canonical-adapter-20261010-semantic1';
/** @return array<string,mixed> */
public function schema(bool $draft = false): array
{
$bytes = file_get_contents(resource_path('data/investmoz-opportunity-modular.schema.json'));
if ($bytes === false) {
throw new \RuntimeException('Opportunity schema unavailable.');
}
$schema = json_decode($bytes, true, 512, JSON_THROW_ON_ERROR);
// The original conditions were omitted from the extracted Create/Patch definitions.
foreach (['opportunity', 'realEstate', 'landRights', 'businessTransaction'] as $name) {
$schema['$defs'][$name.'Create']['allOf'] = $schema['$defs'][$name]['allOf'] ?? [];
}
$schema = app(OpportunityCategoryFields::class)->enrich($schema);
$schema = app(OpportunityModularProfiles::class)->extend($schema);
$schema = $this->writeSchema($schema, $draft);
$properties = &$schema['$defs']['opportunityCreate']['properties'];
unset($properties['mutation_context']); // Actor, audit reason and revision are server-owned.
$properties['sector_id'] = ['type' => 'integer', 'minimum' => 1];
$properties['promoter_id'] = ['type' => ['string', 'integer']];
// References point to the existing collections; their metadata is recovered on the server.
foreach (['locations', 'documents', 'images'] as $field) {
$properties[$field]['items'] = ['type' => 'string', 'format' => 'uuid'];
}
$properties['evidences'] = ['type' => 'array', 'items' => ['$ref' => '#/$defs/evidenceCreate']];
if (! $draft) {
$properties['evidences']['minItems'] = 1;
}
$properties['evidences']['items'] = ['type' => 'object', 'additionalProperties' => false,
'properties' => ['title' => ['type' => 'string'], 'evidence_type' => ['type' => 'string'],
'document_id' => ['type' => 'string', 'format' => 'uuid'], 'description' => ['type' => 'string']],
...($draft ? [] : ['required' => ['title', 'evidence_type', 'document_id']])];
$schema['$ref'] = '#/$defs/opportunityCreate';
$schema['$id'] = 'urn:investmoz:'.self::VERSION.($draft ? ':draft' : ':submit');
return $schema;
}
/**
* @param array<string,mixed> $node
* @return array<string,mixed>
*/
private function writeSchema(array $node, bool $draft): array
{
if (isset($node['$ref']) && preg_match('~^#/\$defs/(.+)$~', $node['$ref'], $match)) {
// Collections in the normative Create still referenced response definitions.
$defs = ['product', 'asset', 'input', 'market', 'impact', 'moneyItem', 'milestone', 'license', 'risk', 'relation', 'employment', 'environmentalSocial', 'localizedPublication', 'realEstate', 'landRights', 'businessTransaction', 'parcel', 'improvement', 'community'];
if (in_array($match[1], $defs, true)) {
$node['$ref'] .= 'Create';
}
}
if ($draft) {
unset($node['required'], $node['minItems'], $node['minProperties'], $node['contains'], $node['allOf']);
if (isset($node['type'])) {
$node['type'] = array_values(array_unique([...(array) $node['type'], 'null']));
}
if (isset($node['enum']) && ! in_array(null, $node['enum'], true)) {
$node['enum'][] = null;
}
if (isset($node['minLength'])) {
$node['minLength'] = 0;
}
if (($node['const'] ?? null) === true) {
unset($node['const']);
$node['type'] = 'boolean';
}
}
foreach ($node as $key => $value) {
if (is_array($value)) {
if (in_array($key, ['properties', '$defs'], true)) {
foreach ($value as $name => $child) {
$value[$name] = $this->writeSchema($child, $draft);
}
$node[$key] = $value;
} elseif (in_array($key, ['items', 'if', 'then', 'else'], true)) {
$node[$key] = $this->writeSchema($value, $draft);
} elseif (in_array($key, ['allOf', 'oneOf', 'anyOf'], true)) {
$node[$key] = array_map(fn ($child) => $this->writeSchema($child, $draft), $value);
}
}
}
return $node;
}
/**
* @param array<string,mixed> $payload
* @return array<string,mixed>
*/
public function draft(array $payload): array
{
abort_unless(config('portal.opportunity_specialized_drafts_enabled'), 422, 'Contrato especializado indisponível.');
$this->validateSchema($payload, true);
return $payload;
}
/** @param array<string,mixed> $payload */
private function validateSchema(array $payload, bool $draft): void
{
$schema = $this->schema($draft);
$validator = new CompliantValidator(null, 100, false);
$data = $this->schemaData($payload, $schema['$defs']['opportunityCreate'], $schema['$defs']);
$result = $validator->validate($data, json_decode(json_encode($schema, JSON_THROW_ON_ERROR)));
if ($error = $result->error()) {
$errors = [];
foreach ((new ErrorFormatter)->format($error) as $path => $messages) {
$errors['canonical'.str_replace('/', '.', $path)] = $messages;
}
$required = function (ValidationError $node) use (&$required, &$errors): void {
if ($node->keyword() === 'required') {
$prefix = 'canonical.'.implode('.', $node->data()->fullPath());
foreach ($node->args()['missing'] ?? [] as $field) {
$errors[rtrim($prefix, '.').'.'.$field] = ['Preencha este campo antes de submeter.'];
}
}
foreach ($node->subErrors() as $child) {
$required($child);
}
};
$required($error);
throw ValidationException::withMessages($errors);
}
}
/** @param array<string,mixed> $node
* @param array<string,mixed> $defs
*/
private function schemaData(mixed $value, array $node, array $defs): mixed
{
if (isset($node['$ref'])) {
$name = basename($node['$ref']);
$node = $defs[$name] ?? $node;
}
if (! is_array($value)) {
return $value;
}
if (in_array('object', (array) ($node['type'] ?? []), true) || isset($node['properties'])) {
$result = new \stdClass;
foreach ($value as $key => $item) {
$result->{$key} = $this->schemaData($item, $node['properties'][$key] ?? [], $defs);
}
return $result;
}
return array_map(fn ($item) => $this->schemaData($item, $node['items'] ?? [], $defs), $value);
}
/** @return array<string,mixed> */
public function validateSubmission(Opportunity $record): array
{
$values = app(OpportunityManagement::class)->values($record);
$payload = $values['canonical'] ?? [];
$this->validateSchema($payload, false);
$errors = [];
$check = function (bool $valid, string $path, string $message) use (&$errors): void {
if (! $valid) {
$errors['canonical.'.$path] = $message;
}
};
$check(($payload['opportunity_category'] ?? null) === $record->opportunity_category, 'opportunity_category', 'A categoria deve coincidir com o registo e a autorização.');
$check(($payload['promoter_id'] ?? null) === ($record->organization_id ?? (int) $record->owner_user_id), 'promoter_id', 'Identifique o promotor real da oportunidade; o operador do portal não o substitui.');
$sector = DB::table('sectors')->where('id', $payload['sector_id'])->whereNull('deleted_at')->where('is_active', true)->first();
$subsector = DB::table('economic_activities')->where('id', $payload['subsector_id'])->where('status', 'published')->first();
$activity = DB::table('economic_activities')->where('id', $payload['economic_activity_id'])->where('status', 'published')->first();
$root = $subsector?->parent_id ? DB::table('economic_activities')->where('id', $subsector->parent_id)->where('status', 'published')->first() : null;
$check($sector !== null && $root !== null && (int) $root->sector_id === (int) $sector->id
&& $activity !== null && $activity->parent_id === $subsector->id && $activity->catalog_version_id === $root->catalog_version_id,
'economic_activity_id', 'Sector → subsector → atividade requer referências publicadas da mesma versão e hierarquia.');
foreach (['internal_contact_id', 'public_contact_id'] as $field) {
if (! empty($payload[$field])) {
$contacts = DB::table('contacts')->where('contacts.id', $payload[$field])->whereNull('contacts.deleted_at');
if ($record->organization_id) {
$contacts->whereExists(fn ($q) => $q->selectRaw('1')->from('investor_contacts as ic')->join('investors as i', 'i.id', '=', 'ic.investor_id')
->whereColumn('ic.contact_id', 'contacts.id')->where('i.organization_id', $record->organization_id)->whereNull('i.deleted_at'));
} else {
$contacts->where('source_system', 'portal-user-contact')->where('external_id', 'user:'.$record->owner_user_id);
}
$check($contacts->exists(), $field, 'Contacto inexistente ou sem relação com o Promotor.');
}
}
$resources = [];
foreach (['locations', 'documents', 'images'] as $kind) {
$table = app(OpportunityResources::class)->table($kind);
foreach ($payload[$kind] ?? [] as $index => $id) {
$row = DB::table($table)->where('id', $id)->where('opportunity_id', $record->id)->whereNull('deleted_at')->first();
$check($row !== null, "$kind.$index", 'Recurso inexistente, eliminado ou de outra oportunidade.');
if (! $row) {
continue;
}
$row->payload = json_decode($row->payload, true, 512, JSON_THROW_ON_ERROR);
if ($kind !== 'locations') {
$file = DB::table('documents')->where('id', $row->document_id)->first();
$check($file !== null && $file->deleted_at === null && $file->status === 'active' && $file->malware_scan_status === 'clean'
&& hash_equals(trim($file->sha256), trim((string) $file->malware_scanned_sha256)), "$kind.$index", 'Original ativo com análise antimalware correspondente obrigatória.');
if ($file) {
// Verify actual bytes/cipher integrity as well as the recorded scan hash.
app(VerifiedDocumentBinary::class)->respond($file);
$row->sha256 = trim($file->sha256);
}
} else {
$location = $row->payload;
$check(! empty($location['district_id']) && ! empty($location['role']) && array_key_exists('is_primary', $location), "locations.$index", 'Localização requer distrito, papel e indicação de principal.');
app(InvestmentGeography::class)->selection($location, true);
$country = $location['country_code'] ?? null;
$check($country === 'MZ', "locations.$index.country_code", 'A hierarquia administrativa moçambicana deve declarar MZ; outros países exigem localização própria.');
}
$resources[$kind][$id] = (array) $row;
}
}
$locations = $resources['locations'] ?? [];
$primary = array_filter($locations, fn ($l) => $l['payload']['is_primary'] ?? false);
$check(count($primary) === 1, 'locations', 'Selecione exatamente uma localização principal.');
$check($payload['location_mode'] !== 'single' || count($locations) === 1, 'location_mode', 'Modo single exige uma localização.');
foreach ($payload['evidences'] as $i => $evidence) {
$check(isset($resources['documents'][$evidence['document_id']]), "evidences.$i.document_id", 'Evidência deve usar um documento ativo desta oportunidade incluído no contrato.');
}
$this->categoryRules($payload, $record, $resources, $errors);
app(OpportunityCategoryFields::class)->validate($payload, $record, $resources, $errors);
if ($errors) {
throw ValidationException::withMessages($errors);
}
ksort($payload);
$snapshot = ['adapter_version' => self::VERSION, 'schema_sha256' => hash_file('sha256', resource_path('data/investmoz-opportunity-modular.schema.json')),
'payload' => $payload, 'resources' => $resources];
if (isset(OpportunityModularProfiles::PROFILES[$record->opportunity_category]) || ($payload['module_profile_version'] ?? '') === OpportunityModularProfiles::HISTORY_VERSION) {
$snapshot['qa_extension'] = ['version' => OpportunityModularProfiles::VERSION, 'profile_version' => $payload['module_profile_version'],
'functional_decision' => 'Experimental QA proposal; functional approval of modular contracts and SLA remains pending. Legacy integration authorization does not approve these modules.',
'gates' => $this->gates($record)];
if ($record->opportunity_category === 'other') {
$snapshot['qa_extension']['subtype'] = config('portal.opportunity_other_qa_subtypes.'.($payload['module_details']['subtype'] ?? ''), []);
}
// A documentary correction must not rewrite the checksum of an already
// signed, unchanged version. Its historical annotation is explicitly
// reconciled by the read adapter; new/changed content uses the current note.
$prior = $record->workflow_context['submission'] ?? [];
if (isset($prior['qa_extension']) && ($prior['payload'] ?? null) == $snapshot['payload'] && ($prior['resources'] ?? null) == $snapshot['resources']) {
$snapshot['qa_extension']['functional_decision'] = $prior['qa_extension']['functional_decision'];
}
}
$snapshot['hash'] = hash('sha256', json_encode($snapshot, JSON_THROW_ON_ERROR));
return $snapshot;
}
/**
* @param array<string,mixed> $p
* @param array<string,mixed> $resources
* @param array<string,string> $errors
*/
private function categoryRules(array $p, Opportunity $record, array $resources, array &$errors): void
{
$category = $p['opportunity_category'];
app(OpportunityModularProfiles::class)->validate($p, $resources, $errors);
foreach (['real_estate', 'land_rights', 'business_transaction'] as $module) {
$applicable = match ($module) {
'real_estate' => ['real_estate'], 'land_rights' => ['land_rights'], default => ['business_sale', 'business_partnership', 'franchise']
};
if (isset($p[$module]) && ! in_array($category, $applicable, true)) {
$errors['canonical.'.$module] = 'Módulo incompatível com a categoria. Preserve-o noutra versão antes de mudar de categoria.';
}
}
if ($category === 'investment_project') {
$total = $p['total_investment'];
$sum = array_sum(array_column($p['investment_breakdown'], 'amount'));
$secured = array_sum(array_column($p['secured_financing'], 'amount'));
if (abs($sum - $total) > 0.010001 || $secured > $total || abs($p['funding_sought'] - ($total - $secured)) > 0.010001) {
$errors['canonical.investment_breakdown'] = 'Rubricas e financiamento devem reconciliar com o total (tolerância normativa 0,01).';
}
if (! in_array($p['maturity_stage'], array_keys(OpportunityMaturity::STAGES), true)) {
$errors['canonical.maturity_stage'] = 'Use um código explícito do catálogo de oito etapas; não reinterpretar a escala histórica.';
}
foreach (['investment_breakdown', 'secured_financing'] as $field) {
foreach ($p[$field] as $i => $amount) {
if ($amount['currency'] !== $p['currency']) {
$errors["canonical.$field.$i.currency"] = 'Moedas distintas requerem cenário/câmbio explícito; não somar valores de moedas diferentes.';
}
}
}
foreach ($p['markets'] as $i => $market) {
if (isset($market['country_code']) && Validator::make(['country' => $market['country_code']], ['country' => app(CountryCatalogue::class)->rule()])->fails()) {
$errors["canonical.markets.$i.country_code"] = 'Use país do catálogo ISO existente.';
}
}
}
if ($category === 'real_estate') {
$re = $p['real_estate'];
if ($re['transaction_type'] === 'sale' && ($re['price'] ?? 0) <= 0) {
$errors['canonical.real_estate.price'] = 'Venda exige preço positivo.';
}
if ($re['transaction_type'] === 'lease') {
if (($re['rent'] ?? 0) <= 0) {
$errors['canonical.real_estate.rent'] = 'Arrendamento exige renda positiva.';
}
if (empty($re['rent_periodicity'])) {
$errors['canonical.real_estate.rent_periodicity'] = 'Indique a periodicidade da renda.';
}
}
if (in_array($re['construction_status'], ['completed', 'occupied', 'renovation'], true) && empty($re['property_condition'])) {
$errors['canonical.real_estate.property_condition'] = 'Imóvel existente exige condição identificada.';
}
if (in_array($re['construction_status'], ['planned', 'under_construction'], true) && empty($re['planning_permit_document_id'])) {
$errors['canonical.real_estate.planning_permit_document_id'] = 'Estado construtivo exige licença de construção (§25.1).';
}
if (in_array($re['construction_status'], ['completed', 'occupied', 'renovation'], true) && empty($re['use_license_document_id'])) {
$errors['canonical.real_estate.use_license_document_id'] = 'Imóvel existente exige licença de utilização aplicável (§25.1).';
}
foreach (['planning_permit_document_id', 'use_license_document_id'] as $field) {
if (! empty($re[$field]) && ! isset($resources['documents'][$re[$field]])) {
$errors['canonical.real_estate.'.$field] = 'Licença deve referir documento ativo desta oportunidade.';
}
}
}
if ($category === 'land_rights') {
$land = $p['land_rights'];
if (! empty($land['issuing_authority_id']) && ! DB::table('authorities')->where('id', $land['issuing_authority_id'])->where('status', 'published')->exists()) {
$errors['canonical.land_rights.issuing_authority_id'] = 'Entidade emissora deve usar autoridade canónica publicada.';
}
if (! empty($land['issue_date']) && ($land['issue_date'] > today()->toDateString() || (! empty($land['expiry_date']) && $land['expiry_date'] <= $land['issue_date']))) {
$errors['canonical.land_rights.issue_date'] = 'Emissão não futura e validade posterior à emissão.';
}
foreach ($land['parcels'] as $i => $parcel) {
if (! isset($resources['locations'][$parcel['location_id']])) {
$errors["canonical.land_rights.parcels.$i.location_id"] = 'Parcela deve usar uma localização desta oportunidade.';
}
try {
$g = DB::selectOne('SELECT ST_IsValid(g) AND NOT ST_IsEmpty(g) AND ST_GeometryType(g)=\'ST_MultiPolygon\' AND ST_XMin(Box3D(g))>=-180 AND ST_XMax(Box3D(g))<=180 AND ST_YMin(Box3D(g))>=-90 AND ST_YMax(Box3D(g))<=90 AS valid FROM (SELECT ST_SetSRID(ST_GeomFromGeoJSON(?),4326) g) s', [json_encode($parcel['geometry'])]);
if (! $g?->valid) {
throw new \RuntimeException;
}
} catch (\Throwable) {
$errors["canonical.land_rights.parcels.$i.geometry"] = 'Parcela requer MultiPolygon válido, não vazio, EPSG:4326; limite administrativo não é parcela.';
}
}
if (in_array($land['duat_status'], ['provisional', 'definitive'], true) && empty($land['duat_number'])) {
$errors['canonical.land_rights.duat_number'] = 'DUAT provisório/definitivo exige número e entidade emissora.';
}
}
if (isset($p['business_transaction'])) {
$business = $p['business_transaction'];
if ($business['legal_entity_id'] !== $record->organization_id || ! DB::table('organizations')->where('id', $business['legal_entity_id'])->whereNull('deleted_at')->exists()) {
$errors['canonical.business_transaction.legal_entity_id'] = 'Entidade ativa representada obrigatória.';
}
}
}
/** @param array<string,mixed> $snapshot */
public function validatePublication(array $snapshot): void
{
$p = $snapshot['payload'];
$errors = [];
app(OpportunityCategoryFields::class)->publication($p, $errors);
app(OpportunityModularProfiles::class)->publication($p, $errors);
foreach ($snapshot['resources']['documents'] ?? [] as $id => $document) {
if (! empty($document['payload']['valid_until']) && $document['payload']['valid_until'] < today()->toDateString()) {
$errors['documents.'.$id] = 'Documento incluído expirou; preserve o original e reveja a versão.';
}
}
if ($p['opportunity_category'] === 'land_rights') {
foreach ($p['land_rights']['required_authorizations'] as $i => $authorization) {
if (! in_array($authorization['status'] ?? '', ['approved', 'not_required'], true)
|| (($authorization['status'] ?? '') === 'approved' && ! isset($snapshot['resources']['documents'][$authorization['document_id'] ?? '']))) {
$errors['land_rights.required_authorizations.'.$i] = 'Autorização externa pendente ou sem documento. Aprovação interna não substitui esse ato.';
}
}
foreach ($p['land_rights']['overlaps_conflicts'] as $i => $conflict) {
if (($conflict['type'] ?? '') !== 'none' && ($conflict['status'] ?? '') !== 'resolved') {
$errors['land_rights.overlaps_conflicts.'.$i] = 'Conflito impeditivo deve ser resolvido com evidência antes de publicar.';
}
}
}
if ($p['visibility'] === 'public') {
$images = $snapshot['resources']['images'] ?? [];
if (count(array_filter($images, fn ($image) => $image['payload']['is_cover'] ?? false)) !== 1) {
$errors['images'] = 'Publicação pública exige uma capa explícita.';
}
foreach ($images as $id => $image) {
$meta = $image['payload'];
if (empty($meta['alt_text']) || empty($meta['caption']) || empty($meta['rights_status']) || empty($meta['derivatives'])
|| (! empty($meta['rights_valid_until']) && $meta['rights_valid_until'] < today()->toDateString())) {
$errors['images.'.$id] = 'Legenda, texto alternativo, direitos válidos e derivadas verificadas obrigatórios.';
}
foreach ($meta['derivatives'] ?? [] as $derived) {
$file = DB::table('documents')->where('id', $derived['document_id'])->whereNull('deleted_at')->where('status', 'active')->where('malware_scan_status', 'clean')->whereColumn('sha256', 'malware_scanned_sha256')->first();
if (! $file) {
$errors['images.'.$id] = 'Scan de uma derivada ainda não demonstrado.';
} else {
app(VerifiedDocumentBinary::class)->respond($file);
}
}
}
}
if ($errors) {
throw ValidationException::withMessages($errors);
}
}
/** @return list<string> */
public function gates(Opportunity $record): array
{
return match ($record->opportunity_category) {
'investment_project' => ['technical_review', 'legal_territorial_review'],
'real_estate' => ['property_review', 'registry_urban_review', 'building_compliance_review'],
'land_rights' => ['cadastral_screening', 'land_legal_review', 'community_environment_review', 'competent_authority_clearance'],
'business_sale' => ['corporate_screening', 'financial_review', 'legal_tax_due_diligence', 'confidentiality_clearance'],
'business_partnership' => ['corporate_screening', 'financial_review', 'partnership_governance_review', 'legal_tax_due_diligence'],
'franchise' => ['brand_license_review', 'financial_review', 'franchise_legal_review', 'confidentiality_clearance'],
default => app(OpportunityModularProfiles::class)->gates($record),
};
}
/** Same exact projection for preview and publication; never expose private business analysis.
* @param array<string,mixed> $payload
* @return array{title:string,summary:string,description:string} */
public function publicProjection(array $payload): array
{
$business = isset($payload['business_transaction']) && ($payload['visibility'] ?? '') === 'public';
$label = match ($payload['module_details']['mode'] ?? '') {
'intention_call' => 'Intenção/chamada em preparação — não é direito atribuído. ',
'awarded_right' => 'Concessão com ato competente documentado. ',
'seeking_funding' => 'Procura de financiamento. ', 'funding_offer' => 'Oferta de financiamento — sujeita a análise do beneficiário. ',
'purchase_request' => 'Pedido de compra. ', 'supply_offer' => 'Oferta de fornecimento. ', default => '',
};
if (($payload['module_details']['conditions_status'] ?? '') === 'proposed') {
$label .= 'Valores e condições propostos, sem compromisso assumido. ';
}
return ['title' => (string) ($payload['official_title'] ?? ''), 'summary' => Str::limit($label.(string) ($business ? ($payload['business_transaction']['teaser'] ?? '') : ($payload['executive_summary'] ?? '')), 499, '…'),
'description' => (string) ($business ? ($payload['business_transaction']['teaser'] ?? '') : ($payload['demand_statement'] ?? ''))];
}
/** @return array<string,mixed> */
public function options(User $actor, ?Opportunity $record): array
{
$orgs = array_values(array_unique(array_column(app(PortalProfileAccess::class)->navigation($actor)['contexts'] ?? [], 'organization_id')));
if (! $record && (app(PortalProfileAccess::class)->navigation($actor)['internalPromoter'] ?? false)) {
// A staff creation scope does not expose unrelated private contact lists.
$orgs = [];
}
if ($record?->organization_id) {
$orgs = [$record->organization_id];
}
$contacts = DB::table('contacts')->whereNull('contacts.deleted_at')->where(function ($q) use ($orgs, $actor) {
$q->where(fn ($own) => $own->where('source_system', 'portal-user-contact')->where('external_id', 'user:'.$actor->id))
->orWhereExists(fn ($i) => $i->selectRaw('1')->from('investor_contacts as ic')->join('investors as inv', 'inv.id', '=', 'ic.investor_id')->whereColumn('ic.contact_id', 'contacts.id')->whereIn('inv.organization_id', $orgs)->whereNull('inv.deleted_at'));
})->get(['id', 'full_name']);
return ['version' => self::VERSION, 'modularProfiles' => app(OpportunityModularProfiles::class)->enabled() ? OpportunityModularProfiles::PROFILES : [],
'historyVersion' => app(OpportunityModularProfiles::class)->enabled() ? OpportunityModularProfiles::HISTORY_VERSION : null,
'schema' => $this->schema(true)['$defs']['opportunityCreate'],
'definitions' => $this->schema(true)['$defs'],
'activities' => DB::table('economic_activities')->where('status', 'published')->get(['id', 'parent_id', 'sector_id', 'label_pt_mz', 'catalog_version_id']),
'contacts' => $contacts, 'contactInvestors' => $record?->organization_id ? DB::table('investors')->where('organization_id', $record->organization_id)->whereNull('deleted_at')->whereIn('status', ['prospect', 'active'])->get(['id', 'legal_name']) : [],
'countries' => app(CountryCatalogue::class)->all(),
'authorities' => DB::table('authorities')->where('status', 'published')->get(['id', 'label_pt_mz']),
'gates' => $record ? $this->gates($record) : [], 'resources' => $record ? array_combine(['locations', 'documents', 'images'], array_map(fn ($k) => array_values(array_filter(app(OpportunityResources::class)->listing($record->id, $k), fn ($row) => empty($row->deleted_at))), ['locations', 'documents', 'images'])) : []];
}
}
@@ -0,0 +1,93 @@
<?php
namespace App\Services;
use App\Models\Contact;
use App\Models\Investor;
use App\Models\Opportunity;
use App\Models\User;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use Illuminate\Validation\Rule;
use Illuminate\Validation\ValidationException;
/** Reuse the CRM master without manufacturing an interest, lead or consent. */
class OpportunityContacts
{
public function save(User $actor, int $id, array $input): array
{
$access = app(PortalProfileAccess::class);
$record = Opportunity::withTrashed()->findOrFail($id);
$access->authorize($actor, 'edit', $record);
abort_unless($access->mfa($actor), 403, 'Confirme a autenticação multifator nesta sessão.');
$data = Validator::make($input, [
'etag' => 'required|string|size:64',
'full_name' => 'required|string|min:2|max:150',
'email' => 'required|email:rfc|max:150',
'phone' => ['required', 'regex:/^\+[1-9]\d{7,14}$/'],
'investor_id' => 'nullable|uuid',
'investor_type' => ['nullable', Rule::in(['domestic', 'foreign', 'institutional', 'individual'])],
])->validate();
$data['email'] = strtolower(trim($data['email']));
$data['full_name'] = trim(preg_replace('/\s+/u', ' ', $data['full_name']));
return DB::transaction(function () use ($actor, $id, $data, $access) {
$record = Opportunity::withTrashed()->whereKey($id)->lockForUpdate()->firstOrFail();
$access->authorize($actor, 'edit', $record);
abort_unless(hash_equals(app(OpportunityManagement::class)->etag($record), $data['etag']), 409, 'A oportunidade mudou. Recupere a versão atual antes de cadastrar o contacto.');
DB::select('SELECT pg_advisory_xact_lock(170925, hashtext(?))', [$data['email']]);
$matches = Contact::withTrashed()->whereRaw('lower(trim(email)) = ?', [$data['email']])->lockForUpdate()->get();
$scoped = function (Contact $contact) use ($record): bool {
return $record->organization_id
? DB::table('investor_contacts as ic')->join('investors as i', 'i.id', '=', 'ic.investor_id')
->where('ic.contact_id', $contact->id)->where('i.organization_id', $record->organization_id)->whereNull('i.deleted_at')->exists()
: $contact->source_system === 'portal-user-contact' && $contact->external_id === 'user:'.$record->owner_user_id;
};
if ($matches->isNotEmpty()) {
$contact = $matches->first(fn ($row) => ! $row->trashed() && $scoped($row));
if ($matches->count() !== 1 || ! $contact || $contact->full_name !== $data['full_name'] || $contact->phone !== $data['phone']) {
throw ValidationException::withMessages(['email' => 'Não foi possível reutilizar este contacto neste âmbito. Escolha um contacto autorizado existente ou reconcilie os dados no cadastro mestre; nenhum registo foi alterado.']);
}
return ['contact' => $contact->only(['id', 'full_name']), 'reused' => true, 'message' => 'Contacto existente recuperado, sem duplicação. Guarde a seleção no rascunho.'];
}
$investor = null;
if ($record->organization_id) {
DB::select('SELECT pg_advisory_xact_lock(170926, hashtext(?))', [$record->organization_id]);
$investors = Investor::where('organization_id', $record->organization_id)->whereIn('status', ['prospect', 'active'])->lockForUpdate()->get();
if (! empty($data['investor_id'])) {
$investor = $investors->firstWhere('id', $data['investor_id']);
abort_unless($investor, 403, 'O cadastro selecionado não pertence ao promotor desta oportunidade.');
} elseif ($investors->count() === 1) {
$investor = $investors->first();
} elseif ($investors->count() > 1) {
throw ValidationException::withMessages(['investor_id' => 'Selecione o cadastro mestre do promotor; não será criada outra entidade.']);
} else {
if (empty($data['investor_type'])) {
throw ValidationException::withMessages(['investor_type' => 'Indique a classificação do promotor no cadastro existente.']);
}
$organization = DB::table('organizations')->where('id', $record->organization_id)->whereNull('deleted_at')->first();
abort_unless($organization, 422, 'Organização indisponível.');
$investor = new Investor;
PortalAudit::save($investor, ['organization_id' => $organization->id, 'legal_name' => $organization->name,
'investor_type' => $data['investor_type'], 'status' => 'prospect', 'source_system' => 'portal-promoter-master',
'external_id' => 'organization:'.$organization->id], $actor->id);
}
} else {
abort_unless(empty($data['investor_id']) && empty($data['investor_type']), 422);
}
$contact = new Contact;
PortalAudit::save($contact, ['full_name' => $data['full_name'], 'email' => $data['email'], 'phone' => $data['phone'],
'source_system' => $record->organization_id ? 'portal-promoter-contact' : 'portal-user-contact',
'external_id' => $record->organization_id ? null : 'user:'.$record->owner_user_id,
'data_classification' => 'internal'], $actor->id);
if ($investor) {
DB::table('investor_contacts')->insertOrIgnore(['investor_id' => $investor->id, 'contact_id' => $contact->id, 'is_primary' => false]);
}
$access->audit($actor, 'opportunity_contact_registered', ['record_id' => $id, 'contact_id' => $contact->id,
'organization_id' => $record->organization_id, 'investor_id' => $investor?->id, 'automatically_published' => false]);
return ['contact' => $contact->only(['id', 'full_name']), 'reused' => false, 'message' => 'Contacto guardado no cadastro existente. Guarde a seleção no rascunho; não foi publicado.'];
});
}
}
@@ -0,0 +1,372 @@
<?php
namespace App\Services;
use App\Models\Opportunity;
use App\Models\User;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Str;
class PortalProfileAccess
{
public const VERSION = 'profiles-v1-20261010';
/** @return list<string> */
public static function fingerprintFiles(): array
{
return [__FILE__, app_path('Services/OpportunityContacts.php'), resource_path('js/components/opportunity-contact-form.tsx'), app_path('Services/PortalInternalDesignation.php'), app_path('Models/User.php'), app_path('Models/Opportunity.php'), config_path('portal.php'), base_path('routes/web.php'),
app_path('Http/Middleware/HandleInertiaRequests.php'), app_path('Services/OpportunityManagement.php'),
app_path('Services/OpportunityResources.php'), app_path('Services/OpportunityImageProcessor.php'), app_path('Services/VerifiedDocumentBinary.php'),
app_path('Services/PortalProfileAdministration.php'), app_path('Services/PortalSuperusers.php'),
app_path('Services/OpportunityProfileWorkflow.php'), app_path('Http/Controllers/PortalProfileController.php'), app_path('Http/Controllers/DashboardController.php'),
app_path('Http/Controllers/OpportunityManagementController.php'),
app_path('Services/OpportunityCanonicalContract.php'), app_path('Services/OpportunityCanonicalResponse.php'), app_path('Services/OpportunityCategoryFields.php'), app_path('Services/OpportunityModularProfiles.php'), app_path('Services/OpportunityWorkflowTasks.php'), base_path('composer.json'), base_path('composer.lock'),
app_path('Services/OpportunityReviewMateriality.php'), app_path('Services/OpportunityReviewConditions.php'), app_path('Services/OpportunityCanonicalMetadata.php'), app_path('Services/OpportunityCompleteness.php'), app_path('Services/OpportunityCanonicalValue.php'),
resource_path('data/investmoz-opportunity-modular.schema.json'), resource_path('js/components/opportunity-canonical-fields.tsx'), resource_path('js/components/opportunity-parcel-geometry.tsx'),
app_path('Http/Controllers/OpportunityResourceController.php'),
app_path('Http/Controllers/InvestmentTerritoryController.php'),
app_path('Http/Middleware/PortalProfileSession.php'), app_path('Http/Middleware/ProtectProfileOpportunity.php'),
app_path('Http/Middleware/ProtectPrivilegedIdentity.php'), app_path('Http/Middleware/EnsurePortalProfiles.php'),
app_path('Http/Middleware/AuditProfileDecision.php'), app_path('Http/Middleware/EnsurePortalProfileAdministration.php'), app_path('Providers/AppServiceProvider.php'),
database_path('migrations/2026_10_10_040000_create_portal_profile_authorization.php'), base_path('bootstrap/app.php'),
resource_path('js/pages/profiles/request.tsx'), resource_path('js/pages/profiles/administration.tsx'), resource_path('js/pages/profiles/audit.tsx'),
resource_path('js/components/profile-navigation.tsx'), resource_path('js/components/opportunity-profile-actions.tsx'),
resource_path('js/components/portal-grouped-menu.tsx'), resource_path('js/components/user-menu-content.tsx'),
resource_path('js/pages/management/opportunities.tsx'), resource_path('js/pages/management/opportunity-draft.tsx'),
resource_path('js/types/profile-access.ts'), resource_path('js/lib/profile-json.ts'), resource_path('js/pages/management/shared.tsx'),
resource_path('js/pages/dashboard.tsx'), resource_path('js/pages/PortalInvestidor.tsx'),
resource_path('js/layouts/portal-navigation.tsx'), resource_path('js/components/interactive-investment-map.tsx'),
resource_path('js/components/simulation-form.tsx'), resource_path('js/lib/simulation-form.ts'), app_path('Services/LegacyContent.php'),
resource_path('js/components/ui/sidebar.tsx'), resource_path('js/components/simulation-financial-tools.tsx'), resource_path('js/components/simulation-cashflow-planner.tsx'), resource_path('js/pages/investor-path/show.tsx'), resource_path('views/app.blade.php'),
resource_path('js/pages/management/opportunity-resources.tsx'),
app_path('Services/PortalProfileInstallation.php'), app_path('Http/Controllers/PortalProfileInstallationController.php'), config_path('portal_profiles.php'), resource_path('js/pages/profiles/installation.tsx')];
}
public function available(): bool
{
return config('portal.profile_access_enabled') && $this->installed();
}
public function governanceAvailable(): bool
{
return (config('portal.profile_administration_enabled') || config('portal.profile_access_enabled')) && $this->installed();
}
public function installed(): bool
{
return Schema::hasTable('portal_role_assignments')
&& Schema::hasTable('portal_superuser_pair') && Schema::hasTable('portal_profile_requests')
&& Schema::hasTable('portal_security_approvals') && Schema::hasColumn('users', 'portal_access_revision')
&& Schema::hasColumn('opportunities', 'workflow_context') && Schema::hasColumn('opportunities', 'owner_user_id')
&& Schema::hasColumn('opportunities', 'organization_id');
}
/** @return list<\stdClass> */
public function grants(User $actor, ?string $role = null): array
{
if (! $this->governanceAvailable() || ! $actor->hasVerifiedEmail()) {
return [];
}
return array_values(DB::table('portal_role_assignments')->where('user_id', $actor->id)->whereNull('revoked_at')->where('starts_at', '<=', now())
->where(fn ($q) => $q->whereNull('expires_at')->orWhere('expires_at', '>', now()))->when($role, fn ($q) => $q->where('role', $role))->get()->all());
}
public function has(User $actor, string $role): bool
{
return $role === 'superuser' ? $this->superuser($actor) : $this->grants($actor, $role) !== [];
}
public function superuser(User $actor): bool
{
return $this->governanceAvailable() && $actor->hasVerifiedEmail() && DB::table('portal_superuser_pair')->where('id', 1)
->where(fn ($q) => $q->where('first_user_id', $actor->id)->orWhere('second_user_id', $actor->id))->exists();
}
public function represents(User $actor, ?string $organization): bool
{
return $organization === null || DB::table('memberships as m')->join('organizations as o', 'o.id', '=', 'm.organization_id')
->where('m.user_id', $actor->id)->where('m.organization_id', $organization)
->whereNull('m.deleted_at')->whereNull('o.deleted_at')->whereIn('m.role', ['admin', 'manager', 'officer'])->exists();
}
public function mfa(User $actor): bool
{
// Enrollment alone is insufficient: Fortify must have completed MFA in this session.
return $actor->two_factor_confirmed_at !== null && $actor->two_factor_secret !== null
&& session('login.id') === null && session('portal.mfa_actor') === $actor->id
&& (int) session('portal.mfa_at', 0) >= time() - 900;
}
public function internalAssignment(User $actor, string $type): ?\stdClass
{
foreach ($this->grants($actor, 'promoter') as $grant) {
if ($grant->source === 'internal-portal-designation'
&& in_array($type, json_decode($grant->opportunity_types, true), true)
&& app(PortalInternalDesignation::class)->organization($grant->organization_id) !== null) {
return $grant;
}
}
return null;
}
public function promoterRecordScope(User $actor, Opportunity $record): bool
{
foreach ($this->grants($actor, 'promoter') as $grant) {
if (! in_array($record->opportunity_category, json_decode($grant->opportunity_types, true), true)) {
continue;
}
if ($grant->source === 'internal-portal-designation') {
if (app(PortalInternalDesignation::class)->organization($grant->organization_id) !== null
&& ($record->workflow_context['operator_organization_id'] ?? null) === $grant->organization_id
&& ((int) $record->owner_user_id === $actor->id || in_array($actor->id, $record->workflow_context['contributors'] ?? [], true))) {
return true;
}
} elseif ($grant->organization_id === $record->organization_id && $this->represents($actor, $record->organization_id)
&& ($record->organization_id !== null || (int) $record->owner_user_id === $actor->id)) {
return true;
}
}
return false;
}
public function scoped(User $actor, string $role, ?string $organization, string $type): bool
{
if ($role === 'promoter' && $organization !== null && $this->internalAssignment($actor, $type) !== null
&& DB::table('organizations')->where('id', $organization)->whereNull('deleted_at')->exists()) {
return true;
}
foreach ($this->grants($actor, $role) as $grant) {
if (($grant->organization_id === $organization || ($role !== 'promoter' && $grant->organization_id === null))
&& in_array($type, json_decode($grant->opportunity_types, true, 512, JSON_THROW_ON_ERROR), true)) {
return $role !== 'promoter' || $this->represents($actor, $organization);
}
}
return false;
}
public function operational(User $actor, string $action, ?int $recordId = null): bool
{
if (! $this->available()) {
return false;
}
if ($this->has($actor, 'auditor')) {
return false;
}
if (! $this->superuser($actor)) {
return true;
}
if (! $this->mfa($actor)) {
return false;
}
return DB::table('portal_security_approvals')->where('kind', 'elevation')->where('subject_user_id', $actor->id)
->whereNotNull('approved_by')->whereColumn('approved_by', '!=', 'subject_user_id')
->whereColumn('approved_by', '!=', 'requested_by')->whereNull('consumed_at')->where('expires_at', '>', now())
->whereExists(fn ($q) => $q->selectRaw('1')->from('portal_superuser_pair')
->where(fn ($holders) => $holders->whereColumn('first_user_id', 'portal_security_approvals.approved_by')->orWhereColumn('second_user_id', 'portal_security_approvals.approved_by')))
->where('scope->action', $action)->where('scope->record_id', $recordId)->exists();
}
public function canCreate(User $actor, ?string $organization, string $type): bool
{
$included = in_array($type, OpportunityCanonicalContract::BASE_CATEGORIES, true) || app(OpportunityModularProfiles::class)->enabled();
return $included && $this->available() && $this->scoped($actor, 'promoter', $organization, $type) && $this->operational($actor, 'create');
}
public function legacyWriteAllowed(User $actor): bool
{
// A deliberate v1 assignment cannot use the old allowlist to bypass its scope.
if (! $actor->can('manage-portal')) {
return false;
}
if (! Schema::hasTable('portal_role_assignments')) {
return true;
}
// Revocation/expiry must not silently restore an older, wider privilege.
return ! DB::table('portal_role_assignments')->where('user_id', $actor->id)->exists()
&& ! DB::table('portal_superuser_pair')->where(fn ($q) => $q->where('first_user_id', $actor->id)->orWhere('second_user_id', $actor->id))->exists()
&& ! DB::table('portal_security_approvals')->where('kind', 'replacement')->whereNotNull('consumed_at')->where('scope->old_user_id', $actor->id)->exists();
}
/** Administration never grants operational access to a dossier or its attachments. */
public function hasOperationalReadScope(User $actor, Opportunity $record): bool
{
$personal = $record->organization_id !== null || (int) $record->owner_user_id === $actor->id;
return $this->promoterRecordScope($actor, $record)
|| $this->scoped($actor, 'validator', $record->organization_id, $record->opportunity_category)
|| $this->scoped($actor, 'publisher', $record->organization_id, $record->opportunity_category);
}
public function canView(User $actor, Opportunity $record): bool
{
if ($record->owner_user_id !== null && ! $this->available()) {
return false;
}
if ($this->superuser($actor)) {
return ! $this->has($actor, 'auditor') && $this->hasOperationalReadScope($actor, $record)
&& $this->operational($actor, 'view', $record->id);
}
if ($record->owner_user_id === null) {
return $actor->can('manage-portal');
}
if (! $this->available() || ! $actor->hasVerifiedEmail()) {
return false;
}
return $this->has($actor, 'auditor') || $this->hasOperationalReadScope($actor, $record);
}
public function canEdit(User $actor, Opportunity $record, ?string $newType = null): bool
{
if ($record->owner_user_id === null) {
return $this->legacyWriteAllowed($actor);
}
return $this->canView($actor, $record) && $this->promoterRecordScope($actor, $record) && ! $record->trashed()
&& in_array($this->state($record), ['draft', 'needs_information'], true)
&& $this->scoped($actor, 'promoter', $record->organization_id, $newType ?? $record->opportunity_category)
&& $this->operational($actor, 'edit', $record->id);
}
public function conflict(User $actor, Opportunity $record): bool
{
$context = $record->workflow_context ?? [];
return (int) $record->owner_user_id === $actor->id || in_array($actor->id, $context['contributors'] ?? [], true)
|| ($record->organization_id !== null && DB::table('memberships')->where('user_id', $actor->id)
->where('organization_id', $record->organization_id)->whereNull('deleted_at')->exists());
}
public function state(Opportunity $record): string
{
return $record->workflow_context['working_state'] ?? $record->status;
}
public function authorize(User $actor, string $action, Opportunity $record): void
{
$allowed = $action === 'view' ? $this->canView($actor, $record) : $this->canEdit($actor, $record);
if (! $allowed) {
$this->audit($actor, 'access_denied', ['record_id' => $record->id, 'action' => $action]);
}
abort_unless($allowed, 403, 'O perfil, representação, tipo ou estado não autoriza esta operação.');
}
/**
* @param Builder<Opportunity> $query
* @return Builder<Opportunity>
*/
public function scope(Builder $query, User $actor): Builder
{
if ($this->has($actor, 'auditor') && ! $this->superuser($actor)) {
return $query;
}
if ($this->superuser($actor)) {
$ids = DB::table('portal_security_approvals')->where('kind', 'elevation')->where('subject_user_id', $actor->id)
->where('scope->action', 'view')->whereNotNull('approved_by')->whereNull('consumed_at')->where('expires_at', '>', now())
->get()->filter(fn ($row) => $this->operational($actor, 'view', json_decode($row->scope, true)['record_id'] ?? null))
->map(fn ($row) => json_decode($row->scope, true)['record_id'])->all();
$query->whereIn('id', $ids);
}
return $query->where(function ($scope) use ($actor) {
$scope->whereRaw('1=0');
if ($actor->can('manage-portal') && ! $this->superuser($actor)) {
$scope->orWhereNull('owner_user_id');
}
foreach ($this->grants($actor) as $grant) {
if (! in_array($grant->role, ['promoter', 'validator', 'publisher'], true)) {
continue;
}
if ($grant->role === 'promoter' && $grant->source !== 'internal-portal-designation' && ! $this->represents($actor, $grant->organization_id)) {
continue;
}
if ($grant->role === 'promoter' && $grant->source === 'internal-portal-designation' && app(PortalInternalDesignation::class)->organization($grant->organization_id) === null) {
continue;
}
$scope->orWhere(function ($allowed) use ($actor, $grant) {
$allowed->whereNotNull('owner_user_id')->whereIn('opportunity_category', json_decode($grant->opportunity_types, true, 512, JSON_THROW_ON_ERROR));
if ($grant->role === 'promoter' && $grant->source === 'internal-portal-designation') {
$allowed->where(fn ($q) => $q->where('owner_user_id', $actor->id)->orWhereJsonContains('workflow_context->contributors', $actor->id))
->where('workflow_context->operator_organization_id', $grant->organization_id);
} elseif ($grant->organization_id !== null) {
$allowed->where('organization_id', $grant->organization_id);
} elseif ($grant->role === 'promoter') {
$allowed->whereNull('organization_id')->where('owner_user_id', $actor->id);
}
});
}
});
}
/** @return array<string,mixed>|null */
public function navigation(?User $actor): ?array
{
if (! $actor || ! $this->governanceAvailable() || ! $actor->hasVerifiedEmail()) {
return null;
}
$contexts = [];
$seen = [];
$internalPromoter = false;
foreach ($this->grants($actor, 'promoter') as $grant) {
if ($grant->source === 'internal-portal-designation' && app(PortalInternalDesignation::class)->organization($grant->organization_id) !== null) {
$internalPromoter = true;
foreach (DB::table('organizations')->whereNull('deleted_at')->get(['id', 'name']) as $realPromoter) {
foreach (json_decode($grant->opportunity_types, true) as $type) {
$key = $realPromoter->id.'|'.$type;
if (! isset($seen[$key]) && $this->canCreate($actor, $realPromoter->id, $type)) {
$contexts[] = ['organization_id' => $realPromoter->id, 'organization_name' => $realPromoter->name, 'type' => $type];
$seen[$key] = true;
}
}
}
continue;
}
if (! $this->represents($actor, $grant->organization_id)) {
continue;
}
foreach (json_decode($grant->opportunity_types, true, 512, JSON_THROW_ON_ERROR) as $type) {
$key = ($grant->organization_id ?? 'individual').'|'.$type;
if (! isset($seen[$key]) && $this->canCreate($actor, $grant->organization_id, $type)) {
$contexts[] = ['organization_id' => $grant->organization_id, 'type' => $type];
$seen[$key] = true;
}
}
}
return ['contexts' => $contexts, 'internalPromoter' => $internalPromoter, 'mine' => $contexts ? '/minhas-oportunidades' : null, 'create' => $contexts ? '/minhas-oportunidades/create' : null,
'request' => '/perfil/promotor', 'review' => $this->available() && ($this->has($actor, 'validator') || $this->has($actor, 'publisher') || $this->has($actor, 'auditor') || $this->superuser($actor)) ? '/minhas-oportunidades' : null,
'audit' => $this->has($actor, 'auditor') || $this->superuser($actor) ? '/perfis/auditoria' : null, 'administration' => $this->superuser($actor) ? '/perfis/gestao' : null];
}
/** @param array<string,mixed> $data */
public function audit(User $actor, string $action, array $data): void
{
DB::table('audit_events')->insert(['source_system' => 'portal-profiles-v1', 'entity_type' => 'authorization', 'actor_user_id' => $actor->id,
'action' => $action, 'data_classification' => 'restricted', 'correlation_id' => (string) Str::uuid(),
'after_data' => json_encode([...$data, 'policy_version' => self::VERSION, 'origin_ip' => request()->ip()], JSON_THROW_ON_ERROR)]);
}
public function revokeSessions(User $subject): void
{
DB::table('users')->where('id', $subject->id)->increment('portal_access_revision');
// Invalidate remember-me as well; no password or MFA changes.
DB::table('users')->where('id', $subject->id)->update(['remember_token' => null]);
if (Schema::hasTable('sessions')) {
DB::table('sessions')->where('user_id', $subject->id)->delete();
}
if (Schema::hasTable('personal_access_tokens')) {
DB::table('personal_access_tokens')->where('tokenable_type', User::class)->where('tokenable_id', $subject->id)->delete();
}
}
}
@@ -0,0 +1 @@
import{n as e}from"./dist-BRfsww6z.js";import{t}from"./jsx-runtime-BpzPEenQ.js";import{t as n}from"./compiler-runtime-sKsOXjDo.js";import{t as r}from"./utils-CCDJ05Ll.js";import{t as i}from"./createLucideIcon-oMeAlXbs.js";import{C as a,n as o,r as s}from"./app-BcQMRTdl.js";var c=i(`Monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),l=i(`Moon`,[[`path`,{d:`M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z`,key:`a7tn18`}]]),u=i(`Sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),d=n(),f=t();function p({className:e=``,...t}){let{appearance:n,updateAppearance:i}=a(),o=[{value:`light`,icon:u,label:`Light`},{value:`dark`,icon:l,label:`Dark`},{value:`system`,icon:c,label:`System`}];return(0,f.jsx)(`div`,{className:r(`inline-flex gap-1 rounded-lg bg-neutral-100 p-1 dark:bg-neutral-800`,e),...t,children:o.map(({value:e,icon:t,label:a})=>(0,f.jsxs)(`button`,{onClick:()=>i(e),className:r(`flex items-center rounded-md px-3.5 py-1.5 transition-colors`,n===e?`bg-white shadow-xs dark:bg-neutral-700 dark:text-neutral-100`:`text-neutral-500 hover:bg-neutral-200/60 hover:text-black dark:text-neutral-400 dark:hover:bg-neutral-700/60`),children:[(0,f.jsx)(t,{className:`-ml-1 h-4 w-4`}),(0,f.jsx)(`span`,{className:`ml-1.5 text-sm`,children:a})]},e))})}function m(){let t=(0,d.c)(3),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,f.jsx)(e,{title:`Appearance settings`}),r=(0,f.jsx)(`h1`,{className:`sr-only`,children:`Appearance settings`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,f.jsxs)(f.Fragment,{children:[n,r,(0,f.jsxs)(`div`,{className:`space-y-6`,children:[(0,f.jsx)(s,{variant:`small`,title:`Appearance settings`,description:`Update the appearance settings for your account`}),(0,f.jsx)(p,{})]})]}),t[2]=i):i=t[2],i}m.layout={breadcrumbs:[{title:`Appearance settings`,href:o()}]};export{m as default};
@@ -0,0 +1 @@
import{n as e,o as t}from"./dist-BRfsww6z.js";import{t as n}from"./jsx-runtime-BpzPEenQ.js";import{t as r}from"./compiler-runtime-sKsOXjDo.js";import{u as i}from"./app-BcQMRTdl.js";import{a,i as o,r as s}from"./shared-CKR8SVWL.js";var c=r(),l=n();function u(n){let r=(0,c.c)(41),{records:u,filters:m}=n,h=m.actor_id??``,g=m.action??``,_=m.record_id??``,v=m.from??``,y=m.until??``,b;r[0]!==h||r[1]!==g||r[2]!==_||r[3]!==v||r[4]!==y?(b={actor_id:h,action:g,record_id:_,from:v,until:y},r[0]=h,r[1]=g,r[2]=_,r[3]=v,r[4]=y,r[5]=b):b=r[5];let x=t(b),S;r[6]===x.data?S=r[7]:(S=new URLSearchParams(Object.entries(x.data).filter(p)),S.set(`format`,`json`),r[6]=x.data,r[7]=S);let C,w,T,E;r[8]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,l.jsx)(e,{title:`Auditoria de acessos`}),T=(0,l.jsx)(i,{}),E=(0,l.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Auditoria de acessos e decisões`}),C=(0,l.jsx)(`p`,{children:`Consulta somente de leitura. A exportação contém metadados; não inclui credenciais, documentos nem snapshots privados decifrados. Cada exportação apresenta o limite aplicado.`}),r[8]=C,r[9]=w,r[10]=T,r[11]=E):(C=r[8],w=r[9],T=r[10],E=r[11]);let D;r[12]===x?D=r[13]:(D=e=>{e.preventDefault(),x.get(`/perfis/auditoria`)},r[12]=x,r[13]=D);let O;r[14]===Symbol.for(`react.memo_cache_sentinel`)?(O=[`actor_id`,`action`,`record_id`,`from`,`until`],r[14]=O):O=r[14];let k;r[15]===x?k=r[16]:(k=O.map(e=>(0,l.jsxs)(`label`,{children:[e,(0,l.jsx)(`input`,{className:a,type:e===`from`||e===`until`?`datetime-local`:`text`,value:x.data[e],onChange:t=>x.setData(e,t.target.value)})]},e)),r[15]=x,r[16]=k);let A;r[17]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,l.jsx)(`button`,{className:o,children:`Filtrar`}),r[17]=A):A=r[17];let j;r[18]!==D||r[19]!==k?(j=(0,l.jsxs)(`form`,{className:`grid gap-3 sm:grid-cols-3`,onSubmit:D,children:[k,A]}),r[18]=D,r[19]=k,r[20]=j):j=r[20];let M;r[21]===x.errors?M=r[22]:(M=Object.values(x.errors).map(f),r[21]=x.errors,r[22]=M);let N=`/perfis/auditoria?${S}`,P;r[23]===N?P=r[24]:(P=(0,l.jsx)(`a`,{className:`underline`,href:N,children:`Exportar metadados JSON, até 1.000 eventos`}),r[23]=N,r[24]=P);let F;r[25]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,l.jsx)(`thead`,{children:(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`th`,{children:`Data UTC`}),(0,l.jsx)(`th`,{children:`Conta`}),(0,l.jsx)(`th`,{children:`Ação`}),(0,l.jsx)(`th`,{children:`Recurso`}),(0,l.jsx)(`th`,{children:`Origem`})]})}),r[25]=F):F=r[25];let I;r[26]===u.data?I=r[27]:(I=u.data.map(d),r[26]=u.data,r[27]=I);let L;r[28]===I?L=r[29]:(L=(0,l.jsx)(`div`,{className:`overflow-auto`,children:(0,l.jsxs)(`table`,{className:`w-full`,children:[F,(0,l.jsx)(`tbody`,{children:I})]})}),r[28]=I,r[29]=L);let R;r[30]===u.data.length?R=r[31]:(R=!u.data.length&&(0,l.jsx)(`p`,{children:`Nenhum evento corresponde aos filtros.`}),r[30]=u.data.length,r[31]=R);let z;r[32]===u?z=r[33]:(z=(0,l.jsx)(s,{page:u}),r[32]=u,r[33]=z);let B;return r[34]!==j||r[35]!==M||r[36]!==P||r[37]!==L||r[38]!==R||r[39]!==z?(B=(0,l.jsxs)(`main`,{className:`space-y-6 p-6`,children:[w,T,E,C,j,M,P,L,R,z]}),r[34]=j,r[35]=M,r[36]=P,r[37]=L,r[38]=R,r[39]=z,r[40]=B):B=r[40],B}function d(e){return(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`td`,{children:e.occurred_at}),(0,l.jsx)(`td`,{children:e.actor_user_id}),(0,l.jsx)(`td`,{children:e.action}),(0,l.jsx)(`td`,{children:e.entity_type}),(0,l.jsx)(`td`,{children:e.source_system})]},e.id)}function f(e){return(0,l.jsx)(`p`,{role:`alert`,children:e},e)}function p(e){let[,t]=e;return t!==``}export{u as default};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t,t as n}from"./jsx-runtime-BpzPEenQ.js";import{a as r,i,n as a}from"./shared-CKR8SVWL.js";import{t as o}from"./operation-key-Dr4VtGxa.js";import{n as s}from"./profile-json-Bb5H6-rZ.js";var c=e(t(),1),l=n();function u(e){let[t]=(0,c.useState)(o),[n,u]=(0,c.useState)(``),[d,f]=(0,c.useState)(!1),[p,m]=(0,c.useState)(!1),[h,g]=(0,c.useState)(e.consumed),[_,v]=(0,c.useState)(``);async function y(){m(!0),v(``);try{await s(`/management/profile-install/bootstrap/`+e.approval_id+`/confirm`,{hash:e.hash,confirm:d,idempotency_key:t,reason:n}),g(!0),v(`Dupla inicializada por confirmação cruzada. Apenas estas duas contas foram designadas; nenhuma flag foi alterada. Inicie uma nova sessão.`)}catch(e){v(e instanceof Error?e.message:`Resposta indisponível. Recupere este pedido antes de repetir.`)}finally{m(!1)}}return(0,l.jsxs)(a,{title:`Confirmar os dois titulares`,children:[(0,l.jsxs)(`p`,{children:[`Base `,e.target.database,`:`,e.target.port]}),(0,l.jsxs)(`p`,{children:[`Pedido apresentado pela conta `,e.requested_by,`; confirmação reservada à conta `,e.second_user_id,`.`]}),(0,l.jsxs)(`p`,{children:[`Fundamento do pedido: `,e.reason]}),(0,l.jsxs)(`p`,{children:[`Expira em `,e.expires_at,`.`]}),(0,l.jsx)(`p`,{children:`O pedido não atribui privilégios. A confirmação é uma operação distinta, com MFA e auditoria. Não altera a regra de substituição posterior.`}),e.expired&&(0,l.jsx)(`p`,{role:`alert`,children:`Pedido expirado. Prepare novo pedido autorizado.`}),!e.code_current&&(0,l.jsx)(`p`,{role:`alert`,children:`Revisão ou destino alterados. Este pedido não pode ser confirmado.`}),!e.mfa_confirmed_in_session&&(0,l.jsx)(`p`,{role:`alert`,children:`Conclua MFA nesta sessão antes de confirmar.`}),!e.can_confirm&&!h&&(0,l.jsx)(`p`,{children:`Esta conta pode consultar, mas não confirmar o pedido.`}),(0,l.jsxs)(`label`,{className:`block`,children:[`Fundamento da confirmação`,(0,l.jsx)(`textarea`,{className:r,minLength:20,maxLength:1e3,value:n,onChange:e=>u(e.target.value)})]}),(0,l.jsxs)(`label`,{className:`block`,children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:d,onChange:e=>f(e.target.checked)}),` Confirmo apenas estas duas contas e esta base`]}),(0,l.jsx)(`button`,{className:i,disabled:p||h||!e.can_confirm||!e.mfa_confirmed_in_session||!d||n.length<20,onClick:()=>void y(),children:`Confirmar designação cruzada`}),(0,l.jsxs)(`p`,{role:`status`,children:[h?`Pedido consumido; não reinicializar. `:``,_]})]})}export{u as default};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t,u as n}from"./dist-BRfsww6z.js";import{n as r,t as i}from"./jsx-runtime-BpzPEenQ.js";import{a,i as o,n as s,s as c}from"./shared-Bux3M99i.js";import{r as l}from"./investment-territory-B6sG8qJ9.js";import{t as u}from"./business-types-SGCXhH6X.js";var d=e(r(),1),f=i();function p({results:e,filters:r,territorySelection:i=[]}){let[p,m]=(0,d.useState)(r.q??``),[h,g]=(0,d.useState)(r.modality??``),[_,v]=(0,d.useState)({province_id:r.province_id??``,district_id:r.district_id??``,admin_post_id:r.admin_post_id??``,locality_id:r.locality_id??``}),y=new URLSearchParams({...p?{q:p}:{},...h?{modality:h}:{},..._}).toString(),b=e.meta?.links??(Array.isArray(e.links)?e.links:[]);return(0,f.jsxs)(s,{title:`Oportunidades de negócio`,children:[(0,f.jsx)(`p`,{children:`Explore oportunidades aprovadas para publicação. A informação está sujeita a diligência independente.`}),(0,f.jsxs)(`form`,{className:`flex flex-wrap gap-3`,onSubmit:e=>{e.preventDefault(),n.get(`/negocios`,{q:p||void 0,modality:h||void 0,..._},{preserveState:!0,preserveScroll:!0})},children:[(0,f.jsx)(`label`,{className:`sr-only`,htmlFor:`business-search`,children:`Pesquisar negócios`}),(0,f.jsx)(`input`,{id:`business-search`,className:c,value:p,maxLength:120,onChange:e=>m(e.target.value)}),(0,f.jsxs)(`label`,{className:`grid gap-1`,children:[(0,f.jsx)(`span`,{children:`Tipo de oportunidade`}),(0,f.jsxs)(`select`,{className:c,value:h,onChange:e=>g(e.target.value),children:[(0,f.jsx)(`option`,{value:``,children:`Todos os tipos`}),Object.entries(u).map(([e,t])=>(0,f.jsx)(`option`,{value:e,children:t},e))]})]}),(0,f.jsx)(l,{initial:i,onChange:e=>v({province_id:e[0]?.id??``,district_id:e[1]?.id??``,admin_post_id:e[2]?.id??``,locality_id:e[3]?.id??``})}),(0,f.jsx)(`button`,{className:o,children:`Pesquisar`})]}),(0,f.jsxs)(`p`,{role:`status`,children:[e.meta?.total??e.data.length,` anúncios de negócios publicados`]}),!e.data.length&&(0,f.jsx)(`p`,{role:`status`,children:`Não existem oportunidades publicadas com estes critérios.`}),(0,f.jsx)(`ul`,{className:`grid gap-4 md:grid-cols-2`,children:e.data.map(e=>(0,f.jsxs)(`li`,{className:a,children:[(0,f.jsx)(`p`,{children:u[e.modality]??e.modality}),(0,f.jsx)(`h2`,{className:`text-xl font-bold`,children:(0,f.jsx)(t,{className:`underline`,href:`/negocios/${e.slug}${y?`?${y}`:``}`,children:e.title})}),(0,f.jsx)(`p`,{children:[e.sector?.name,e.province,e.stage].filter(Boolean).join(` · `)}),(e.amount_min||e.amount_max)&&(0,f.jsxs)(`p`,{children:[e.amount_min??`—`,` –`,` `,e.amount_max??`—`,` `,e.currency]}),e.objective&&(0,f.jsx)(`p`,{className:`mt-3 line-clamp-3`,children:e.objective})]},e.id))}),(0,f.jsx)(`nav`,{"aria-label":`Paginação das oportunidades`,className:`flex flex-wrap gap-3`,children:b.map(e=>e.url?(0,f.jsx)(t,{href:e.url,className:e.active?`font-bold underline`:`underline`,dangerouslySetInnerHTML:{__html:e.label}},e.label):null)})]})}export{p as default};
@@ -0,0 +1 @@
import{r as e}from"./dist-BRfsww6z.js";import{t}from"./jsx-runtime-BpzPEenQ.js";import{a as n,i as r,n as i}from"./shared-Bux3M99i.js";import{t as a}from"./business-types-SGCXhH6X.js";import{t as o}from"./partnership-source-links-VfrXk2FZ.js";var s=t();function c({record:t,returnUrl:c=`/negocios`,interestUrl:l=`/negocios/${t.slug}/manifestar-interesse`}){return(0,s.jsxs)(i,{title:t.title,children:[(0,s.jsx)(o,{type:`business`,id:t.id}),(0,s.jsx)(e,{href:c,className:`underline`,children:`Voltar às oportunidades`}),(0,s.jsxs)(`section`,{className:`${n} space-y-4`,children:[(0,s.jsx)(`p`,{children:a[t.modality]??t.modality}),(0,s.jsx)(`p`,{children:[t.sector?.name,t.stage,t.activity_code].filter(Boolean).join(` · `)}),(t.province||t.district||t.locality)&&(0,s.jsx)(`p`,{children:[t.locality,t.district,t.province].filter(Boolean).join(`, `)}),(t.amount_min||t.amount_max)&&(0,s.jsxs)(`p`,{children:[`Montante indicativo: `,t.amount_min??`—`,` –`,` `,t.amount_max??`—`,` `,t.currency]}),t.available_percentage&&(0,s.jsxs)(`p`,{children:[`Participação indicada: `,t.available_percentage,`%`]}),t.objective&&(0,s.jsxs)(`div`,{children:[(0,s.jsx)(`h2`,{className:`font-bold`,children:`Objectivo`}),(0,s.jsx)(`p`,{className:`whitespace-pre-wrap`,children:t.objective})]}),(0,s.jsx)(`p`,{className:`text-sm`,children:`A publicação não constitui garantia de titularidade, avaliação, transmissibilidade ou retorno.`}),(0,s.jsx)(e,{className:r,href:l,children:`Manifestar interesse`})]})]})}export{c as default};
@@ -0,0 +1 @@
var e={draft:`Rascunho`,submitted:`Submetido`,in_review:`Em revisão`,needs_information:`Pendente de informação`,withdrawn:`Retirado`,triage:`Triagem`,information_pending:`Informação pendente`,review:`Em revisão`,approval_l1:`Aprovação nível 1`,approval_l2:`Aprovação nível 2`,approved:`Aprovado`,published:`Publicado`,suspended:`Suspenso`,rejected:`Rejeitado`,cancelled:`Cancelado`,archived:`Arquivado`},t={company_sale:`Venda da empresa`,company_purchase:`Compra ou aquisição de empresa`,participation_sale:`Venda de participação`,capital_increase:`Aumento de capital`,financial_investor:`Investidor financeiro`,strategic_partner:`Sócio estratégico`,buyer_search:`Procura de comprador`,position_assignment:`Cessão de posição`,franchise:`Franchising`,asset_sale:`Venda de activos`,asset_lease:`Arrendamento de activos`,business_unit_transfer:`Transferência de unidade de negócio`,joint_venture:`Joint venture`,succession:`Sucessão empresarial`,recovery:`Recuperação`,expansion:`Expansão`,internationalization:`Internacionalização`,real_estate:`Imobiliário`,agricultural_investment:`Investimento agrícola`,land_right:`Direito fundiário`,mining_license:`Licença mineira`,forestry_license:`Licença florestal`,investment_project:`Projecto de investimento`,business_partnership:`Parceria empresarial`,financing_request:`Procura de financiamento`,concession_opportunity:`Concessão`,supply_opportunity:`Oportunidade de fornecimento`};export{e as n,t};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{u as t}from"./dist-BRfsww6z.js";import{n,t as r}from"./jsx-runtime-BpzPEenQ.js";import{a as i,r as a,t as o}from"./shared-Bux3M99i.js";var s=e(n(),1),c=r(),l={identity:`Identidade`,representation:`Representação`,declared_ownership:`Titularidade declarada`,documentary_ownership:`Titularidade documental`,document_received:`Documento recebido`,document_validated:`Documento validado`,independent_valuation:`Avaliação independente`,land_right_documented:`Direito fundiário documentado`,license_confirmed:`Licença confirmada`,validity:`Validade`,legal_transfer:`Transmissibilidade jurídica`,prior_authorization:`Autorização prévia`,confirmed:`Confirmado pelo revisor`,rejected:`Não confirmado`,inconclusive:`Inconclusivo`,revoked:`Revogado`,stale:`Rever após alteração dos dados`,expired:`Expirado`};function u({id:e,version:n,editable:r,checks:u,findings:d,objects:f}){let[p,m]=(0,s.useState)(!1),[h,g]=(0,s.useState)(``),[_,v]=(0,s.useState)(`inconclusive`);return(0,c.jsxs)(`section`,{className:`${i} space-y-4`,children:[(0,c.jsx)(`h2`,{className:`text-xl font-bold`,children:`Verificações e evidências`}),(0,c.jsx)(`p`,{children:`Cada conclusão corresponde apenas ao aspecto e à versão analisados. Não constitui certificação global, autorização de publicação ou garantia de transmissão. Alterações aos dados exigem nova revisão.`}),d.length===0&&(0,c.jsx)(`p`,{children:`Ainda não existem verificações registadas.`}),(0,c.jsx)(`ul`,{className:`space-y-4`,children:d.map(e=>(0,c.jsxs)(`li`,{className:`break-words`,children:[(0,c.jsxs)(`strong`,{children:[l[e.check],` ·`,` `,l[e.effective_outcome]]}),(0,c.jsxs)(`p`,{children:[f.find(t=>t.id===e.object_id)?.payload.label??`Negócio`,` `,`· versão `,e.version_no]}),(0,c.jsxs)(`p`,{children:[`Evidência: `,e.evidence_reference]}),(0,c.jsx)(`p`,{children:e.note}),e.valid_until&&(0,c.jsxs)(`p`,{children:[`Válido até `,e.valid_until]})]},e.version_no))}),r&&(0,c.jsxs)(`form`,{className:`space-y-4`,onSubmit:async r=>{r.preventDefault();let i=Object.fromEntries(new FormData(r.currentTarget));m(!0),g(``);try{await a(`/api/v1/existing-business/listings/${e}/verifications`,{...i,version_no:n}),t.reload()}catch(e){g(e instanceof Error?e.message:`Não foi possível registar a verificação.`)}finally{m(!1)}},children:[(0,c.jsxs)(`fieldset`,{disabled:p,className:`space-y-4`,children:[(0,c.jsx)(o,{label:`Elemento analisado`,children:(0,c.jsxs)(`select`,{className:`w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,name:`object_id`,children:[(0,c.jsx)(`option`,{value:``,children:`Negócio`}),f.map(e=>(0,c.jsx)(`option`,{value:e.id,children:e.payload.label},e.id))]})}),(0,c.jsx)(o,{label:`Aspecto verificado`,children:(0,c.jsx)(`select`,{className:`w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,name:`check`,children:u.map(e=>(0,c.jsx)(`option`,{value:e,children:l[e]},e))})}),(0,c.jsx)(o,{label:`Conclusão`,children:(0,c.jsx)(`select`,{className:`w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,name:`outcome`,value:_,onChange:e=>v(e.target.value),children:[`inconclusive`,`confirmed`,`rejected`,`revoked`].map(e=>(0,c.jsx)(`option`,{value:e,children:l[e]},e))})}),(0,c.jsx)(o,{label:`Referência da evidência consultada`,children:(0,c.jsx)(`textarea`,{className:`w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,name:`evidence_reference`,required:!0,minLength:10,maxLength:2e3})}),(0,c.jsx)(o,{label:`Fundamentação e limites da conclusão`,children:(0,c.jsx)(`textarea`,{className:`w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,name:`note`,required:!0,minLength:10,maxLength:2e3})}),(0,c.jsx)(o,{label:`Validade da conclusão`,children:(0,c.jsx)(`input`,{className:`w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,type:`date`,name:`valid_until`,required:_===`confirmed`})}),(0,c.jsx)(`button`,{className:`inline-flex items-center justify-center rounded-lg bg-emerald-800 px-4 py-2 font-semibold text-white disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,disabled:p,children:`Registar verificação`})]}),h&&(0,c.jsx)(`p`,{role:`alert`,children:h})]})]})}export{u as default};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{r as t,u as n}from"./dist-BRfsww6z.js";import{n as r,t as i}from"./jsx-runtime-BpzPEenQ.js";import{a,i as o,n as s,r as c,s as l,t as u}from"./shared-Bux3M99i.js";import{t as d}from"./country-select-C3BLoPPG.js";import{n as f,t as p}from"./business-types-SGCXhH6X.js";var m=e(r(),1),h=i();function g({records:e,management:r,modalities:i,filters:g,countries:_}){let[v,y]=(0,m.useState)(``),[b,x]=(0,m.useState)(i[0]),[S,C]=(0,m.useState)(``),[w,T]=(0,m.useState)(!1),[E,D]=(0,m.useState)(g.country??``),[O,k]=(0,m.useState)(g.origin??``);return(0,h.jsxs)(s,{title:r?`Revisão de negócios`:`Os meus negócios`,children:[(0,h.jsx)(`p`,{children:`Área privada de preparação e revisão. A submissão não confirma titularidade, validade ou transmissibilidade do negócio, activo ou direito.`}),(0,h.jsxs)(`form`,{className:`${a} flex flex-wrap gap-3`,onSubmit:e=>{e.preventDefault(),n.get(r?`/management/negocios`:`/investidor/negocios`,{country:E,origin:O})},children:[(0,h.jsx)(d,{countries:_,value:E,onChange:D,label:`Filtrar país do proponente`}),(0,h.jsxs)(`label`,{children:[`Origem declarada`,(0,h.jsxs)(`select`,{"aria-label":`Filtrar origem declarada`,className:l,value:O,onChange:e=>k(e.target.value),children:[(0,h.jsx)(`option`,{value:``,children:`Todas`}),(0,h.jsx)(`option`,{value:`unknown`,children:`Não informada`}),_.map(e=>(0,h.jsxs)(`option`,{value:e.code,children:[e.name,` (`,e.code,`)`]},e.code))]})]}),(0,h.jsx)(`button`,{className:o,children:`Filtrar negócios`})]}),!r&&(0,h.jsxs)(`form`,{className:`rounded-xl border border-slate-200 bg-white p-5 shadow-sm space-y-4`,onSubmit:async e=>{e.preventDefault(),T(!0),C(``);try{let e=await c(`/api/v1/existing-business/listings`,{modality:b,classification:`confidential`,reason:`Criação de rascunho pelo proprietário`,payload:{title:v,wizard_version:`1`,wizard_step:`1`}});n.visit(`/investidor/negocios/${e.id}`)}catch(e){C(e instanceof Error?e.message:`Não foi possível criar o rascunho.`)}finally{T(!1)}},children:[(0,h.jsx)(`h2`,{className:`text-xl font-bold`,children:`Preparar negócio`}),(0,h.jsx)(u,{label:`Título privado`,children:(0,h.jsx)(`input`,{className:`w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,value:v,onChange:e=>y(e.target.value),required:!0,maxLength:200})}),(0,h.jsx)(u,{label:`Modalidade`,children:(0,h.jsx)(`select`,{className:`w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,value:b,onChange:e=>x(e.target.value),children:i.map(e=>(0,h.jsx)(`option`,{value:e,children:p[e]??e},e))})}),S&&(0,h.jsx)(`p`,{role:`alert`,children:S}),(0,h.jsx)(`button`,{className:`inline-flex items-center justify-center rounded-lg bg-emerald-800 px-4 py-2 font-semibold text-white disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,disabled:w,children:w?`A criar…`:`Criar rascunho privado`})]}),!e.data.length&&(0,h.jsx)(`p`,{role:`status`,children:`Não existem negócios nesta lista.`}),e.data.map(e=>(0,h.jsxs)(`article`,{className:a,children:[(0,h.jsx)(t,{className:`font-bold underline`,href:`/investidor/negocios/${e.id}`,children:e.payload.title}),(0,h.jsxs)(`p`,{children:[p[e.modality],` ·`,` `,f[e.status],` · versão `,e.version_no]})]},e.id)),(0,h.jsxs)(`nav`,{"aria-label":`Paginação dos negócios`,className:`flex gap-4`,children:[e.prev_page_url&&(0,h.jsx)(t,{href:e.prev_page_url,children:`Anterior`}),e.next_page_url&&(0,h.jsx)(t,{href:e.next_page_url,children:`Seguinte`})]})]})}export{g as default};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t,t as n}from"./jsx-runtime-BpzPEenQ.js";import{r,t as i}from"./utils-CCDJ05Ll.js";var a=e(t(),1),o=Object.defineProperty,s=(e,t)=>o(e,`name`,{value:t,configurable:!0});function c(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}s(c,`setRef`);function l(...e){return t=>{let n=!1,r=e.map(e=>{let r=c(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():c(e[t],null)}}}}s(l,`composeRefs`);function u(...e){return a.useCallback(l(...e),e)}s(u,`useComposedRefs`);var d=Object.defineProperty,f=(e,t)=>d(e,`name`,{value:t,configurable:!0});function p(e){let t=a.forwardRef((t,n)=>{let{children:r,...i}=t,o=null,s=!1,c=[];S(r)&&typeof E==`function`&&(r=E(r._payload)),a.Children.forEach(r,e=>{if(b(e)){s=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;S(n)&&typeof E==`function`&&(n=E(n._payload)),o=_(t,n),c.push(o?.props?.children)}else c.push(e)}),o?o=a.cloneElement(o,void 0,c):!s&&a.Children.count(r)===1&&a.isValidElement(r)&&(o=r);let l=o?y(o):void 0,d=u(n,l);if(!o){if(r||r===0)throw Error(s?T(e):w(e));return r}let f=v(i,o.props??{});return o.type!==a.Fragment&&(f.ref=n?d:l),a.cloneElement(o,f)});return t.displayName=`${e}.Slot`,t}f(p,`createSlot`);var m=p(`Slot`),h=Symbol.for(`radix.slottable`);function g(e){let t=f(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=h,t}f(g,`createSlottable`);var _=f((e,t)=>{if(`child`in e.props){let t=e.props.child;return a.isValidElement(t)?a.cloneElement(t,void 0,e.props.children(t.props.children)):null}return a.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function v(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}f(v,`mergeProps`);function y(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}f(y,`getElementRef`);function b(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===h}f(b,`isSlottable`);var x=Symbol.for(`react.lazy`);function S(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===x&&`_payload`in e&&C(e._payload)}f(S,`isLazyComponent`);function C(e){return typeof e==`object`&&!!e&&`then`in e}f(C,`isPromiseLike`);var w=f(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),T=f(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),E=a.use,D=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,O=r,k=(e,t)=>n=>{if(t?.variants==null)return O(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=D(t)||D(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return O(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},A=n(),j=k(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[color,box-shadow] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow-xs hover:bg-primary/90`,destructive:`bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40`,outline:`border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2 has-[>svg]:px-3`,sm:`h-8 rounded-md px-3 has-[>svg]:px-2.5`,lg:`h-10 rounded-md px-6 has-[>svg]:px-4`,icon:`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function M({className:e,variant:t,size:n,asChild:r=!1,...a}){return(0,A.jsx)(r?m:`button`,{"data-slot":`button`,className:i(j({variant:t,size:n,className:e})),...a})}export{g as a,p as i,k as n,u as o,m as r,M as t};
@@ -0,0 +1 @@
import{o as e,r as t}from"./dist-BRfsww6z.js";import{t as n}from"./jsx-runtime-BpzPEenQ.js";import{a as r,i,n as a,r as o,s}from"./shared-CKR8SVWL.js";var c=n();function l({resource:n,records:l,filters:u,sectors:d,geographyReviewCount:f=0}){let p=e({q:u.q??``,status:u.status??``,sector_id:String(u.sector_id??``),geography_scope:u.geography_scope??``});return(0,c.jsxs)(a,{title:n===`sectors`?`Sectores`:`Oportunidades`,children:[(0,c.jsxs)(t,{className:i,href:`/management/${n}/create`,children:[`Criar `,n===`sectors`?`sector`:`oportunidade`]}),n===`opportunities`&&(0,c.jsxs)(`p`,{role:`status`,className:`my-3`,children:[f,` oportunidade(s) aguardam confirmação do âmbito geográfico. A lista não altera localizações; confirme apenas com fontes existentes.`]}),(0,c.jsxs)(`form`,{className:`flex flex-wrap gap-3`,onSubmit:e=>{e.preventDefault(),p.get(`/management/${n}`,{preserveState:!1})},children:[(0,c.jsx)(`input`,{"aria-label":`Pesquisar catálogo`,placeholder:`Nome, título, referência ou slug`,className:`${r} max-w-sm`,value:p.data.q,onChange:e=>p.setData(`q`,e.target.value),maxLength:150}),(0,c.jsxs)(`select`,{"aria-label":`Estado`,className:`${r} max-w-xs`,value:p.data.status,onChange:e=>p.setData(`status`,e.target.value),children:[(0,c.jsx)(`option`,{value:``,children:`Todos os estados`}),(n===`sectors`?[`active`,`inactive`]:[`draft`,`published`,`archived`]).map(e=>(0,c.jsx)(`option`,{value:e,children:e===`active`?`Activo`:e===`inactive`?`Inactivo`:s[e]},e))]}),n===`opportunities`&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`select`,{"aria-label":`Sector`,className:`w-full rounded-md border border-input bg-background p-2 text-foreground max-w-xs`,value:p.data.sector_id,onChange:e=>p.setData(`sector_id`,e.target.value),children:[(0,c.jsx)(`option`,{value:``,children:`Todos os sectores`}),d.map(e=>(0,c.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,c.jsxs)(`select`,{"aria-label":`Âmbito geográfico`,className:`w-full rounded-md border border-input bg-background p-2 text-foreground max-w-xs`,value:p.data.geography_scope,onChange:e=>p.setData(`geography_scope`,e.target.value),children:[(0,c.jsx)(`option`,{value:``,children:`Todos os âmbitos`}),(0,c.jsx)(`option`,{value:`unspecified`,children:`Pendente de confirmação`}),(0,c.jsx)(`option`,{value:`specific`,children:`Localização específica`}),(0,c.jsx)(`option`,{value:`multiple`,children:`Várias localizações`}),(0,c.jsx)(`option`,{value:`national`,children:`Âmbito nacional`}),(0,c.jsx)(`option`,{value:`digital`,children:`Digital/sem instalação definida`})]})]}),(0,c.jsx)(`button`,{className:i,disabled:p.processing,children:`Pesquisar`}),(0,c.jsx)(t,{className:`p-2 underline`,href:`/management/${n}`,children:`Limpar filtros`}),Object.values(p.errors).map(e=>(0,c.jsx)(`p`,{role:`alert`,className:`w-full text-red-600`,children:e},e))]}),(0,c.jsx)(`div`,{className:`space-y-3`,children:l.data.map(e=>(0,c.jsxs)(`article`,{className:`flex flex-wrap items-center justify-between gap-3 rounded border p-4`,children:[(0,c.jsxs)(`div`,{children:[(0,c.jsx)(`h2`,{className:`font-semibold`,children:e.name??e.title}),(0,c.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[e.reference??e.slug,` ·`,` `,n===`sectors`?e.is_active?`Activo`:`Inactivo`:s[e.status??`draft`]]}),n===`opportunities`&&e.geography_scope===`unspecified`&&(0,c.jsxs)(`p`,{className:`mt-1 text-sm`,children:[`Pendente de confirmação; território já registado:`,` `,e.primary_territory?.name??`nenhum`,`. Fonte do território:`,` `,e.primary_territory?.source_system??`não indicada`,e.primary_territory?.source_code?`, código ${e.primary_territory.source_code}`:``,`. A classificação não é alterada automaticamente.`]})]}),(0,c.jsx)(t,{className:`underline`,href:`/management/${n}/${e.id}/edit`,children:`Editar`})]},e.id))}),!l.data.length&&(0,c.jsx)(`p`,{children:`Nenhum registo encontrado.`}),(0,c.jsx)(o,{page:l})]})}export{l as default};
@@ -0,0 +1 @@
import{r as e}from"./dist-BRfsww6z.js";import{t}from"./jsx-runtime-BpzPEenQ.js";import{t as n}from"./compiler-runtime-sKsOXjDo.js";import{a as r,n as i}from"./shared-Bux3M99i.js";var a=n(),o=t();function s(t){let n=(0,a.c)(14),{installed:r,services:s,prepared:d}=t,f;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,o.jsx)(`p`,{children:`Preparação e acompanhamento internos; a decisão oficial pertence à entidade competente.`}),n[0]=f):f=n[0];let p=r?`/balcao-virtual/painel`:`/balcao-virtual`,m=r?`Abrir o painel e preparar um pedido`:`Consultar pedidos existentes`,h;n[1]!==p||n[2]!==m?(h=(0,o.jsx)(e,{href:p,className:`underline`,children:m}),n[1]=p,n[2]=m,n[3]=h):h=n[3];let g;n[4]===r?g=n[5]:(g=!r&&(0,o.jsx)(`p`,{children:`Melhorias preparadas; a instalação autenticada e a publicação explícita dos serviços continuam pendentes.`}),n[4]=r,n[5]=g);let _;n[6]!==r||n[7]!==d||n[8]!==s?(_=(r?s.map(u):Object.values(d).map(l)).map(c),n[6]=r,n[7]=d,n[8]=s,n[9]=_):_=n[9];let v;return n[10]!==h||n[11]!==g||n[12]!==_?(v=(0,o.jsxs)(i,{title:`Serviços do Balcão Virtual`,children:[f,h,g,_]}),n[10]=h,n[11]=g,n[12]=_,n[13]=v):v=n[13],v}function c(e){return(0,o.jsxs)(`article`,{className:r,children:[(0,o.jsx)(`h2`,{className:`text-xl font-bold`,children:e.title}),(0,o.jsx)(`p`,{children:e.result}),(0,o.jsx)(`p`,{children:e.version?`Versão ${e.version}`:`Preparado, ainda indisponível para novos pedidos`})]},e.title)}function l(e){return{...e,version:null}}function u(e){return{...e.definition,version:e.version}}export{s as default};
@@ -0,0 +1 @@
import{t as e}from"./createLucideIcon-oMeAlXbs.js";var t=e(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);export{t};
@@ -0,0 +1 @@
import{t as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./jsx-runtime-BpzPEenQ.js";var n=e((e=>{var n=t().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return n.H.useMemoCache(e)}})),r=e(((e,t)=>{t.exports=n()}));export{r as t};
@@ -0,0 +1 @@
import{n as e}from"./wayfinder-Dp7PqxvV.js";var t=e=>({url:t.url(e),method:`post`});t.definition={methods:[`post`],url:`/user/confirm-password`},t.url=n=>t.definition.url+e(n),t.post=e=>({url:t.url(e),method:`post`});var n=e=>({action:t.url(e),method:`post`});n.post=e=>({action:t.url(e),method:`post`}),t.form=n;var r={store:Object.assign(t,t)};export{t as n,r as t};
@@ -0,0 +1 @@
import{n as e,t}from"./dist-BRfsww6z.js";import{t as n}from"./jsx-runtime-BpzPEenQ.js";import{t as r}from"./compiler-runtime-sKsOXjDo.js";import{t as i}from"./button-DAU4R6e9.js";import{t as a}from"./password-input-ytrVyGCI.js";import{n as o}from"./wayfinder-Dp7PqxvV.js";import{t as s}from"./input-error-U1QKS0ED.js";import{t as c}from"./label-D-C_NQs4.js";import{t as l}from"./spinner-hD8hHC_m.js";import{n as u}from"./confirm-Culw9Q-x.js";import{t as d}from"./passkey-verify-CTDJARa-.js";var f=r(),p=e=>({url:p.url(e),method:`get`});p.definition={methods:[`get`,`head`],url:`/passkeys/confirm/options`},p.url=e=>p.definition.url+o(e),p.get=e=>({url:p.url(e),method:`get`}),p.head=e=>({url:p.url(e),method:`head`});var m=e=>({action:p.url(e),method:`get`});m.get=e=>({action:p.url(e),method:`get`}),m.head=e=>({action:p.url({[e?.mergeQuery?`mergeQuery`:`query`]:{_method:`HEAD`,...e?.query??e?.mergeQuery??{}}}),method:`get`}),p.form=m;var h=e=>({url:h.url(e),method:`post`});h.definition={methods:[`post`],url:`/passkeys/confirm`},h.url=e=>h.definition.url+o(e),h.post=e=>({url:h.url(e),method:`post`});var g=e=>({action:h.url(e),method:`post`});g.post=e=>({action:h.url(e),method:`post`}),h.form=g;var _=n();function v(){let n=(0,f.c)(3),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,_.jsx)(e,{title:`Confirm password`}),n[0]=r):r=n[0];let i;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,_.jsx)(d,{routes:{options:p(),submit:h()},label:`Confirm with passkey`,loadingLabel:`Confirming...`,separator:`Or confirm with password`}),n[1]=i):i=n[1];let a;return n[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,_.jsxs)(_.Fragment,{children:[r,i,(0,_.jsx)(t,{...u.form(),resetOnSuccess:[`password`],children:y})]}),n[2]=a):a=n[2],a}function y(e){let{processing:t,errors:n}=e;return(0,_.jsxs)(`div`,{className:`space-y-6`,children:[(0,_.jsxs)(`div`,{className:`grid gap-2`,children:[(0,_.jsx)(c,{htmlFor:`password`,children:`Password`}),(0,_.jsx)(a,{id:`password`,name:`password`,placeholder:`Password`,autoComplete:`current-password`,autoFocus:!0}),(0,_.jsx)(s,{message:n.password})]}),(0,_.jsx)(`div`,{className:`flex items-center`,children:(0,_.jsxs)(i,{className:`w-full`,disabled:t,"data-test":`confirm-password-button`,children:[t&&(0,_.jsx)(l,{}),`Confirm password`]})})]})}v.layout={title:`Confirm password`,description:`This is a secure area of the application. Please confirm your password before continuing.`};export{v as default};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{o as t}from"./dist-BRfsww6z.js";import{n,t as r}from"./jsx-runtime-BpzPEenQ.js";import{t as i}from"./compiler-runtime-sKsOXjDo.js";import{a,r as o,s,t as c}from"./shared-Bux3M99i.js";import{a as l}from"./portal-api-tEuwFTsU.js";var u=i(),d=e(n(),1),f=r();function p(e){let n=(0,u.c)(26),{id:r,messages:i,submitted:p,revisions:v}=e,y;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(y={client_key:l(),body:``},n[0]=y):y=n[0];let b=t(y),[x,S]=(0,d.useState)(null),[C,w]=(0,d.useState)(``),T;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,f.jsx)(`h2`,{className:`text-xl font-bold`,children:`Versões guardadas`}),n[1]=T):T=n[1];let E;n[2]===r?E=n[3]:(E=e=>{if(w(``),!e.target.value){S(null);return}o(`/api/v1/investment/submissions/${r}/revisions/${e.target.value}`).then(S).catch(()=>w(`Não foi possível consultar esta versão.`))},n[2]=r,n[3]=E);let D;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,f.jsx)(`option`,{value:``,children:`Seleccionar versão`}),n[4]=D):D=n[4];let O;n[5]===v?O=n[6]:(O=v.map(_),n[5]=v,n[6]=O);let k;n[7]!==E||n[8]!==O?(k=(0,f.jsx)(c,{label:`Consultar versão`,children:(0,f.jsxs)(`select`,{className:s,defaultValue:``,onChange:E,children:[D,O]})}),n[7]=E,n[8]=O,n[9]=k):k=n[9];let A;n[10]===C?A=n[11]:(A=C&&(0,f.jsx)(`p`,{role:`alert`,children:C}),n[10]=C,n[11]=A);let j;n[12]===x?j=n[13]:(j=x&&(0,f.jsxs)(`div`,{className:`space-y-2`,children:[(0,f.jsxs)(`h3`,{className:`font-bold`,children:[`Versão `,x.version]}),(0,f.jsxs)(`p`,{children:[`Investidor: `,x.snapshot.payload.full_name]}),(0,f.jsxs)(`p`,{children:[`Empresa:`,` `,x.snapshot.payload.organisation||`Não indicada`]}),(0,f.jsxs)(`p`,{className:`whitespace-pre-line`,children:[`Objectivo:`,` `,x.snapshot.payload.objective||`Não indicado`]}),(0,f.jsxs)(`p`,{children:[`Prazo:`,` `,x.snapshot.payload.horizon||`Não indicado`]}),(0,f.jsx)(`ul`,{children:x.snapshot.needs.map(g)}),(0,f.jsxs)(`p`,{children:[x.snapshot.attachment_ids.length,` anexos associados nessa versão.`]})]}),n[12]=x,n[13]=j);let M;n[14]!==k||n[15]!==A||n[16]!==j?(M=(0,f.jsxs)(`section`,{className:a+` space-y-4`,children:[T,k,A,j]}),n[14]=k,n[15]=A,n[16]=j,n[17]=M):M=n[17];let N;n[18]!==b||n[19]!==r||n[20]!==i||n[21]!==p?(N=p&&(0,f.jsxs)(`section`,{className:`rounded-xl border border-slate-200 bg-white p-5 shadow-sm space-y-4`,children:[(0,f.jsx)(`h2`,{className:`text-xl font-bold`,children:`Conversa com o apoio`}),(0,f.jsx)(`p`,{children:`As mensagens ficam registadas neste pedido e são visíveis ao investidor e à equipa autorizada.`}),i.map(h),!i.length&&(0,f.jsx)(`p`,{children:`Ainda não existem mensagens neste pedido.`}),(0,f.jsxs)(`form`,{className:`space-y-3`,onSubmit:e=>{e.preventDefault(),b.post(`/investidor/manifestacoes/${r}/messages`,{preserveScroll:!0,onSuccess:()=>b.setData({client_key:l(),body:``})})},children:[(0,f.jsx)(c,{label:`Mensagem para acompanhamento`,children:(0,f.jsx)(`textarea`,{className:`w-full rounded-lg border border-slate-300 bg-white px-3 py-2 text-slate-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,rows:4,required:!0,minLength:3,maxLength:5e3,value:b.data.body,onChange:e=>b.setData(`body`,e.target.value)})}),Object.entries(b.errors).map(m),(0,f.jsx)(`button`,{className:`inline-flex items-center justify-center rounded-lg bg-emerald-800 px-4 py-2 font-semibold text-white disabled:opacity-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-emerald-700`,disabled:b.processing,children:`Enviar mensagem`})]})]}),n[18]=b,n[19]=r,n[20]=i,n[21]=p,n[22]=N):N=n[22];let P;return n[23]!==N||n[24]!==M?(P=(0,f.jsxs)(f.Fragment,{children:[M,N]}),n[23]=N,n[24]=M,n[25]=P):P=n[25],P}function m(e){let[t,n]=e;return(0,f.jsx)(`p`,{role:`alert`,children:n},t)}function h(e){return(0,f.jsxs)(`article`,{className:`rounded-lg border p-4`,children:[(0,f.jsxs)(`p`,{className:`font-semibold`,children:[e.sender_role===`support`?`Apoio ao Investidor`:`Investidor`,` `,`·`,` `,new Date(e.created_at).toLocaleString(`pt-MZ`)]}),(0,f.jsx)(`p`,{className:`mt-2 whitespace-pre-line`,children:e.body})]},e.id)}function g(e,t){return(0,f.jsx)(`li`,{children:e.details.description},t)}function _(e){return(0,f.jsxs)(`option`,{value:e.version,children:[`Versão `,e.version,` —`,` `,new Date(e.created_at).toLocaleString(`pt-MZ`)]},e.version)}export{p as Conversation};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t,t as n}from"./jsx-runtime-BpzPEenQ.js";var r=e(t(),1),i=n();function a({countries:e,value:t,onChange:n,id:a,disabled:o=!1,label:s=`País`,required:c=!1,allowLegacyValue:l=!1,error:u}){let d=(0,r.useId)(),[f,p]=(0,r.useState)(``),m=e.filter(e=>e.code===t||`${e.name} ${e.name_en} ${e.code}`.normalize(`NFD`).replace(/\p{Diacritic}/gu,``).toLowerCase().includes(f.normalize(`NFD`).replace(/\p{Diacritic}/gu,``).toLowerCase()));return(0,i.jsxs)(`div`,{className:`space-y-2`,children:[(0,i.jsx)(`input`,{disabled:o,className:`w-full rounded border p-2`,"aria-label":`Pesquisar ${s.toLowerCase()}`,maxLength:100,value:f,onChange:e=>p(e.target.value),placeholder:`Pesquisar nome ou código do país`}),(0,i.jsxs)(`select`,{disabled:o,id:a??d,"aria-label":s,"aria-invalid":!!u,"aria-describedby":u?(a??d)+`-error`:void 0,required:c,className:`w-full rounded border p-2`,value:t,onChange:e=>n(e.target.value),children:[(0,i.jsx)(`option`,{value:``,children:`Não informado`}),l&&t&&!e.some(e=>e.code===t)&&(0,i.jsxs)(`option`,{value:t,children:[t,` (valor anterior conservado)`]}),m.map(e=>(0,i.jsxs)(`option`,{value:e.code,children:[e.name,` (`,e.code,`)`]},e.code))]}),u&&(0,i.jsx)(`p`,{id:(a??d)+`-error`,role:`alert`,className:`text-red-700`,children:u}),m.length===0&&(0,i.jsx)(`p`,{role:`status`,children:`Nenhum país corresponde à pesquisa.`})]})}export{a as t};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./jsx-runtime-BpzPEenQ.js";var n=e(t(),1),r=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),i=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),a={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},o=(0,n.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:s=``,children:c,iconNode:l,...u},d)=>(0,n.createElement)(`svg`,{ref:d,...a,width:t,height:t,stroke:e,strokeWidth:o?Number(r)*24/Number(t):r,className:i(`lucide`,s),...u},[...l.map(([e,t])=>(0,n.createElement)(e,t)),...Array.isArray(c)?c:[c]])),s=(e,t)=>{let a=(0,n.forwardRef)(({className:a,...s},c)=>(0,n.createElement)(o,{ref:c,iconNode:t,className:i(`lucide-${r(e)}`,a),...s}));return a.displayName=`${e}`,a};export{s as t};
@@ -0,0 +1 @@
import{r as e,u as t}from"./dist-BRfsww6z.js";import{t as n}from"./jsx-runtime-BpzPEenQ.js";import{t as r}from"./compiler-runtime-sKsOXjDo.js";import{Frame as i,button as a,labels as o}from"./shared-CANbkD3F.js";var s=r(),c=n();function l(t){let n=(0,s.c)(23),r,o;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,c.jsx)(`h2`,{className:`mb-4 text-xl font-bold`,children:`Ideias e propostas`}),o=(0,c.jsx)(e,{className:a,href:`/parcerias/criar`,children:`Preparar uma parceria`}),n[0]=r,n[1]=o):(r=n[0],o=n[1]);let l;n[2]===t.mine?l=n[3]:(l=t.mine.map(p),n[2]=t.mine,n[3]=l);let m;n[4]===l?m=n[5]:(m=(0,c.jsxs)(`section`,{children:[r,o,l]}),n[4]=l,n[5]=m);let h;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,c.jsx)(`h2`,{className:`text-xl font-bold`,children:`As minhas candidaturas`}),n[6]=h):h=n[6];let g;n[7]===t.interests?g=n[8]:(g=t.interests.map(f),n[7]=t.interests,n[8]=g);let _;n[9]===g?_=n[10]:(_=(0,c.jsxs)(`section`,{children:[h,g]}),n[9]=g,n[10]=_);let v;n[11]===t.moderation?v=n[12]:(v=t.moderation.length>0&&(0,c.jsxs)(`section`,{children:[(0,c.jsx)(`h2`,{className:`text-xl font-bold`,children:`Fila de moderação`}),t.moderation.map(d)]}),n[11]=t.moderation,n[12]=v);let y;n[13]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,c.jsx)(`h2`,{className:`text-xl font-bold`,children:`Notificações no portal`}),n[13]=y):y=n[13];let b;n[14]===t.notifications?b=n[15]:(b=t.notifications.map(u),n[14]=t.notifications,n[15]=b);let x;n[16]===b?x=n[17]:(x=(0,c.jsxs)(`section`,{children:[y,b]}),n[16]=b,n[17]=x);let S;return n[18]!==x||n[19]!==m||n[20]!==_||n[21]!==v?(S=(0,c.jsx)(i,{title:`O meu painel de parcerias`,children:(0,c.jsxs)(`div`,{className:`space-y-8`,children:[m,_,v,x]})}),n[18]=x,n[19]=m,n[20]=_,n[21]=v,n[22]=S):S=n[22],S}function u(n){return(0,c.jsxs)(`article`,{className:`my-3 rounded border p-3`,children:[(0,c.jsx)(e,{href:n.href,className:`underline`,children:n.title}),!n.read_at&&(0,c.jsx)(`button`,{className:`ml-4 underline`,onClick:()=>t.post(`/parcerias/notificacoes/`+n.id+`/ler`),children:`Marcar como lida`})]},n.id)}function d(t){return(0,c.jsx)(`p`,{children:(0,c.jsxs)(e,{className:`underline`,href:`/parcerias/`+t.id,children:[t.title,` · `,o[t.status]]})},t.id)}function f(t){return(0,c.jsxs)(`article`,{className:`my-4 rounded border p-4`,children:[(0,c.jsx)(e,{className:`underline`,href:`/parcerias/`+t.partnership_id,children:t.title}),(0,c.jsxs)(`p`,{children:[o[t.status],` · `,t.decision_reason]}),t.room_id&&(0,c.jsx)(e,{className:`inline-flex rounded bg-emerald-800 px-4 py-2 text-white disabled:opacity-50`,href:`/parcerias/salas/`+t.room_id,children:`Abrir conexão privada`})]},t.id)}function p(t){return(0,c.jsxs)(`article`,{className:`mt-4 rounded border p-4`,children:[(0,c.jsx)(e,{className:`font-semibold underline`,href:`/parcerias/`+t.id,children:t.title||`Ideia sem título`}),(0,c.jsx)(`p`,{children:o[t.status]??t.status}),(0,c.jsxs)(`p`,{children:[`Próxima ação:`,` `,[`draft`,`returned`,`rejected`].includes(t.status)?`Completar e pré-visualizar para submissão`:t.status===`published`?`Consultar candidatos e esclarecer pendências`:`Acompanhar a decisão`]})]},t.id)}export{l as default};
@@ -0,0 +1 @@
import"./rolldown-runtime-Dd_uD5pT.js";import{n as e,t}from"./jsx-runtime-BpzPEenQ.js";import{t as n}from"./compiler-runtime-sKsOXjDo.js";import{t as r}from"./utils-CCDJ05Ll.js";import{_ as i,d as a,f as o,g as s,h as c,m as l,p as u,v as d,x as f}from"./app-BcQMRTdl.js";var p=n();e();var m=t();function h(e){let t=(0,p.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,m.jsx)(a,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function g(e){let t=(0,p.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,m.jsx)(d,{"data-slot":`dialog-trigger`,...n}),t[2]=n,t[3]=r),r}function _(e){let t=(0,p.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,m.jsx)(s,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function v(e){let t=(0,p.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,m.jsx)(o,{"data-slot":`dialog-close`,...n}),t[2]=n,t[3]=r),r}function y(e){let t=(0,p.c)(8),n,i;t[0]===e?(n=t[1],i=t[2]):({className:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=r(`data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,m.jsx)(c,{"data-slot":`dialog-overlay`,className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function b(e){let t=(0,p.c)(12),n,i,a;t[0]===e?(n=t[1],i=t[2],a=t[3]):({className:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=i,t[3]=a);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,m.jsx)(y,{}),t[4]=s):s=t[4];let c;t[5]===i?c=t[6]:(c=r(`bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg`,i),t[5]=i,t[6]=c);let l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,m.jsxs)(o,{className:`ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,m.jsx)(f,{}),(0,m.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[7]=l):l=t[7];let d;return t[8]!==n||t[9]!==a||t[10]!==c?(d=(0,m.jsxs)(_,{"data-slot":`dialog-portal`,children:[s,(0,m.jsxs)(u,{"data-slot":`dialog-content`,className:c,...a,children:[n,l]})]}),t[8]=n,t[9]=a,t[10]=c,t[11]=d):d=t[11],d}function x(e){let t=(0,p.c)(8),n,i;t[0]===e?(n=t[1],i=t[2]):({className:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=r(`flex flex-col gap-2 text-center sm:text-left`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,m.jsx)(`div`,{"data-slot":`dialog-header`,className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function S(e){let t=(0,p.c)(8),n,i;t[0]===e?(n=t[1],i=t[2]):({className:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=r(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,m.jsx)(`div`,{"data-slot":`dialog-footer`,className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}function C(e){let t=(0,p.c)(8),n,a;t[0]===e?(n=t[1],a=t[2]):({className:n,...a}=e,t[0]=e,t[1]=n,t[2]=a);let o;t[3]===n?o=t[4]:(o=r(`text-lg leading-none font-semibold`,n),t[3]=n,t[4]=o);let s;return t[5]!==a||t[6]!==o?(s=(0,m.jsx)(i,{"data-slot":`dialog-title`,className:o,...a}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function w(e){let t=(0,p.c)(8),n,i;t[0]===e?(n=t[1],i=t[2]):({className:n,...i}=e,t[0]=e,t[1]=n,t[2]=i);let a;t[3]===n?a=t[4]:(a=r(`text-muted-foreground text-sm`,n),t[3]=n,t[4]=a);let o;return t[5]!==i||t[6]!==a?(o=(0,m.jsx)(l,{"data-slot":`dialog-description`,className:a,...i}),t[5]=i,t[6]=a,t[7]=o):o=t[7],o}export{S as a,g as c,w as i,v as n,x as o,b as r,C as s,h as t};
@@ -0,0 +1 @@
function e(e,t=``){return typeof e==`string`?e:typeof e==`number`&&Number.isFinite(e)||typeof e==`boolean`?String(e):t}export{e as t};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{l as t}from"./dist-BRfsww6z.js";import{n,t as r}from"./jsx-runtime-BpzPEenQ.js";import{i}from"./button-DAU4R6e9.js";var a=e(n(),1),o=e(t(),1),s=r(),c=Object.defineProperty,l=(e,t)=>c(e,`name`,{value:t,configurable:!0}),u=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=i(`Primitive.${t}`),r=a.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,s.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function d(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))}l(d,`dispatchDiscreteCustomEvent`);export{d as n,u as t};
@@ -0,0 +1,61 @@
@font-face {
font-family: "Instrument Sans";
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("/build/assets/instrument-sans-400-normal-DRC__1Mx.woff2") format("woff2");
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
font-family: "Instrument Sans";
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("/build/assets/instrument-sans-400-normal-D1W7dsQl.woff") format("woff");
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
font-family: "Instrument Sans";
font-style: normal;
font-weight: 500;
font-display: swap;
src: url("/build/assets/instrument-sans-500-normal-Dk9ku72i.woff2") format("woff2");
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
font-family: "Instrument Sans";
font-style: normal;
font-weight: 500;
font-display: swap;
src: url("/build/assets/instrument-sans-500-normal-Z6ESRlEs.woff") format("woff");
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
font-family: "Instrument Sans";
font-style: normal;
font-weight: 600;
font-display: swap;
src: url("/build/assets/instrument-sans-600-normal-B7fBEWYG.woff2") format("woff2");
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
font-family: "Instrument Sans";
font-style: normal;
font-weight: 600;
font-display: swap;
src: url("/build/assets/instrument-sans-600-normal-B9e8oLYv.woff") format("woff");
unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
:root {
--font-instrument-sans: "Instrument Sans";
}
.font-instrument-sans {
font-family: var(--font-instrument-sans);
}
@@ -0,0 +1 @@
import{n as e,t}from"./dist-BRfsww6z.js";import{t as n}from"./jsx-runtime-BpzPEenQ.js";import{t as r}from"./compiler-runtime-sKsOXjDo.js";import{t as i}from"./button-DAU4R6e9.js";import{t as a}from"./loader-circle-DS8Tf4er.js";import{b as o,s}from"./app-BcQMRTdl.js";import{t as c}from"./input-error-U1QKS0ED.js";import{t as l}from"./label-D-C_NQs4.js";import{t as u}from"./text-link-BBvcP60s.js";import{t as d}from"./password-CB_NxgQN.js";var f=r(),p=n();function m(n){let r=(0,f.c)(8),{status:i}=n,a;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,p.jsx)(e,{title:`Forgot password`}),r[0]=a):a=r[0];let o;r[1]===i?o=r[2]:(o=i&&(0,p.jsx)(`div`,{className:`mb-4 text-center text-sm font-medium text-green-600`,children:i}),r[1]=i,r[2]=o);let c;r[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,p.jsx)(t,{...d.form(),children:h}),r[3]=c):c=r[3];let l;r[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,p.jsx)(`span`,{children:`Or, return to`}),r[4]=l):l=r[4];let m;r[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,p.jsxs)(`div`,{className:`space-y-6`,children:[c,(0,p.jsxs)(`div`,{className:`text-muted-foreground space-x-1 text-center text-sm`,children:[l,(0,p.jsx)(u,{href:s(),children:`log in`})]})]}),r[5]=m):m=r[5];let g;return r[6]===o?g=r[7]:(g=(0,p.jsxs)(p.Fragment,{children:[a,o,m]}),r[6]=o,r[7]=g),g}function h(e){let{processing:t,errors:n}=e;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(`div`,{className:`grid gap-2`,children:[(0,p.jsx)(l,{htmlFor:`email`,children:`Email address`}),(0,p.jsx)(o,{id:`email`,type:`email`,name:`email`,autoComplete:`off`,autoFocus:!0,placeholder:`email@example.com`}),(0,p.jsx)(c,{message:n.email})]}),(0,p.jsx)(`div`,{className:`my-6 flex items-center justify-start`,children:(0,p.jsxs)(i,{className:`w-full`,disabled:t,"data-test":`email-password-reset-link-button`,children:[t&&(0,p.jsx)(a,{className:`h-4 w-4 animate-spin`}),`Email password reset link`]})})]})}m.layout={title:`Forgot password`,description:`Enter your email to receive a password reset link`};export{m as default};
@@ -0,0 +1 @@
import{r as e}from"./dist-BRfsww6z.js";import{t}from"./jsx-runtime-BpzPEenQ.js";import{t as n}from"./compiler-runtime-sKsOXjDo.js";var r=n(),i=t();function a(t){let n=(0,r.c)(13),{disclaimer:a}=t,o,s,c;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,i.jsx)(`p`,{className:`text-sm font-semibold tracking-wide uppercase`,children:`InvestMoz · orientação informativa`}),s=(0,i.jsx)(`h1`,{className:`text-3xl font-bold`,children:`Terra e DUAT`}),c=(0,i.jsx)(`p`,{children:`Prepare informação sobre uma área, um pedido ou um processo que já acompanha. Pode indicar dúvidas e dados por confirmar.`}),n[0]=o,n[1]=s,n[2]=c):(o=n[0],s=n[1],c=n[2]);let l;n[3]===a?l=n[4]:(l=(0,i.jsxs)(`header`,{className:`space-y-3`,children:[o,s,c,(0,i.jsx)(`p`,{className:`rounded border border-amber-400 bg-amber-50 p-4 text-sm`,children:a})]}),n[3]=a,n[4]=l);let u;n[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,i.jsxs)(`article`,{className:`rounded border p-4`,children:[(0,i.jsx)(`h2`,{className:`font-semibold`,children:`Preparar informação`}),(0,i.jsx)(`p`,{children:`Identifique a finalidade, o requerente, a localização conhecida e os antecedentes que tiver.`})]}),n[5]=u):u=n[5];let d;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,i.jsxs)(`article`,{className:`rounded border p-4`,children:[(0,i.jsx)(`h2`,{className:`font-semibold`,children:`Organizar documentos`}),(0,i.jsx)(`p`,{children:`Anexos são opcionais nesta fase. A lista não substitui os requisitos confirmados pela entidade competente.`})]}),n[6]=d):d=n[6];let f,p;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,i.jsxs)(`section`,{className:`grid gap-4 md:grid-cols-3`,children:[u,d,(0,i.jsxs)(`article`,{className:`rounded border p-4`,children:[(0,i.jsx)(`h2`,{className:`font-semibold`,children:`Acompanhar`}),(0,i.jsx)(`p`,{children:`Guarde uma referência interna e registe separadamente informações comunicadas por si e diligências internas.`})]})]}),p=(0,i.jsx)(`p`,{className:`rounded bg-slate-50 p-4`,children:`Não inferimos que uma área está livre, que não existem direitos ou conflitos, nem que um registo ou mapa confirma titularidade. O InvestMoz não atribui DUAT nem substitui a autoridade pública.`}),n[7]=f,n[8]=p):(f=n[7],p=n[8]);let m;n[9]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,i.jsxs)(`nav`,{className:`flex flex-wrap gap-4`,children:[(0,i.jsx)(e,{className:`rounded bg-emerald-800 px-4 py-3 text-white`,href:`/investidor/terra-duat/novo`,children:`Preencher no portal`}),(0,i.jsx)(e,{className:`rounded border px-4 py-3`,href:`/terra-duat/formulario-em-branco`,children:`Descarregar formulário em branco (imprimir/guardar como PDF)`}),(0,i.jsx)(e,{className:`rounded border px-4 py-3`,href:`/apoio`,children:`Solicitar apoio geral`})]}),n[9]=m):m=n[9];let h;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,i.jsxs)(`details`,{className:`rounded border p-4`,children:[(0,i.jsx)(`summary`,{className:`cursor-pointer font-semibold`,children:`Estado das fontes e requisitos`}),(0,i.jsx)(`p`,{className:`mt-3`,children:`Os modelos digitalizados estão inventariados como referências reservadas. Conteúdo, actualidade e requisitos legais aguardam OCR, conferência oficial e revisão. Não use esta orientação como checklist oficial.`})]}),n[10]=h):h=n[10];let g;return n[11]===l?g=n[12]:(g=(0,i.jsxs)(`main`,{className:`mx-auto max-w-5xl space-y-8 p-6 print:p-0`,children:[l,f,p,m,h]}),n[11]=l,n[12]=g),g}export{a as default};
@@ -0,0 +1 @@
import{t as e}from"./jsx-runtime-BpzPEenQ.js";import{t}from"./compiler-runtime-sKsOXjDo.js";import{n,r}from"./shared-CKR8SVWL.js";var i=t(),a=e(),o={investment_accounts:`Perfil de investimento`,investment_company_declarations:`Declaração de empresa`,investment_submissions:`Manifestação de interesse`,investment_messages:`Mensagem de acompanhamento`,investment_reference_options:`Opção de formulário`,opportunity_context:`Contexto da oportunidade`,sectors:`Sector`,opportunities:`Oportunidade`,interest_requests:`Pedido`,investors:`Investidor`,contacts:`Contacto`,leads:`Lead`,tasks:`Tarefa`,projects:`Projecto`,economic_clusters:`Cluster`,cluster_projects:`Associação projecto–cluster`,value_chains:`Etapa da cadeia de valor`,value_chain_links:`Ligação entre etapas`,investment_gaps:`Lacuna de investimento`},s={version:`Versão`,active:`Activo`,name:`Nome`,slug:`Endereço`,description:`Descrição`,short_description:`Descrição curta`,status:`Estado`,is_active:`Activo`,is_featured:`Destaque`,sort_order:`Ordem`,sector_id:`Sector`,maturity_level:`Maturidade`,maturity_label:`Descrição da maturidade`,estimated_investment_amount:`Investimento`,estimated_investment_currency:`Moeda`,reference:`Referência`,title:`Título`,summary:`Resumo`,province:`Província`,district:`Distrito`,promoter_name:`Promotor`,promoter_type:`Tipo de promotor`,financing_modality:`Financiamento`,expected_impact:`Impacto`,published_at:`Publicação`,reviewed_at:`Data de revisão`,reviewed_by:`Responsável pela revisão`};function c(e){return e==null?`—`:typeof e==`boolean`?e?`Sim`:`Não`:typeof e==`object`?JSON.stringify(e):typeof e==`string`?e:typeof e==`number`?e.toString():`—`}function l(e){let t=(0,i.c)(13),{events:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,a.jsx)(`p`,{className:`text-muted-foreground`,children:`Alterações efectuadas na gestão do portal. Os textos e contactos pessoais não são copiados para o histórico.`}),t[0]=s):s=t[0];let c;t[1]===o.data?c=t[2]:(c=o.data.map(u),t[1]=o.data,t[2]=c);let l;t[3]===c?l=t[4]:(l=(0,a.jsx)(`div`,{className:`space-y-4`,children:c}),t[3]=c,t[4]=l);let d;t[5]===o.data.length?d=t[6]:(d=!o.data.length&&(0,a.jsx)(`p`,{children:`Ainda não existem alterações registadas.`}),t[5]=o.data.length,t[6]=d);let f;t[7]===o?f=t[8]:(f=(0,a.jsx)(r,{page:o}),t[7]=o,t[8]=f);let p;return t[9]!==l||t[10]!==d||t[11]!==f?(p=(0,a.jsxs)(n,{title:`Histórico de alterações`,children:[s,l,d,f]}),t[9]=l,t[10]=d,t[11]=f,t[12]=p):p=t[12],p}function u(e){return(0,a.jsxs)(`article`,{className:`space-y-2 rounded border p-4`,children:[(0,a.jsxs)(`h2`,{className:`font-semibold break-words`,children:[o[e.entity_type]??e.entity_type,` #`,e.after_data.record_id,` ·`,` `,e.action===`created`?`Criado`:`Actualizado`]}),(0,a.jsxs)(`p`,{children:[e.actor??`Utilizador indisponível`,` ·`,` `,new Intl.DateTimeFormat(`pt-MZ`,{dateStyle:`medium`,timeStyle:`short`,timeZone:`Africa/Maputo`}).format(new Date(e.occurred_at)),` `,`(Maputo)`]}),(0,a.jsxs)(`p`,{className:`text-sm break-words`,children:[`Campos:`,` `,e.after_data.changed_fields.map(d).join(`, `)]}),Object.entries(e.after_data.values).filter(t=>{let[n,r]=t;return JSON.stringify(e.before_data.values[n])!==JSON.stringify(r)}).map(t=>{let[n,r]=t;return(0,a.jsxs)(`p`,{className:`text-sm break-words`,children:[s[n]??n,`:`,` `,c(e.before_data.values[n]??`—`),` `,`→ `,c(r)]},n)})]},e.id)}function d(e){return s[e]??e}export{l as default};
@@ -0,0 +1 @@
import{t as e}from"./jsx-runtime-BpzPEenQ.js";import{t}from"./utils-CCDJ05Ll.js";var n=e();function r({message:e,className:r=``,...i}){return e?(0,n.jsx)(`p`,{...i,className:t(`text-sm text-red-600 dark:text-red-400`,r),children:e}):null}export{r as t};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t,t as n}from"./jsx-runtime-BpzPEenQ.js";import{a as r,i,n as a}from"./shared-CKR8SVWL.js";import{t as o}from"./operation-key-Dr4VtGxa.js";import{n as s}from"./profile-json-Bb5H6-rZ.js";var c=e(t(),1),l=n();function u(e){let[t,n]=(0,c.useState)(e),[u,d]=(0,c.useState)(``),[f,p]=(0,c.useState)(!1),[m,h]=(0,c.useState)(``),[g,_]=(0,c.useState)(``),[v,y]=(0,c.useState)(!1),[b,x]=(0,c.useState)(``),[S,C]=(0,c.useState)(null),[w]=(0,c.useState)(o),[T]=(0,c.useState)(o);async function E(e=!1){y(!0),x(``);try{let r=await s(`/management/profile-install`+(e?`/bootstrap`:``),{hash:t.hash,confirm:f,reason:u,idempotency_key:e?T:w,...e?{first_user_id:Number(m),second_user_id:Number(g)}:{}});x(e?`Pedido registado, sem atribuir privilégios. O segundo titular deve autenticar-se com MFA e confirmar pelo endereço abaixo.`:r.changed?`Schema instalado. Perfis ainda não disponibilizados; nenhuma conta ou atribuição criada.`:`Schema já instalado. Nenhuma reinstalação ou duplicação.`),e&&C(r.confirmation_url),e||n(await s(`/management/profile-install`,{},`GET`)),p(!1)}catch(e){x(e instanceof Error?e.message:`Resposta indisponível; consulte o estado antes de repetir.`)}finally{y(!1)}}return(0,l.jsxs)(a,{title:`Instalação dos perfis — 040000`,children:[(0,l.jsxs)(`p`,{children:[`Base `,t.target.database,`:`,t.target.port,` ·`,` `,t.installed?`Schema instalado`:`Schema por instalar`]}),(0,l.jsxs)(`p`,{children:[`Preparação:`,` `,t.ready?`Provas atuais verificadas`:`Dependências ou provas por completar`,`. Preparação não significa instalação ou disponibilização dos perfis.`]}),!t.consistent&&(0,l.jsx)(`p`,{role:`alert`,children:`Ledger e schema divergem. Recuperar a consistência antes de instalar.`}),(0,l.jsx)(`ul`,{children:Object.entries(t.dependencies).map(([e,t])=>(0,l.jsxs)(`li`,{children:[e,`: `,t?`presente`:`pendente`]},e))}),(0,l.jsx)(`ul`,{children:t.changes.map(e=>(0,l.jsx)(`li`,{children:e},e))}),(0,l.jsxs)(`p`,{children:[`Backup/restauro: `,t.backupDate??`Prova atual pendente`]}),(0,l.jsx)(`p`,{children:t.rollback}),(0,l.jsxs)(`label`,{className:`block`,children:[`Fundamento`,(0,l.jsx)(`textarea`,{className:r,value:u,minLength:20,maxLength:1e3,onChange:e=>d(e.target.value)})]}),(0,l.jsxs)(`label`,{className:`block`,children:[(0,l.jsx)(`input`,{type:`checkbox`,checked:f,onChange:e=>p(e.target.checked)}),` `,`Confirmo exclusivamente a ação indicada nesta base`]}),(0,l.jsx)(`button`,{className:i,disabled:v||!f||!t.ready||t.installed||!t.consistent||u.length<20,onClick:()=>void E(),children:`Instalar schema 040000`}),(0,l.jsxs)(`section`,{className:`space-y-3 rounded border p-4`,children:[(0,l.jsx)(`h2`,{children:`Inicialização separada dos dois superutilizadores`}),(0,l.jsx)(`p`,{children:t.bootstrap.rule}),t.bootstrap.pending&&(0,l.jsxs)(`p`,{children:[`Pedido pendente até `,t.bootstrap.pending.expires_at,`. `,(0,l.jsx)(`a`,{className:`underline`,href:t.bootstrap.pending.confirmation_url,children:`Recuperar pedido de confirmação`}),`. Nenhum privilégio foi atribuído pelo pedido.`]}),t.bootstrap.initialized?(0,l.jsxs)(`p`,{children:[`Dupla já inicializada:`,` `,t.bootstrap.holders.join(` e `),`; versão`,` `,t.bootstrap.version,`. Use a substituição atómica autorizada; não reinicialize.`]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`label`,{className:`block`,children:[`ID da primeira conta explicitamente designada`,(0,l.jsx)(`input`,{className:r,type:`number`,min:1,value:m,onChange:e=>h(e.target.value)})]}),(0,l.jsxs)(`label`,{className:`block`,children:[`ID da segunda conta explicitamente designada`,(0,l.jsx)(`input`,{className:r,type:`number`,min:1,value:g,onChange:e=>_(e.target.value)})]}),(0,l.jsx)(`button`,{className:i,disabled:v||!f||!t.installed||!!t.bootstrap.pending||!m||!g||m===g||u.length<20,onClick:()=>void E(!0),children:`Pedir confirmação ao segundo titular`})]})]}),(0,l.jsx)(`p`,{role:`status`,children:b}),S&&(0,l.jsxs)(`p`,{children:[`Endereço para o segundo titular: `,(0,l.jsx)(`a`,{className:`underline`,href:S,children:S}),`. O primeiro titular pode consultar, mas não confirmar.`]})]})}export{u as default};
@@ -0,0 +1 @@
import{o as e,r as t}from"./dist-BRfsww6z.js";import{t as n}from"./jsx-runtime-BpzPEenQ.js";import{t as r}from"./compiler-runtime-sKsOXjDo.js";import{n as i}from"./shared-CKR8SVWL.js";import{Errors as a,labels as o}from"./shared-CANbkD3F.js";var s=r(),c=n();function l(n){let r=(0,s.c)(33),o;r[0]===n.hash?o=r[1]:(o={hash:n.hash},r[0]=n.hash,r[1]=o);let l=e(o),f=n.installed?`Instalada`:`Preparada para aplicação autenticada`,p;r[2]!==n.target.database||r[3]!==n.target.port||r[4]!==f?(p=(0,c.jsxs)(`p`,{children:[`Destino: `,n.target.database,`:`,n.target.port,`. Estado:`,` `,f,`.`]}),r[2]=n.target.database,r[3]=n.target.port,r[4]=f,r[5]=p):p=r[5];let m=n.backupVerified?`Comprovados`:`Pendentes`,h=n.qaVerified?`Comprovada`:`Pendente`,g;r[6]!==n.backupDate||r[7]!==m||r[8]!==h?(g=(0,c.jsxs)(`p`,{children:[`Backup e restauro:`,` `,m,` ·`,` `,n.backupDate,`. QA desta versão:`,` `,h,`.`]}),r[6]=n.backupDate,r[7]=m,r[8]=h,r[9]=g):g=r[9];let _;r[10]===n.changes?_=r[11]:(_=n.changes.map(d),r[10]=n.changes,r[11]=_);let v;r[12]===_?v=r[13]:(v=(0,c.jsx)(`ul`,{className:`list-disc pl-5`,children:_}),r[12]=_,r[13]=v);let y;r[14]===n.records.length?y=r[15]:(y=(0,c.jsxs)(`h2`,{className:`text-xl font-bold`,children:[`Propostas antigas a preservar: `,n.records.length]}),r[14]=n.records.length,r[15]=y);let b;r[16]===n.records?b=r[17]:(b=n.records.map(u),r[16]=n.records,r[17]=b);let x;r[18]!==l||r[19]!==n.backupVerified||r[20]!==n.installed||r[21]!==n.qaVerified?(x=!n.installed&&(0,c.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),l.post(`/management/partnerships-install`)},children:[(0,c.jsx)(a,{errors:l.errors}),(0,c.jsx)(`button`,{className:`inline-flex rounded bg-emerald-800 px-4 py-2 text-white disabled:opacity-50`,disabled:l.processing||!n.backupVerified||!n.qaVerified,children:`Aplicar módulo preservando propostas`})]}),r[18]=l,r[19]=n.backupVerified,r[20]=n.installed,r[21]=n.qaVerified,r[22]=x):x=r[22];let S;r[23]===n.installed?S=r[24]:(S=n.installed&&(0,c.jsx)(t,{href:`/parcerias/painel`,className:`underline`,children:`Abrir painel da Bolsa`}),r[23]=n.installed,r[24]=S);let C;return r[25]!==x||r[26]!==S||r[27]!==p||r[28]!==g||r[29]!==v||r[30]!==y||r[31]!==b?(C=(0,c.jsx)(i,{title:`Aplicação da Bolsa de Parcerias`,children:(0,c.jsxs)(`div`,{className:`space-y-5`,children:[p,g,v,y,b,x,S]})}),r[25]=x,r[26]=S,r[27]=p,r[28]=g,r[29]=v,r[30]=y,r[31]=b,r[32]=C):C=r[32],C}function u(e){return(0,c.jsxs)(`p`,{children:[e.id,` · `,e.title,` · Autor `,e.user_id,` ·`,` `,o[e.status]??e.status]},e.id)}function d(e){return(0,c.jsx)(`li`,{children:e},e)}export{l as default};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t,t as n}from"./jsx-runtime-BpzPEenQ.js";import{t as r}from"./compiler-runtime-sKsOXjDo.js";import{t as i}from"./interactive-investment-map-DFT3VzR2.js";import{t as a}from"./territory-geometry-preview-DVGcGZ40.js";var o=r(),s=e(t(),1),c=n();function l(e){let t=(0,o.c)(21),{filters:n,territoryId:r}=e,l;t[0]===n?l=t[1]:(l=JSON.stringify(n),t[0]=n,t[1]=l);let f=l,[p,m]=(0,s.useState)(null),h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[2]=h):h=t[2];let[g,_]=(0,s.useState)(h),[v,y]=(0,s.useState)(``),b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[3]=b):b=t[3];let[x,S]=(0,s.useState)(b),C,w;t[4]===f?(C=t[5],w=t[6]):(C=()=>{let e=new AbortController,t=new URLSearchParams(JSON.parse(f));return m(null),S([]),fetch(`/api/v1/investment/map?${t}`,{signal:e.signal,headers:{Accept:`application/json`}}).then(d).then(t=>{e.signal.aborted||(m(t.features),S(t.areas??[]),_(t.unlocated??[]),y(t.truncated?`Cobertura limitada: refine os filtros.`:``))}).catch(t=>{e.signal.aborted||y(t.message)}),()=>e.abort()},w=[f],t[4]=f,t[5]=C,t[6]=w),(0,s.useEffect)(C,w);let T;t[7]===v?T=t[8]:(T=v&&(0,c.jsx)(`p`,{role:`alert`,children:v}),t[7]=v,t[8]=T);let E;t[9]!==x||t[10]!==p?(E=(0,c.jsx)(i,{points:p,areas:x}),t[9]=x,t[10]=p,t[11]=E):E=t[11];let D=r||String(n.locality_id||n.admin_post_id||n.district_id||n.province_id||n.geo_location_id||``),O;t[12]===D?O=t[13]:(O=(0,c.jsx)(a,{territoryId:D}),t[12]=D,t[13]=O);let k;t[14]===g?k=t[15]:(k=g.length>0&&(0,c.jsxs)(`div`,{children:[(0,c.jsxs)(`p`,{children:[g.length,` investimentos sem ponto público utilizável. Consulte as fichas para localizações documentadas sem coordenadas:`]}),(0,c.jsx)(`ul`,{children:g.map(u)})]}),t[14]=g,t[15]=k);let A;return t[16]!==k||t[17]!==T||t[18]!==E||t[19]!==O?(A=(0,c.jsxs)(`section`,{className:`space-y-3`,children:[T,E,O,k]}),t[16]=k,t[17]=T,t[18]=E,t[19]=O,t[20]=A):A=t[20],A}function u(e){return(0,c.jsx)(`li`,{children:(0,c.jsx)(`a`,{href:e.url,className:`underline`,children:e.title})},e.id)}async function d(e){if(!e.ok)throw Error(`Mapa indisponível.`);return e.json()}export{l as t};
@@ -0,0 +1 @@
var e=[`Ideia identificada`,`Pré-estudo disponível`,`Estudo de viabilidade em curso`,`Projecto estruturado`,`Pronto para investimento`,`Em negociação ou implementação`];export{e as t};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t,o as n,r,u as i}from"./dist-BRfsww6z.js";import{n as a,t as o}from"./jsx-runtime-BpzPEenQ.js";import{t as s}from"./compiler-runtime-sKsOXjDo.js";import{t as c}from"./operation-key-Dr4VtGxa.js";var l=s(),u=e(a(),1),d=o();function f(e){let a=(0,l.c)(46),{contexts:o,contentSource:s}=e,[c]=(0,u.useState)(m),f=s?.id,h;a[0]!==c||a[1]!==f?(h={title:``,client_key:c,reuse_consent:!1,content_resource_id:f},a[0]=c,a[1]=f,a[2]=h):h=a[2];let g=n(h),_,v;a[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,d.jsx)(t,{title:`Os meus investimentos`}),v=(0,d.jsx)(`h1`,{className:`text-2xl font-semibold`,children:`Os meus investimentos`}),a[3]=_,a[4]=v):(_=a[3],v=a[4]);let y;a[5]===s?y=a[6]:(y=s&&(0,d.jsxs)(`p`,{children:[`Preparar a partir de`,` `,(0,d.jsx)(r,{className:`underline`,href:s.href,children:s.title}),`. A fonte e a versão serão guardadas no dossier escolhido.`]}),a[5]=s,a[6]=y);let b;a[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,d.jsx)(`p`,{children:`Prepare cada investimento no seu dossier. Pode trabalhar em várias etapas em paralelo.`}),a[7]=b):b=a[7];let x;if(a[8]!==s||a[9]!==o){let e;a[11]===s?e=a[12]:(e=e=>(0,d.jsxs)(`li`,{className:`rounded-xl border p-4`,children:[(0,d.jsx)(r,{className:`font-semibold underline`,href:`/investimentos/${e.id}`,children:e.title}),(0,d.jsxs)(`p`,{className:`text-sm`,children:[`Guardado em`,` `,new Date(e.updated_at).toLocaleString(`pt-MZ`)]}),s&&(0,d.jsx)(`button`,{type:`button`,className:`mt-3 rounded border p-2`,onClick:()=>i.post(`/investimentos/${e.id}/conteudos`,{version:e.version,resource_id:s.id}),children:`Continuar neste dossier com o artigo`})]},e.id),a[11]=s,a[12]=e),x=o.map(e),a[8]=s,a[9]=o,a[10]=x}else x=a[10];let S;a[13]===x?S=a[14]:(S=(0,d.jsx)(`ul`,{className:`grid gap-4 md:grid-cols-2`,children:x}),a[13]=x,a[14]=S);let C;a[15]===o.length?C=a[16]:(C=!o.length&&(0,d.jsx)(`p`,{children:`Ainda não criou um investimento neste percurso.`}),a[15]=o.length,a[16]=C);let w;a[17]===g?w=a[18]:(w=e=>{e.preventDefault(),g.post(`/investimentos`)},a[17]=g,a[18]=w);let T;a[19]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,d.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Preparar um investimento`}),a[19]=T):T=a[19];let E;a[20]===g?E=a[21]:(E=e=>g.setData(`title`,e.target.value),a[20]=g,a[21]=E);let D;a[22]!==g.data.title||a[23]!==E?(D=(0,d.jsxs)(`label`,{className:`grid gap-1`,children:[`Título`,(0,d.jsx)(`input`,{required:!0,maxLength:200,className:`rounded border p-2`,value:g.data.title,onChange:E})]}),a[22]=g.data.title,a[23]=E,a[24]=D):D=a[24];let O;a[25]===g?O=a[26]:(O=e=>g.setData(`reuse_consent`,e.target.checked),a[25]=g,a[26]=O);let k;a[27]!==g.data.reuse_consent||a[28]!==O?(k=(0,d.jsxs)(`label`,{className:`flex gap-2`,children:[(0,d.jsx)(`input`,{type:`checkbox`,checked:g.data.reuse_consent,onChange:O}),`Autorizo reutilizar o meu perfil neste dossier privado.`]}),a[27]=g.data.reuse_consent,a[28]=O,a[29]=k):k=a[29];let A;a[30]===g.errors?A=a[31]:(A=Object.values(g.errors).map(p),a[30]=g.errors,a[31]=A);let j;a[32]===g.processing?j=a[33]:(j=(0,d.jsx)(`button`,{disabled:g.processing,className:`bg-primary text-primary-foreground rounded px-4 py-2`,children:`Criar e guardar dossier`}),a[32]=g.processing,a[33]=j);let M;a[34]!==w||a[35]!==D||a[36]!==k||a[37]!==A||a[38]!==j?(M=(0,d.jsxs)(`form`,{className:`max-w-xl space-y-4 rounded-xl border p-5`,onSubmit:w,children:[T,D,k,A,j]}),a[34]=w,a[35]=D,a[36]=k,a[37]=A,a[38]=j,a[39]=M):M=a[39];let N;a[40]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,d.jsxs)(`nav`,{className:`flex flex-wrap gap-4`,"aria-label":`Ferramentas`,children:[(0,d.jsx)(r,{className:`underline`,href:`/simulador-fiscal`,children:`Simulador`}),(0,d.jsx)(r,{className:`underline`,href:`/balcao-virtual/painel`,children:`Balcão`}),(0,d.jsx)(r,{className:`underline`,href:`/investidor`,children:`Oportunidades guardadas`}),(0,d.jsx)(r,{className:`underline`,href:`/dashboard`,children:`Painel`})]}),a[40]=N):N=a[40];let P;return a[41]!==M||a[42]!==y||a[43]!==S||a[44]!==C?(P=(0,d.jsxs)(`main`,{className:`mx-auto max-w-5xl space-y-6 p-4 md:p-8`,children:[_,v,y,b,S,C,M,N]}),a[41]=M,a[42]=y,a[43]=S,a[44]=C,a[45]=P):P=a[45],P}function p(e,t){return(0,d.jsx)(`p`,{role:`alert`,children:e},t)}function m(){return c()}export{f as default};
@@ -0,0 +1 @@
import{o as e,r as t}from"./dist-BRfsww6z.js";import{t as n}from"./jsx-runtime-BpzPEenQ.js";import{t as r}from"./compiler-runtime-sKsOXjDo.js";import{a as i,i as a,n as o,r as s}from"./shared-CKR8SVWL.js";var c=r(),l=n();function u(t){let n=(0,c.c)(29),{investors:r,filters:u}=t,f=u.q??``,p;n[0]===f?p=n[1]:(p={q:f},n[0]=f,n[1]=p);let m=e(p),h;n[2]===m?h=n[3]:(h=e=>{e.preventDefault(),m.get(`/management/crm/investors`,{preserveState:!1})},n[2]=m,n[3]=h);let g;n[4]===m?g=n[5]:(g=e=>m.setData(`q`,e.target.value),n[4]=m,n[5]=g);let _;n[6]!==m.data.q||n[7]!==g?(_=(0,l.jsx)(`input`,{"aria-label":`Pesquisar investidores`,className:i,value:m.data.q,onChange:g}),n[6]=m.data.q,n[7]=g,n[8]=_):_=n[8];let v;n[9]===m.processing?v=n[10]:(v=(0,l.jsx)(`button`,{className:a,disabled:m.processing,children:`Pesquisar`}),n[9]=m.processing,n[10]=v);let y;n[11]!==h||n[12]!==_||n[13]!==v?(y=(0,l.jsxs)(`form`,{className:`flex gap-3`,onSubmit:h,children:[_,v]}),n[11]=h,n[12]=_,n[13]=v,n[14]=y):y=n[14];let b;n[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,l.jsx)(`p`,{children:`Os novos investidores são registados ao converter um pedido em lead, com revisão do contacto e da identidade.`}),n[15]=b):b=n[15];let x;n[16]===r.data?x=n[17]:(x=r.data.map(d),n[16]=r.data,n[17]=x);let S;n[18]===x?S=n[19]:(S=(0,l.jsx)(`div`,{className:`space-y-3`,children:x}),n[18]=x,n[19]=S);let C;n[20]===r.data.length?C=n[21]:(C=!r.data.length&&(0,l.jsx)(`p`,{children:`Nenhum investidor encontrado.`}),n[20]=r.data.length,n[21]=C);let w;n[22]===r?w=n[23]:(w=(0,l.jsx)(s,{page:r}),n[22]=r,n[23]=w);let T;return n[24]!==S||n[25]!==C||n[26]!==w||n[27]!==y?(T=(0,l.jsxs)(o,{title:`CRM — Investidores`,children:[y,b,S,C,w]}),n[24]=S,n[25]=C,n[26]=w,n[27]=y,n[28]=T):T=n[28],T}function d(e){return(0,l.jsxs)(`article`,{className:`rounded border p-4`,children:[(0,l.jsx)(t,{className:`font-semibold underline`,href:`/management/crm/investors/${e.id}`,children:e.legal_name}),(0,l.jsx)(`p`,{children:{prospect:`Potencial investidor`,active:`Activo`,inactive:`Inactivo`}[e.status]??e.status})]},e.id)}export{u as default};
@@ -0,0 +1 @@
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t,t as n}from"./jsx-runtime-BpzPEenQ.js";import{t as r}from"./compiler-runtime-sKsOXjDo.js";import{t as i}from"./dist-DDq_DSJX.js";import{t as a}from"./utils-CCDJ05Ll.js";var o=r(),s=e(t(),1),c=n(),l=Object.defineProperty,u=s.forwardRef(((e,t)=>l(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,c.jsx)(i.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`));function d(e){let t=(0,o.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=a(`text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,n),t[3]=n,t[4]=i);let s;return t[5]!==r||t[6]!==i?(s=(0,c.jsx)(u,{"data-slot":`label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=s):s=t[7],s}export{d as t};
@@ -0,0 +1 @@
var e={assistant:[`Assistente com fontes`,`Evidence assistant`],search:[`Pesquisa documental`,`Document search`],recommend:[`Correspondência de oportunidades`,`Opportunity matching`],classify:[`Triagem de pedidos`,`Interest triage`],quality:[`Qualidade dos dados`,`Data quality`],sla:[`Prazos e tarefas`,`Deadlines and tasks`],summary:[`Excertos de documentos`,`Document excerpts`]},t={classify:`interest_triage`,quality:`data_quality`,sla:`execution_monitoring`},n={pending:`Pendente`,approved:`Autorizada para consulta interna`,revoked:`Revogada`,accepted:`Aceite na revisão interna`,rejected:`Rejeitado`,official:`Oficial — natureza declarada da fonte`,historical:`Histórica`,illustrative:`Ilustrativa`};export{t as n,n as r,e as t};

Some files were not shown because too many files have changed in this diff Show More