+43
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"recorded_at": "2026-10-11T12:27:17.030685+00:00",
|
||||
"code_revision": "df6be252f1a0b60ac40836ba77af29e58e32269808484bca7126594053d48045",
|
||||
"production_manifest_sha256": "bd21670e9922c5ebef80b15d03d5d713d3dcc12301302cd4b2b8735e53033bad",
|
||||
"regression": {
|
||||
"tests": 33,
|
||||
"assertions": 663,
|
||||
"errors": 0,
|
||||
"failures": 0,
|
||||
"skipped": 0
|
||||
},
|
||||
"regression_xml_sha256": "9a7d2b9a5b4cfb0fb417c91a356df9634659698949846b8375650f131b2b2036",
|
||||
"typescript": {
|
||||
"command": "npm.cmd run types:check",
|
||||
"exit_code": 0,
|
||||
"source": "Successful tool result in this QA increment"
|
||||
},
|
||||
"phpstan": {
|
||||
"scope": "Six affected PHP services",
|
||||
"exit_code": 0,
|
||||
"errors": 0,
|
||||
"memory_limit": "512M CLI only",
|
||||
"source": "Successful tool result after scoped query typing correction"
|
||||
},
|
||||
"criterion_evidence": {
|
||||
"functional-workflow-chromium-20261011.json": "b59e55ae5e916d52b415ec596ef5390d0fb9533f79bc0b76d7168fa9053c9804",
|
||||
"functional-land-publication-chromium-20261011.json": "6da9cd2a4c3bcce083dd629594529032411b1f948aafba1ceb83ab093a378833",
|
||||
"functional-coedit-resources-chromium-20261011.json": "8e760428e2fd0a93e66683d5b4e133c779af69e86edc39e36e27266cabd5ca20",
|
||||
"functional-documents-chromium-20261011.json": "55fe98a9ec73246c268779afad62b24db788c4db1af8802cbd5ac002b0a6ce15",
|
||||
"functional-filters-chromium-20261011.json": "cf09e9f94d171e443e6cf89dc0535beff7a6b427068e35dd01e161983c596930",
|
||||
"functional-filters-persistence-qa-20261011.json": "90a5ef5a7ec870bd676abad8995ec48c87543402f962d7e7dda42b0a360000e2",
|
||||
"functional-accessibility-chromium-20261011.json": "8c9dcd352c8f5945dd08edf13b4d9c9e3f3dc8e984737b2ab148f0aa07dd85d7",
|
||||
"functional-joint-chromium-20261011.json": "4c0fb8781b11758a1ac16634b7e4d902fcb84ac292c44e626d40b9ffc22f0a19",
|
||||
"functional-materiality-semantic-qa-20261011.json": "17defc663c0cc3f609bfaa9cc5d0da525fc1bf087a3d5efe1e34c282f9644728",
|
||||
"functional-category-semantics-qa-20261011.json": "072d9fbafa24d9b5a27c77cd440fbd07ea3debea67cc0f747a29c920275fdace",
|
||||
"functional-conditions-semantic-qa-20261011.json": "46ba2a3bab6ffaaf9e5a94a60a31898e6d4378fc0973cc219d011d604f6f9786",
|
||||
"functional-final-persistence-qa-20261011.json": "b632a5dac385d214f1faf03d1686c8a23d7f5f1044396246a654d2328077b0b9",
|
||||
"functional-backup-restoration-qa-20261011.json": "5a49550faeb62fd61e28bc4d65decd0791275108d0fd3ca1f767d585ec16d3a2",
|
||||
"functional-production-build-20261011.json": "900b91c12e3cad124a7711f5f436a02a538c5a162fd83f9ea937d83608fe6a50",
|
||||
"functional-country-compatibility-qa-20261011.json": "3c813795b5fe100565bc17ac5f1a095a111292095857499a931dfdd0241909f3"
|
||||
},
|
||||
"no_test_count_as_acceptance_substitute": true
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,357 @@
|
||||
{
|
||||
"format": "investmoz-opportunity-workflow-candidate-1",
|
||||
"base_revision": "485ee04c40b2754ab668f48fd84d8559fb19a8b98f4b9af50fc0517bb488ca76",
|
||||
"code_revision": "df6be252f1a0b60ac40836ba77af29e58e32269808484bca7126594053d48045",
|
||||
"git_commit": false,
|
||||
"payload": {
|
||||
"app/Services/OpportunityCanonicalContract.php": "bf9d4146c474d6c50b77f20abcaa19a97d7f975ad6dd4f28d3a0cdcfae91ea49",
|
||||
"app/Services/OpportunityCanonicalResponse.php": "31c2f60a1337c91c801b2576ee2af545f1d47b1abb76d5859463932b45268ae1",
|
||||
"app/Services/OpportunityProfileWorkflow.php": "35a4d33d841026f667f3d63baa74547faf83740b9765a24ad67afd1e17ecbb51",
|
||||
"app/Services/OpportunityReviewConditions.php": "0f4362a347eb1b8a4a95b05c037f0180ca40e76793bdcbb9eae51226861fba41",
|
||||
"app/Services/OpportunityReviewMateriality.php": "efc0b17a75bb3063bc2995e85d0c571af4692daad1c41e342607beea6d6bc47f",
|
||||
"app/Services/PortalProfileAccess.php": "7f72e445498d2c3b603444cd4faa07cde3cc1adaddf115733704547006dfd67b",
|
||||
"public/build/fonts-manifest.json": "66edf17c93351fe01158be7414a441a762f106417c74351881876b405b8b10ca",
|
||||
"public/build/manifest.json": "bd21670e9922c5ebef80b15d03d5d713d3dcc12301302cd4b2b8735e53033bad",
|
||||
"public/build/assets/administration-ukcdRQ-z.js": "73391aefc2824ada869a2b299809ce6da6e385dd638ab8571a544a9398402cb3",
|
||||
"public/build/assets/ai-Cda4W9Oj.js": "f8a8dfa486ae14b56ea2bf415ea8fe815dbf3b1bd00091c811e5725ec987e9a5",
|
||||
"public/build/assets/analysis-CYr_GpJ1.js": "f94744fad29c372d6bc965ff80b5ce149d9f5657a050edebb1f8d3010f42fd3d",
|
||||
"public/build/assets/app-CnfotKCe.js": "e727148ecae1d5b2900c21a2e9eba0238602208881171f6d44842a03f374b047",
|
||||
"public/build/assets/app-kj8h1utZ.css": "4cfedaf0837b8be29cb1c98095251168d2564ef199a290b336f9126cbbbb15aa",
|
||||
"public/build/assets/appearance-NCH6RrIv.js": "65e3f7549c0b6f6f873f73ae93ffc1ee18fdb73dce82ab01bde2b79723a47ab3",
|
||||
"public/build/assets/audit-CNojvueJ.js": "c3d26fb0e862fb8ec2d2b355dc2510d3e844ac693aa6d7feaca1871c1d26f67f",
|
||||
"public/build/assets/blank-2jFZEe2q.js": "9e53a0a455027f070e3041db1f445e8b63702f83e264442d8df87e20048ccbe9",
|
||||
"public/build/assets/business-D89pGfDN.js": "f1387e2c678086ced322450800fe6feecece374fd3f7a94f327f8b6b2b27c7f8",
|
||||
"public/build/assets/business-interest-DuG3uxrk.js": "514c3e8119d0e335dc7d38a20e215adaca6d788ca3f78cec9a0482437d049f68",
|
||||
"public/build/assets/business-marketplace-Dbfu4AGW.js": "fae7f0eac79dad824ec2a9ff331591578dff471d517f683ca418d65e4b87d1af",
|
||||
"public/build/assets/business-objects-CMuNB4pz.js": "d2a4d1f586f86bde1db61903e70b4ea8fc6a65518302347ef9d4cbc8db91945c",
|
||||
"public/build/assets/business-opportunity-DYWebIbf.js": "8af158ebd37c471d19169e70c33c439980d276c4a0e044b8dc4282d263abc0b5",
|
||||
"public/build/assets/business-types-SGCXhH6X.js": "c792ab88a79f57c74d865c47e89e7f2b9aea190acb5c8c676071d4b0a802d58c",
|
||||
"public/build/assets/business-verifications-Xe9bYNqC.js": "5f29651d5f7beb2ae1fb1eefe71404aa37d13b85d9d45de90985cb5905947b68",
|
||||
"public/build/assets/business-wizard-CZI9MtSf.js": "65c2fc18d578d5ca2ba35ab37b95eb4f1508c5c85c08ce3be0ef6c268478811d",
|
||||
"public/build/assets/businesses-DlYrH-zV.js": "b6dd27ecab57dc95b96674410ef6726577a71aeffca97b3cd6f60a45ccaa33fa",
|
||||
"public/build/assets/button-DAU4R6e9.js": "79b615d0b88db74491fb4b312ae70515d43332e8730f8baed64c81eec510171d",
|
||||
"public/build/assets/case-CIScUI-F.js": "a9b9ab1265e334198e1f577e043510a1f9f8bc31c97fd0405041fbb23ca2e185",
|
||||
"public/build/assets/case-WduOmcKg.js": "8ff5aa588bc88ae5dcc888685ac569387acd3ea00bd1a33684c9fd187ad0ea6a",
|
||||
"public/build/assets/catalog-Bz1dfhVq.js": "bb431fe55bc5f66b082fab09f89645062a71d6767045a397fb40900b43e86407",
|
||||
"public/build/assets/catalogue-6CrRSi1g.js": "23d16436ede9698446336ecb2e0a55da2fa0c203ff679f8417c9ea0e442f9db6",
|
||||
"public/build/assets/catalogue-f7tXQnUR.js": "753af60030b5129a3ddbc4b5f49d658371583f581f4a534fb7a31072ee7685ad",
|
||||
"public/build/assets/catalogue-JY02VIua.js": "f6f184d86e2973da833177c5d05f2887d2852806fe99827992a36919ff37c9db",
|
||||
"public/build/assets/check-PcBNn_NG.js": "402150a0f6387f9f098fea689a3282723ee063c84e57651f25d35729cdd85063",
|
||||
"public/build/assets/compiler-runtime-sKsOXjDo.js": "cc5f3db4bfb3bc5ae09b4594e5e137ad20037e8dfc3f0791781665706b860b6d",
|
||||
"public/build/assets/confirm-Culw9Q-x.js": "263fd058f1562c5729a4091d5d60f5365cc3957ad2cfcb5ffdec04a28f1858c4",
|
||||
"public/build/assets/confirm-password-MMHcNm5U.js": "df6a334ddadb753ac0bbaaf333136d4cc4caaddf9efd895315fd45e3393cf857",
|
||||
"public/build/assets/context-aDJV8LQc.js": "b60290ea9dc391bbc628f72ae9bc3aeb3a69ff2000ffa5381e0e69c1f7d5759b",
|
||||
"public/build/assets/conversation-DnpfvRDL.js": "74ea8a56fcb9389dc9bce01eefcda07563306ad09000ebb81eed1494a5eb5e2c",
|
||||
"public/build/assets/convert-Bg6qOTJj.js": "b004de3953bd3ae26e160c8113df0cd8846e7482440dd4b6f53c8672db94da81",
|
||||
"public/build/assets/country-select-C3BLoPPG.js": "87822f75957659509b95011d1489f6bed2ff824c215fce862a7fd29186f5189f",
|
||||
"public/build/assets/createLucideIcon-oMeAlXbs.js": "9398e5f9d8be91b886b9f6283574d6eb89b8fa02a4c21866ab9e376c95b74b56",
|
||||
"public/build/assets/dashboard-C98Bk44y.js": "2d67e6a5550d0d0b2a86a1d5a60928fe360b2c3837aa74df625ad61fa7949ae2",
|
||||
"public/build/assets/dashboard-JUUpqCEg.js": "d77a4cb74547309d42a8b90355f949cc9bc743e3ccc34b578e01531d2793e84d",
|
||||
"public/build/assets/desk-internal-operations-7EXQuNoA.js": "c9209a71110a7bd16ee8042fc69aaa0e45e3b071209b39c66679cc4b5e5c3f47",
|
||||
"public/build/assets/detail-B31jfKtS.js": "98b9f913c0690d896e659c584b7cb68131c6c5e7874067ac224eb7317cce6e1f",
|
||||
"public/build/assets/detail-Do04MIhl.js": "d1e68fa9b7868a7b53ee461c28f3a25b622cd07b3e3a839a80ec1d9f14c274f7",
|
||||
"public/build/assets/dialog-CCeZ_5zy.js": "f69ffccde8b0868d5d8c91c77e0002dd21fa730e27dad0915c4c532a76c53cc8",
|
||||
"public/build/assets/display-value-DRR1EAAK.js": "202c77561454ec7c1ef9cb39faa4f1833ea066dbb83e17f0eb4440b314b189f6",
|
||||
"public/build/assets/dist-BRfsww6z.js": "1b5218b53553fd01fd50cb0ce2102864c5359d450d4d71f00806f812f1e1870a",
|
||||
"public/build/assets/dist-Ddn_hEUd.js": "ee0c56af5abd78d01704f2fb0f764ea0746908244078a8014393a672994235d6",
|
||||
"public/build/assets/dist-DDq_DSJX.js": "0ea9c4863c02cabf343ba678aa470b682ef3ae1588380bee5b0781d356e9ba46",
|
||||
"public/build/assets/document-BXLx9rz5.js": "2412be8a246fb56fb809c8c83ebad1bd02d320acbce901a4a111fe680d43a03b",
|
||||
"public/build/assets/editor-Bc5AXTEf.js": "caf78a7eb878ef7f0e4a6129ba8a5675122b207a10202cff445cfa679ee0e55e",
|
||||
"public/build/assets/editor-CnM084dv.js": "19ca13c546558d0a7f220a0949b1c469357626aab86e9363929977b732bf4999",
|
||||
"public/build/assets/editor-j1kUXGJj.js": "9cb4707f0e467fd174ee6b1124748c6f207f234d2bccf98cbc51e72cd4da9437",
|
||||
"public/build/assets/education-uvR6f1ru.js": "e083c43ac1662e7a0574ca8bcb28ab7f5f5cc79c6149506bc95ee4c45566fd7e",
|
||||
"public/build/assets/financial-calculators-CsDOUJxx.js": "e76679a1914b5c4dc6c3e74b1b2de8d3d792fcc891dcc61d0fa27042232e2b9a",
|
||||
"public/build/assets/fonts-C9MNnjVw.css": "3846a9bb60bfad92960eadcccaf0b4e129d74b11d48791506c8d1a827a385cc8",
|
||||
"public/build/assets/forgot-password-CONcHpdA.js": "735e66f6499fa3fdfba7ef71fcdff843aa0205d13b9b86438c84f2f1fd2180a0",
|
||||
"public/build/assets/form-D2TKA1eY.js": "083a6fcf6828861ed0610c00bd17050283b14bb57d11905e609418df57561b3d",
|
||||
"public/build/assets/guide-mndEuKFT.js": "fe519ab69363e83bb705b7dee5ab3fe17249eeb53687846b539668c435ccbd2b",
|
||||
"public/build/assets/history-DychEKQU.js": "75bd152e336dbcf67cc715b76d4d2892dc3873c26f5bb08c122555a6ea9b1dfe",
|
||||
"public/build/assets/input-error-U1QKS0ED.js": "4acac92fa624552b14ac1a390e961f9e387d6eefeac384ad4e95bc73fdffa86e",
|
||||
"public/build/assets/install-DBBq6XRt.js": "e3d65fc3f36c064366c29ad559820c6c1dadaa20af5397e0cb2e898e175c1c9b",
|
||||
"public/build/assets/installation-BfdVc8uD.js": "a127fc1aa3eb38b9dfef1bc5ff20416f23f96dfd148e8f95f5220a73996400c6",
|
||||
"public/build/assets/installation-BIXGjdlr.js": "a5647893e4a4fe170a04c4bce9678080923290df41b899f3e3140ba3b69124cb",
|
||||
"public/build/assets/instrument-sans-400-normal-D1W7dsQl.woff": "797bd3eaa70edbd4757650ab44dad75fbfbfdf18bacedb4b71022c04621d30ad",
|
||||
"public/build/assets/instrument-sans-400-normal-DRC__1Mx.woff2": "9a91efaa3599a6ef01b2f49e9ec670e3a2f39baeef09c73198f1052cf3bb0850",
|
||||
"public/build/assets/instrument-sans-500-normal-Dk9ku72i.woff2": "9d3547da16d950d12a677c772a3ff9b69846e60e7dcd1b5efd540993f7286532",
|
||||
"public/build/assets/instrument-sans-500-normal-Z6ESRlEs.woff": "bd6a8dc8b0dc0cced0c32d3eda93f0e0e82c58ddefea8b53b3307b0c48da3089",
|
||||
"public/build/assets/instrument-sans-600-normal-B7fBEWYG.woff2": "efb770916eda95a0e31d80cccde9651d4e8617010b21220e9f227c4820d675da",
|
||||
"public/build/assets/instrument-sans-600-normal-B9e8oLYv.woff": "9b4ce1f2b26be7cb087fd87d6f99a202136292ec820af75bd38ab9e53895cf28",
|
||||
"public/build/assets/interactive-investment-map-1DTFk8zz.css": "13748a8189dc8c690fc902a1682d30ba289721688f32df4f2459a36de8e383de",
|
||||
"public/build/assets/interactive-investment-map-DMfgnj3H.js": "aed8a5f298ac8094127c1807518d473dda9857ffd83d300aaa57fc867a92c623",
|
||||
"public/build/assets/interest-cXIY1T8j.js": "624b87572a190b48ca7f29198ebed0d2a089bbe3333c38ad6b48a36d0133cbe7",
|
||||
"public/build/assets/interests-DgK4oIPL.js": "afe68d8f283930277a5cd0a2add08b84b99a6e31cd7b2c2c61967eeac2b78077",
|
||||
"public/build/assets/investment-map-panel-B3y9sT4K.js": "40773bf0878466ff3711524fee412448656412d60c3b7f56b884ae4d0c0a11bd",
|
||||
"public/build/assets/investment-maturity-CydhhEfV.js": "c2cc75070cb664ab0b53466dde584dd5473f1b5fd992bf6a59ca8a01b7e19623",
|
||||
"public/build/assets/investment-territory-CAtZylUI.js": "2cd39fd0dc10e0446e0205dd3c12197de356363e513ff0ac82ccdf2953809a08",
|
||||
"public/build/assets/investor-CgYk_3tZ.js": "cd795c48f7bbe8ab4e9ed56748f1e770d64c22a7604ca94e0e7d0fb23febcc41",
|
||||
"public/build/assets/investor-path-CAHGk6qB.js": "d097b941ba9393ef82351cbd6c1b3e96d17cc3a7d605e721a2ef282557db8422",
|
||||
"public/build/assets/investors-3qSj_vdv.js": "761a16226636a96693527bfc0775c9b1e81ff7d4d52b25454985cb9a3378a05e",
|
||||
"public/build/assets/jsx-runtime-BpzPEenQ.js": "60a64ced602d5e913f2a0328d2ec4a7b670c893614a26c47794317523d276398",
|
||||
"public/build/assets/label-D-C_NQs4.js": "6b4996b6f05276fd6edc8dd935f37f83a6c673cad5cf2f9dfa7cf4bdc92816ef",
|
||||
"public/build/assets/labels-DxqjesIG.js": "deace12e77e3f2e0515b1090cbc376cfeff29b59f57b1a2561b1145459c531b8",
|
||||
"public/build/assets/layers-2x-Bpkbi35X.png": "066daca850d8ffbef007af00b06eac0015728dee279c51f3cb6c716df7c42edf",
|
||||
"public/build/assets/layers-BWBAp2CZ.png": "1dbbe9d028e292f36fcba8f8b3a28d5e8932754fc2215b9ac69e4cdecf5107c6",
|
||||
"public/build/assets/lead-DxWmL_kg.js": "d1e294cfb27a64cdbfe385797ac633af9b17e298b5bb4e21d9dfbaf4e138b75c",
|
||||
"public/build/assets/leads-VF0TNZQk.js": "64b0d82efc2d78ad1c4a0180959ac455fdccbaa0ca11312f117a09b8a4fc2b54",
|
||||
"public/build/assets/leaflet-src-CUWrUTR2.js": "a26eda55b9706e8778766e4d32038202d20411081d7da16faaa39b977af36245",
|
||||
"public/build/assets/legacy-CX8Pcqkj.js": "977cb3622e6ab01bf0a83421e8ce7e998b98755e18cef18e83db6238b3e29f33",
|
||||
"public/build/assets/loader-circle-DS8Tf4er.js": "cd9fb22e9d7d12342d5e0941aac953ebb5184550cc8008b5c0f8f5ea6acd8ed2",
|
||||
"public/build/assets/login-jzFR8MDP.js": "d086860793d0c8cb5aeb97bfe4e93dfcdbb4d91f62c5079a7541d838c8b0b3e6",
|
||||
"public/build/assets/manage-oV4uuiPY.js": "9702a9a3c35cd27f13836538c9d9de9d526843fac6c1f04eaeda65a89b552dca",
|
||||
"public/build/assets/management-access-Dl70YCx1.js": "1d50024d467e7f6fa4be11cca48534b0b697520cf894282b33ba33cc95db026d",
|
||||
"public/build/assets/management-CvdeRZYq.js": "0c193b26e40abae535aa6b51d1734bd930e4d2570dd0033cf0b41efc47aa16cd",
|
||||
"public/build/assets/marker-icon-hN30_KVU.png": "574c3a5cca85f4114085b6841596d62f00d7c892c7b03f28cbfa301deb1dc437",
|
||||
"public/build/assets/notifications-BMW1U6bp.js": "1e9be633b00c40beea4bd57cd23faca0af681ffcec580f95f6a38f2f85867bf4",
|
||||
"public/build/assets/operation-key-Dr4VtGxa.js": "416fed7a5197657971af7f378998557c9dba2f99e266e39149b727e598bea439",
|
||||
"public/build/assets/opportunities-CynHgZN8.js": "c8c76ade20f216282c7d700c8213ba368e2e9ca4a85dcef139b8212c42627ea3",
|
||||
"public/build/assets/opportunity-draft-BRaQKzTE.js": "777716406f37f96f38610f6a5d4c13d86e89468d2a9a71ac875c4df126dddf48",
|
||||
"public/build/assets/opportunity-install-UhJQWeJO.js": "ae345b43224bef08aa4fb1360b5e45538e66eea7bb49841ed0b73f8c5bc3e835",
|
||||
"public/build/assets/opportunity-origin-C58zVMLD.js": "d63da42b2f390e075682da8797b82ba8fadc055361a433de30bf4c7ad7d35491",
|
||||
"public/build/assets/opportunity-resources-BxwE_edC.js": "744af4fb38c16196f87d45fa69040c6c6d14bfb4d48ff2b417c8dcf58a94a3e0",
|
||||
"public/build/assets/panel-DoG9Kx2C.js": "dbb887a171521d1c2104d52db44b4e179ad01e54fa6fc21f06c8abf05f97318c",
|
||||
"public/build/assets/partnership-source-links-VfrXk2FZ.js": "a4d6c8500f2417983312ae667b96f035df9654f37aa4a7bc86f0cc01fda0ddd8",
|
||||
"public/build/assets/passkey-verify-NFc-CF3v.js": "a553c50e2e1e1ce7a8e5b771cf1c585daadd866d9f311f8a37fa2fb85a0f9274",
|
||||
"public/build/assets/password-CB_NxgQN.js": "4415e495723009fc084111bafd2b7714221a3712e5f1d2a4dfa0e698f6308c7a",
|
||||
"public/build/assets/password-input-800gzAqm.js": "87f69ae4eacafa7d5d8d0611150e36d07d81ce4a18ac27c1138cb0e9564c5055",
|
||||
"public/build/assets/portal-api-tEuwFTsU.js": "190505d0a96d610ef2893cf06c63edab30f427593452bbc0dafc9d8f8a826c70",
|
||||
"public/build/assets/PortalInvestidor-CJTPGsKs.js": "bc30442669dab84e8496f7a44a4e4ac303f4f41b6bcf21524cdb7878392c3bc6",
|
||||
"public/build/assets/portfolio-Cav8D2m0.js": "bbb87c054a6efb7648a261f3c9ae20c120c078ca26cbeae4c3f9d0c366329203",
|
||||
"public/build/assets/print-EIzSB6Ku.js": "bad87486159deb855589aa92fc7032ea28de222693c2816f2ff54b1583ef6513",
|
||||
"public/build/assets/profile-C2D0GDDi.js": "ef08af156bf51a359409844c2d643cd1312f8dde68f9af7d99134d7ea6392b1a",
|
||||
"public/build/assets/profile-DgkfGEmf.js": "01a2d24ed9248cb0d26797237de9c037f3ca1ba0b5a811bbda1161f843452e8f",
|
||||
"public/build/assets/profile-json-Bb5H6-rZ.js": "0c4720d8d5baabfcc199d66bc171b014152f3cf2ff40b542d38e86cc1e04a77a",
|
||||
"public/build/assets/project-dossier-BRpAqBvm.js": "9906a87fcb5b99bea2eca25e68dc49c149c7b250056a8ac0977d2c8b6cf4e732",
|
||||
"public/build/assets/react-CjVep8xp.js": "3378f8538b0d8c51e3051e5005dfaebb8fec48c35789a3ba63945fd724f48e6f",
|
||||
"public/build/assets/references-QRKaiqAo.js": "d23eb6361cd7e943051e92c6f53f3d8fa15f6b197aa4e2395c1281e305eeb761",
|
||||
"public/build/assets/register-CFIbNqkL.js": "3205dc84ed80e6a16c84507b72dde4928f4b783785e1aaed654cc4b579b59688",
|
||||
"public/build/assets/relationship-repair-DUr4CEc7.js": "60bd0b82d5590cc02c7ce78fd334a5bbcc75b1d53f67becda35bc4271320c52c",
|
||||
"public/build/assets/request-BeXdBtUK.js": "801510b72f0347a8cae1ae79a29ad4b324c827444c9762b1f373df0919b071ef",
|
||||
"public/build/assets/request-Dk6pB4uX.js": "17caf06d5ce5bd1dbf009153d99e2a82ebabf7892b4d1d17de0d88ecb6f1529d",
|
||||
"public/build/assets/reset-password-Dj2SN5De.js": "887a55501bb58416fa999e76f3d611c852c3852f373127a5faffa6b66a2c468c",
|
||||
"public/build/assets/result-Dix1Y48H.js": "1cf667f9b50d94268dcd2c898a2df4647b88411c0c42ce1064a22f9829e1eeec",
|
||||
"public/build/assets/rolldown-runtime-Dd_uD5pT.js": "c5f0356f5d0918a3137e4e811fd18950efe8ac8f6bf84d1d4da7811c477a24d8",
|
||||
"public/build/assets/room-D4QleVxx.js": "9dfa83888b34fc4be0c9993ff081a39b5cb000d6b2313348413c2730a1d6ba2c",
|
||||
"public/build/assets/security-CabZ3cQh.js": "e15b0109cb01cd9afff3b231d9705774c7bbac8ef73e17ea1a2849765a207b0e",
|
||||
"public/build/assets/services-BkXCtUxT.js": "431bd409af7e59fef070ae78b1bc115419671135168f941be8fafe9b0844faee",
|
||||
"public/build/assets/shared-Be9dJVpd.js": "26085aa075377583bb6e1f0ac430137dc18b698a734b3a16a618f5920048a425",
|
||||
"public/build/assets/shared-CjnuxCML.js": "08c8bb6dfcbd387ec83dee4dd2b142ed20db79406204f022e9c7d44b46a438e7",
|
||||
"public/build/assets/shared-CsqsakN8.js": "f870752a0ec6d6f7d3b04b2c9be6a31edc21de497850ba2f8f469fb7cf6277f3",
|
||||
"public/build/assets/shared-Dm0I4KSQ.js": "1f344ed97b051d9a9a9e47fa45558575b27b4f726f8d817772ddfd0f18827ee2",
|
||||
"public/build/assets/show-ChiKlf2m.js": "de35d2a085b85ada8031eb162a7bd15c2d92bd38bec2a0891415bcff8a2c9ab5",
|
||||
"public/build/assets/show-CoHXisA3.js": "7887c66f49aca4b90009e4f22805229d730b1bf7d94d3c5ad47f40eefc073afa",
|
||||
"public/build/assets/sources-Cu4uY_R7.js": "411c9a01250ba16c130294cb90f6bd7faa7bfa43de7125c05d0cf05f33495836",
|
||||
"public/build/assets/spinner-hD8hHC_m.js": "0091bbe0e4125cbe30ecd10ec9ff65cff9b7bd270125913d85b4449144aa91fd",
|
||||
"public/build/assets/structure-geography-Dj94rkvm.js": "d7b1381379bccc6b855ded6c755b71c304ef556fd3aa736fdfd5a5ac13bc048c",
|
||||
"public/build/assets/structures-r0gB3j4C.js": "22ef251a1d29c5f2b5c51947a700664327835bfc4a715a9b026275a485d18b37",
|
||||
"public/build/assets/submission-VU7hLmVD.js": "e01ad24a919e26c6bbb6f09b06244e13d5bb30f473bb38dbe7261ec46f4a9757",
|
||||
"public/build/assets/territorial-source-evidence-eKB4ZB36.js": "14048631c51933a0389cea37ae1909a02ea86d564a5a05452a48b40f055cd605",
|
||||
"public/build/assets/territory-associations-C_XD5z4x.js": "b1921c6c36ce12a46bfcde51dcc94dd9949b75c08ec409301521bbd132761477",
|
||||
"public/build/assets/territory-geometry-import-BX_uy558.js": "a7f525cba56f1c38bff6af80217adb5afba04b55cf25da27e679ff35aa153da0",
|
||||
"public/build/assets/territory-geometry-preview-CzWwAlz7.js": "1b7b66ebe582133bb4dc1db71513494090b0c24e8f81fdf6e67706173e024dff",
|
||||
"public/build/assets/text-link-BBvcP60s.js": "0e7b5234d766855dbcbd5a78fe3e8c54fa6ffa1ad6163009d7b312eafd19f307",
|
||||
"public/build/assets/two-factor-challenge-C4aqohq1.js": "b8d40552013eefa3b613717ad6b08d30aaf90fbe33cab00ed153df206e30ed30",
|
||||
"public/build/assets/types-BoD_IJFv.js": "75c4a127c1aa0b90fe0b4f956c7e3ae9c67bc0f862c89cd0a594709027b983da",
|
||||
"public/build/assets/types-Cxp_Nskt.js": "cf4ae8cb539c697ca751dcf96e1db3af9eb1ff00807c088268dd859e7c4a5dab",
|
||||
"public/build/assets/use-two-factor-auth-kpel6Zcb.js": "771c519273e76ec8a5bea59c35605f01e5a55b353443c742c8f22d7bd9691504",
|
||||
"public/build/assets/utils-CCDJ05Ll.js": "ef54f43266d404b8ffe4e5487b346060eaf81d819317f523c966aa3e7490deb8",
|
||||
"public/build/assets/value-network-vl3fl6wX.js": "675a3896073ea3cab00d2e922b235df7144fe88d8d43672e143b7f68c5dcdc3d",
|
||||
"public/build/assets/value-text-BztaYdGl.js": "873576810a6ba4eb8c9c116f53cdc649b21ab2995aa2adadd4c85130b04bacd2",
|
||||
"public/build/assets/verification-BOcn3HIw.js": "10addac3d8f1865e855943e0685e88a268ffd8013ff7a7d51fb89d755b12074e",
|
||||
"public/build/assets/verify-email-aYM8xdIY.js": "333d5e444be39ab1a43b589d97d2158a1eb760fdbf38fd14bc982b347fb7e945",
|
||||
"public/build/assets/wayfinder-Dp7PqxvV.js": "3d4c90228fda731e37f541f3087fdf5387d9d59433e35b267b64a97196f70781",
|
||||
"public/build/assets/welcome-BqroVPkW.js": "dcc8305eadbf6d1d96c622ab3e9a8609a8ebd66b38f9313ef533a32eeaf3475c",
|
||||
"public/build/assets/workspace-4_R1CLYI.js": "5d4c742569d9ad33ac7bac01c6433c646f79f939d2f57b7878860c0d25dcee22",
|
||||
"public/build/assets/workspace-B8RMT4ab.js": "184b3135df3478cb884671081eec94d0e7ce93a0c17de33513667f246d41ba8c",
|
||||
"public/build/assets/workspace-Bj94ZPqK.js": "41ddb0726becd8aede1af9f052bfbb9556b749052b0345369a2eba2bca573c93",
|
||||
"public/build/assets/zone-attachments-ps8pFT8x.js": "61c3db88e33f79dfe65001190eda5204da35f5ccfb2eef4d9ffeb765440eb613",
|
||||
"public/build/assets/zone-Cmp4qcnq.js": "f742a6479aebc1eb656588fba056beb33a0aaf841e9267617d823c6fe08b8199",
|
||||
"public/build/assets/zone-map-C0_1Ob-D.js": "0c73a1a32f0c0e1bbe3106101ba27fead1fd3faf1645f71f51f52fcd57a67b98",
|
||||
"public/build/assets/zone-relations-BaZ0zsi4.js": "aa13bbdc526be2de78896f351e6a24597176255896b03eab293c352bf710ec31",
|
||||
"public/build/assets/zones-CnT9Whji.js": "ba2b455f23f6c8e019528ae78252ba47cb276cbcd2e7d43eb7fe773c4e5b54b2",
|
||||
"resources/js/components/opportunity-canonical-fields.tsx": "d915c02e7c01499018bb090e1e71bdd376e15c9c36ed32830adbdf627ad3ac05",
|
||||
"resources/js/components/opportunity-parcel-geometry.tsx": "0fa65eeade8d6e1a1b11ccd079fb40f9247dcd45105563d2f7665e7490a1edaf",
|
||||
"resources/js/components/opportunity-profile-actions.tsx": "fc15c2e1d07b027ccedb26fd673b67f018cd956f1f025cec8e1b358614cb65d7",
|
||||
"resources/js/components/territory-geometry-preview.tsx": "a93b28be70f69540e965293983818eed601ee9af6d083abe2390ef274317711d",
|
||||
"resources/js/pages/management/opportunities.tsx": "38f2095ee7881117fcfc08284cb96619aea1217bcebc57be2908712b043cc63f",
|
||||
"resources/js/pages/management/opportunity-draft.tsx": "c7970d9288ee9f4230f5dd5021c301deb81dc7a1c6a57d0fc54355a2222d124c"
|
||||
},
|
||||
"base_hashes": {
|
||||
"app/Services/OpportunityCanonicalContract.php": "4f8eac01d4386f588903c6aa43a346687e7b7654a22e77979a8c830b6e983ef4",
|
||||
"app/Services/OpportunityCanonicalResponse.php": "030d41001b65f473c00dcfc168c6c0cf227f58b88456928a19f05d0225e77a07",
|
||||
"app/Services/OpportunityProfileWorkflow.php": "e1cfd35a85671ce8182b8f434c0b23b469cf317ed1ec484c30b06f83c0ab8473",
|
||||
"app/Services/OpportunityReviewConditions.php": null,
|
||||
"app/Services/OpportunityReviewMateriality.php": "2a3035683b5f402bc446c0f55e57b00f265b7c9ccd9d4b9c3afe5bc63f965eae",
|
||||
"app/Services/PortalProfileAccess.php": "0c3a1fa59ee4f5b0b36fe1709678c2742129d45250cec0760a64938bebd0e4b2",
|
||||
"resources/js/components/opportunity-canonical-fields.tsx": "7a9a7e6939d41c9ed95871eda66a9b4012e3e5c7e53efccc193bb856a2972d17",
|
||||
"resources/js/components/opportunity-parcel-geometry.tsx": "9f8077c38ffb03bc08b4143e02050dcc6ba9ffd186e28f54776ed34400515cee",
|
||||
"resources/js/components/opportunity-profile-actions.tsx": "13c4ca84a596896e0de0f042612e8f107f0006dae22fe9a3b9aa558709747536",
|
||||
"resources/js/components/territory-geometry-preview.tsx": "e1b9abd95cfc2b6009742ed78939f50f25d97c91285a5ccd1200bd13a95a7c13",
|
||||
"resources/js/pages/management/opportunities.tsx": "c1784c49be1573c4b823f1c4f222b68e823843692fd0f7026bf8f2ad5389c65d",
|
||||
"resources/js/pages/management/opportunity-draft.tsx": "2e71d446eeb637c7f1abf0a12b7796de97a09ea16eb18a7698b6ebc39c4a674b"
|
||||
},
|
||||
"unchanged_dependencies": {
|
||||
"database/migrations/2026_10_09_020000_extend_opportunity_management.php": "8a804748cc6b2b537bb7c0e10e09dff3dc4d89b6c974b9f909a198adb2dd048d",
|
||||
"database/migrations/2026_10_09_030000_extend_opportunity_resources.php": "d4e5c753ede8216e1d383865178c6db37c5422c21c3c8e7458cd4ee1e68659ed",
|
||||
"database/migrations/2026_10_10_040000_create_portal_profile_authorization.php": "797c27b5f201b65e825fbdea6fd0ea49de2f9d48b1a9bf210d76af285224cc93",
|
||||
"app/Services/OpportunityResourceInstallation.php": "791b17af7e003ff25160e6487341d7c6195a07fe47438435f4c5b0f052ffd7d5",
|
||||
"app/Services/PortalProfileInstallation.php": "45dd037998402e21ea3e0be0361e79d3daca40b8413d9a952cbe49e7b6937a8b",
|
||||
"app/Services/OrganizationCountryInstallation.php": "fe7ab6843cb16c89e794ee23439bd322b55dede71c8ba15adc0e56f51ca8afe5",
|
||||
"composer.lock": "af90565c70188372ea1744c65bceb1d71c0400c6a028cda610fea0730b81b296",
|
||||
"package-lock.json": "88f5ce8bb55056331476d0eaf8a2278fff4a8b98c0e5e1663765e2b2eb725490"
|
||||
},
|
||||
"production_manifest_sha256": "bd21670e9922c5ebef80b15d03d5d713d3dcc12301302cd4b2b8735e53033bad",
|
||||
"profile_fingerprint": "b11dc27b8e10fa9f94cfd5d548e1ab59e4bc36efb7113fcd72be7027094022fb",
|
||||
"included_categories": [
|
||||
"investment_project",
|
||||
"real_estate",
|
||||
"land_rights",
|
||||
"business_sale",
|
||||
"business_partnership",
|
||||
"franchise"
|
||||
],
|
||||
"scope": "Six tested base branches, existing compatible Response, conditions/materiality, resources, filters and nine-route accessibility",
|
||||
"excluded": [
|
||||
"integrated journey/190000",
|
||||
"legacy",
|
||||
"experimental modules",
|
||||
"offers",
|
||||
"SLA",
|
||||
"opportunity restoration pending decision",
|
||||
"full normative Response/27",
|
||||
"all category modalities",
|
||||
"individual opportunity-document ACL",
|
||||
"real devices/full accessibility"
|
||||
],
|
||||
"effects": {
|
||||
"code_files": 12,
|
||||
"new_service_files": 1,
|
||||
"assets": 158,
|
||||
"new_routes": 0,
|
||||
"configuration_files": 0,
|
||||
"new_runtime_services": 0,
|
||||
"prospective_installations": [
|
||||
"030000",
|
||||
"040000"
|
||||
],
|
||||
"prospective_new_tables": 7,
|
||||
"prospective_new_columns": 5,
|
||||
"automatic_new_accounts": 0,
|
||||
"automatic_organizations": 0,
|
||||
"automatic_representations": 0,
|
||||
"automatic_publications": 0,
|
||||
"active_writes_this_increment": 0
|
||||
},
|
||||
"preserved": [
|
||||
"COUNTRY02 ON/050000",
|
||||
"HTTPS/session cookie/history encryption",
|
||||
"A/B and C37 closures",
|
||||
"existing URLs/IDs/classifications/relations/audit"
|
||||
],
|
||||
"COUNTRY02_compatibility": {
|
||||
"result": "passed",
|
||||
"at": "2026-10-11T12:24:28+00:00",
|
||||
"active_current_COUNTRY02_fingerprint": "162daff6ce08117582dd7d796639d02b156d1b940cd85ef3587ff88a65747edd",
|
||||
"candidate_COUNTRY02_fingerprint": "b244311e5b2881403f1932d5add2cea539df7c72f107e59ec09b1475c09fa584",
|
||||
"installed_QA": true,
|
||||
"country_flag_QA": true,
|
||||
"historical_readiness_reuse_permitted": false,
|
||||
"effect": "Shared PortalProfileAccess fingerprint changes; COUNTRY02 remains installed/enabled, no 050000 reapplication or country schema/data/cipher changes. New installation previews/operation scopes must be refreshed.",
|
||||
"new_active_writes": 0,
|
||||
"full_country_regression_not_repeated": true
|
||||
},
|
||||
"QA_backup": {
|
||||
"at": "2026-10-11T12:10:22+00:00",
|
||||
"source": {
|
||||
"database": "stability_consumers_20261011_084534_test",
|
||||
"port": 55441
|
||||
},
|
||||
"restored": {
|
||||
"database": "functional_restore_20261011_120948_test",
|
||||
"port": 55441
|
||||
},
|
||||
"tables": 295,
|
||||
"sequences": 31,
|
||||
"files": 270,
|
||||
"dump_sha256": "dace310ef7f698d594ee60e10305064e80c224d03d648f96743dd31dd8387c28",
|
||||
"files_sha256": "5f08039b6520cd34a9f23e6f4f24106c431c492c9c7b0bb01bcc36e429fd4372",
|
||||
"MFA_envelopes_readable": 16,
|
||||
"intentional_negative_controls": [
|
||||
{
|
||||
"actor_id": 19,
|
||||
"expected_decryption_rejection_preserved": true,
|
||||
"authenticated": false
|
||||
}
|
||||
],
|
||||
"historical_cipher_bytes_unchanged": true,
|
||||
"no_runtime_key_changes": true
|
||||
},
|
||||
"QA_evidence": {
|
||||
"functional-workflow-chromium-20261011.json": "b59e55ae5e916d52b415ec596ef5390d0fb9533f79bc0b76d7168fa9053c9804",
|
||||
"functional-land-publication-chromium-20261011.json": "6da9cd2a4c3bcce083dd629594529032411b1f948aafba1ceb83ab093a378833",
|
||||
"functional-coedit-resources-chromium-20261011.json": "8e760428e2fd0a93e66683d5b4e133c779af69e86edc39e36e27266cabd5ca20",
|
||||
"functional-documents-chromium-20261011.json": "55fe98a9ec73246c268779afad62b24db788c4db1af8802cbd5ac002b0a6ce15",
|
||||
"functional-filters-chromium-20261011.json": "cf09e9f94d171e443e6cf89dc0535beff7a6b427068e35dd01e161983c596930",
|
||||
"functional-filters-persistence-qa-20261011.json": "90a5ef5a7ec870bd676abad8995ec48c87543402f962d7e7dda42b0a360000e2",
|
||||
"functional-accessibility-chromium-20261011.json": "8c9dcd352c8f5945dd08edf13b4d9c9e3f3dc8e984737b2ab148f0aa07dd85d7",
|
||||
"functional-joint-chromium-20261011.json": "4c0fb8781b11758a1ac16634b7e4d902fcb84ac292c44e626d40b9ffc22f0a19",
|
||||
"functional-materiality-semantic-qa-20261011.json": "17defc663c0cc3f609bfaa9cc5d0da525fc1bf087a3d5efe1e34c282f9644728",
|
||||
"functional-category-semantics-qa-20261011.json": "072d9fbafa24d9b5a27c77cd440fbd07ea3debea67cc0f747a29c920275fdace",
|
||||
"functional-conditions-semantic-qa-20261011.json": "46ba2a3bab6ffaaf9e5a94a60a31898e6d4378fc0973cc219d011d604f6f9786",
|
||||
"functional-final-persistence-qa-20261011.json": "b632a5dac385d214f1faf03d1686c8a23d7f5f1044396246a654d2328077b0b9",
|
||||
"functional-backup-restoration-qa-20261011.json": "5a49550faeb62fd61e28bc4d65decd0791275108d0fd3ca1f767d585ec16d3a2",
|
||||
"functional-production-build-20261011.json": "900b91c12e3cad124a7711f5f436a02a538c5a162fd83f9ea937d83608fe6a50",
|
||||
"functional-country-compatibility-qa-20261011.json": "3c813795b5fe100565bc17ac5f1a095a111292095857499a931dfdd0241909f3"
|
||||
},
|
||||
"destination_service_proof_sha256": "f3dac379d3ac7d4f187361115065e09c9261fcf47286c72967674015a1d43899",
|
||||
"activation_authorized": false,
|
||||
"activation_ready": false,
|
||||
"activation_blocks": [
|
||||
"Destination ClamD signatures_stale (>48h)",
|
||||
"Destination supervised queue worker not yet demonstrated",
|
||||
"Legitimate role holders/designations and authorization scope not assigned",
|
||||
"Final target-specific backup/restoration/readiness previews required",
|
||||
"Administrative map limits require separate geometry activation: destination has zero geometries"
|
||||
],
|
||||
"destination_inventory": {
|
||||
"at": "2026-10-11T12:14:31+00:00",
|
||||
"identity": {
|
||||
"database": "investemoz",
|
||||
"port": 5432,
|
||||
"read_only": "on"
|
||||
},
|
||||
"tables": 288,
|
||||
"counts": {
|
||||
"users": 13,
|
||||
"organizations": 0,
|
||||
"memberships": 0,
|
||||
"geo_locations": 1990,
|
||||
"geo_geometries": 0,
|
||||
"opportunity_documents": null,
|
||||
"opportunity_images": null,
|
||||
"opportunity_location_drafts": null,
|
||||
"portal_role_assignments": null
|
||||
},
|
||||
"flags": {
|
||||
"organization_country_enabled": true,
|
||||
"profile_access_enabled": false,
|
||||
"opportunity_dashboard_access_enabled": false,
|
||||
"opportunity_specialized_drafts_enabled": false,
|
||||
"opportunity_modular_profiles_qa_enabled": false,
|
||||
"legacy_content_qa_enabled": false
|
||||
},
|
||||
"journey_enabled": false,
|
||||
"migrations": [
|
||||
"2026_10_09_020000_extend_opportunity_management",
|
||||
"2026_10_10_050000_extend_organization_country"
|
||||
],
|
||||
"active_manifest_sha256": "250ae618d716c0ffff1cfe3409cf55ba18e52f0ec86d305aa938fe2375adda4b",
|
||||
"active_writes": 0
|
||||
},
|
||||
"restoration_proposals": {
|
||||
"R-ARCHIVE": "Independent authorized Publisher, reason/audit -> needs_information/nonpublic new review, never automatic republication",
|
||||
"R-DRAFT": "Author/authorized organization Promotor only never-submitted/never-published logical draft -> draft; separate policy decision"
|
||||
},
|
||||
"QA_without_integrated_journey": true,
|
||||
"revision": "3d9d392e0a0f73ae18c8c2c7084ee6a213dc2000d2f085881c6b5ced52de546e",
|
||||
"sealed_at": "2026-10-11T12:27:17.028688+00:00"
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"revision": "3d9d392e0a0f73ae18c8c2c7084ee6a213dc2000d2f085881c6b5ced52de546e",
|
||||
"code_revision": "df6be252f1a0b60ac40836ba77af29e58e32269808484bca7126594053d48045",
|
||||
"archive": "investmoz-workflow-3d9d392e0a0f.zip",
|
||||
"sha256": "6366c49d44cdc4242f4f93da5f5c1a53f2292d9eb485f70ef2b4e9a9f88589e9",
|
||||
"manifest_sha256": "7cd603d8810a7633b1315345f3ecbd217a35519fa420c05438e2f9a3b2d71e07",
|
||||
"code_files": 12,
|
||||
"assets": 158,
|
||||
"QA_restore_verified": true,
|
||||
"activation_ready": false,
|
||||
"activation_authorized": false,
|
||||
"active_writes": 0
|
||||
}
|
||||
+473
@@ -0,0 +1,473 @@
|
||||
<?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 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', 'Use a organização representada ou o autor individual; não outra identidade.');
|
||||
$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?->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, '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'])) : []];
|
||||
}
|
||||
}
|
||||
+148
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Opportunity;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
|
||||
|
||||
/** Read adapter only: preserve persisted identifiers and make unresolved metadata explicit. */
|
||||
class OpportunityCanonicalResponse
|
||||
{
|
||||
public const VERSION = 'opportunity-response-existing-ids-20261011-4';
|
||||
|
||||
/** @return array<string,mixed> */
|
||||
public function read(User $actor, Opportunity $record): array
|
||||
{
|
||||
$access = app(PortalProfileAccess::class);
|
||||
$access->authorize($actor, 'view', $record);
|
||||
$payload = app(OpportunityManagement::class)->values($record)['canonical'] ?? [];
|
||||
$context = $record->workflow_context ?? [];
|
||||
$data = [...app(OpportunityCanonicalMetadata::class)->project($payload, $context['canonical_items'] ?? []), 'id' => $record->id, 'opportunity_code' => $record->reference,
|
||||
'opportunity_category' => $record->opportunity_category, 'status' => $access->state($record),
|
||||
'version' => (int) $record->management_version, 'is_deleted' => $record->trashed(),
|
||||
'deleted_at' => $record->deleted_at?->toIso8601String(), ...$this->rootMetadata($record)];
|
||||
foreach (['submitted' => 'submission', 'approved' => 'approval', 'published' => 'publication', 'archived' => 'archive'] as $prefix => $key) {
|
||||
$data[$prefix.'_by'] = $context[$key]['actor_id'] ?? null;
|
||||
$data[$prefix.'_at'] = $context[$key]['at'] ?? null;
|
||||
}
|
||||
$completion = app(OpportunityCompleteness::class)->calculate($payload);
|
||||
$data['completion_percentage'] = $completion['percentage'];
|
||||
$errors = [];
|
||||
try {
|
||||
app(OpportunityCanonicalContract::class)->validateSubmission($record);
|
||||
} catch (ValidationException $failure) {
|
||||
$errors = $failure->errors();
|
||||
} catch (HttpExceptionInterface $failure) {
|
||||
$errors = ['canonical.resources' => ['Recurso indisponível para validação; estado HTTP '.$failure->getStatusCode().'. Preserve o original e resolva a operação afetada.']];
|
||||
}
|
||||
$data['validation_result'] = ['errors' => $errors, 'warnings' => [], 'rule' => OpportunityCanonicalContract::VERSION,
|
||||
'evaluated_at' => now()->toIso8601String(), 'persisted_submission_hash' => $context['submission']['hash'] ?? null,
|
||||
'external_decision' => 'not_inferred'];
|
||||
$mutations = [];
|
||||
foreach (DB::table('audit_events')->where('source_system', 'opportunity-resources')->where('after_data->opportunity_id', $record->id)->orderBy('occurred_at')->orderBy('id')->get(['actor_user_id', 'action', 'occurred_at', 'after_data']) as $event) {
|
||||
$detail = json_decode($event->after_data, true, 512, JSON_THROW_ON_ERROR);
|
||||
$mutations[$detail['resource_id']][] = ['actor' => $event->actor_user_id, 'action' => $event->action, 'at' => $event->occurred_at, 'reason' => $detail['reason'] ?? null];
|
||||
}
|
||||
$references = [];
|
||||
foreach (OpportunityResources::KINDS as $kind) {
|
||||
$references[$kind] = $payload[$kind] ?? [];
|
||||
$rows = [];
|
||||
if (app(OpportunityResources::class)->installed()) {
|
||||
foreach (app(OpportunityResources::class)->listing($record->id, $kind) as $row) {
|
||||
$rows[$row->id] = $row;
|
||||
}
|
||||
}
|
||||
$data[$kind] = array_map(function (string $id) use ($rows, $kind, $mutations): array {
|
||||
$row = $rows[$id] ?? null;
|
||||
if ($row === null) {
|
||||
return ['id' => $id, 'availability' => 'unavailable'];
|
||||
}
|
||||
$value = [...$row->payload, 'id' => $row->id, 'version' => (int) $row->version,
|
||||
'is_deleted' => $row->deleted_at !== null, 'deleted_at' => $row->deleted_at,
|
||||
'created_by' => $row->created_by, 'created_at' => $row->created_at, 'updated_at' => $row->updated_at];
|
||||
$events = $mutations[$id] ?? [];
|
||||
$last = $events ? $events[array_key_last($events)] : null;
|
||||
$deletion = $row->deleted_at && ($last['action'] ?? '') === 'delete' ? $last : null;
|
||||
$value['updated_by'] = $last['actor'] ?? ((int) $row->version === 1 ? $row->created_by : null);
|
||||
$value['deleted_by'] = $deletion['actor'] ?? null;
|
||||
$value['delete_reason'] = $deletion && $deletion['reason'] ? Crypt::decryptString($deletion['reason']) : null;
|
||||
$value['mutation_metadata_source'] = $last ? 'existing_audit_events' : 'creation_record_only';
|
||||
if ($kind !== 'locations') {
|
||||
$value['original_name'] = $row->file?->file_name;
|
||||
$value['mime_type'] = $row->file?->media_type;
|
||||
$value['sha256'] = $row->file?->sha256;
|
||||
$value['scan_recorded_status'] = $row->file?->malware_scan_status;
|
||||
}
|
||||
|
||||
return $value;
|
||||
}, $references[$kind]);
|
||||
}
|
||||
|
||||
return ['adapter_version' => self::VERSION,
|
||||
'source_schema_sha256' => hash_file('sha256', resource_path('data/investmoz-opportunity-modular.schema.json')),
|
||||
'data' => $data, 'resource_references' => $references,
|
||||
'completion' => $completion, 'materiality' => $context['materiality'] ?? null,
|
||||
'review_conditions' => array_values($context['conditions'] ?? []),
|
||||
'deleted_inline_items' => array_values($context['canonical_items']['deleted'] ?? []),
|
||||
'validation_result' => ['scope' => 'current_payload_validation_and_recorded_submission_metadata', 'submission_hash' => $context['submission']['hash'] ?? null,
|
||||
'submitted_content_revision' => $context['submission']['content_revision'] ?? null,
|
||||
'current_content_revision' => $context['content_revision'] ?? 1,
|
||||
'revalidated_on_read' => true, 'external_decision' => 'not_inferred'],
|
||||
'publication' => $record->publicationPresentation(),
|
||||
'compatibility' => ['normative_response_complete' => false, 'opportunity_actor_sector_ids' => 'existing bigint, not converted to UUID',
|
||||
'modular_decision' => 'Functional approval of four modular contracts and SLA remains pending; legacy integration did not approve them. Historical snapshot annotations are preserved, not current approvals.',
|
||||
'opportunity_code' => 'existing reference preserved; no INV-MZ code invented',
|
||||
'states' => 'existing workflow values preserved; no implicit stage equivalence',
|
||||
'inline_modules' => 'management_draft canonical JSON with audited revisions; no parallel specialized tables',
|
||||
'state_correspondence' => ['draft' => 'draft', 'needs_information' => 'returned', 'submitted' => 'submitted', 'approved' => 'approved', 'published' => 'published', 'suspended' => 'suspended', 'archived' => 'archived', 'rejected' => 'rejected'],
|
||||
'unmapped_review_states' => 'in_review/information_pending preserve parallel gates; no single normative stage inferred',
|
||||
'metadata_gaps' => ['Legacy inline creation metadata can be unknown; first observation is not creation. Ambiguous changed collection rows get new identities with previous identities retained as deleted.', 'Existing bigint IDs remain explicit compatibility differences; no renumbering.']]];
|
||||
}
|
||||
|
||||
/**
|
||||
* Recover actors from existing audited versions; an imported creator must never be inferred.
|
||||
*
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
private function rootMetadata(Opportunity $record): array
|
||||
{
|
||||
$events = [];
|
||||
foreach (DB::table('audit_events')->whereIn('source_system', ['opportunity-management', 'portal-profiles-v1'])
|
||||
->where('after_data->record_id', $record->id)->get(['source_system', 'actor_user_id', 'action', 'after_data']) as $event) {
|
||||
$detail = json_decode($event->after_data, true, 512, JSON_THROW_ON_ERROR);
|
||||
$version = $detail['version'] ?? $detail['after']['version'] ?? null;
|
||||
if (! is_int($version)) {
|
||||
continue;
|
||||
}
|
||||
$events[$version] = ['actor' => $event->actor_user_id, 'action' => $event->action,
|
||||
'reason' => $detail['reason'] ?? null, 'encrypted_reason' => $event->source_system === 'opportunity-management'];
|
||||
}
|
||||
ksort($events);
|
||||
$creation = null;
|
||||
$deletion = null;
|
||||
foreach ($events as $event) {
|
||||
if ($event['action'] === 'draft_created') {
|
||||
$creation = $event;
|
||||
}
|
||||
if ($event['action'] === 'delete') {
|
||||
$deletion = $event;
|
||||
}
|
||||
}
|
||||
$latest = $events[(int) $record->management_version] ?? null;
|
||||
$deletion = $record->trashed() ? $deletion : null;
|
||||
|
||||
return ['created_by' => $creation['actor'] ?? null, 'created_at' => $record->created_at?->toIso8601String(),
|
||||
'updated_by' => $latest['actor'] ?? null, 'updated_at' => $record->updated_at?->toIso8601String(),
|
||||
'deleted_by' => $deletion['actor'] ?? null,
|
||||
'delete_reason' => $deletion && $deletion['reason'] ? ($deletion['encrypted_reason'] ? Crypt::decryptString($deletion['reason']) : $deletion['reason']) : null,
|
||||
'mutation_metadata_source' => 'existing_audit_events_and_record_timestamps',
|
||||
'mutation_metadata_gaps' => array_values(array_filter([
|
||||
$creation === null ? 'No recorded creation actor; imported ownership does not establish creation.' : null,
|
||||
$latest === null ? 'No audit actor matching the current management version; no updater inferred.' : null,
|
||||
]))];
|
||||
}
|
||||
}
|
||||
+496
@@ -0,0 +1,496 @@
|
||||
<?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;
|
||||
|
||||
class OpportunityProfileWorkflow
|
||||
{
|
||||
public function __construct(private PortalProfileAccess $access, private OpportunityManagement $management,
|
||||
private OpportunityCanonicalContract $contract, private OpportunityWorkflowTasks $tasks) {}
|
||||
|
||||
/** @return list<string> */
|
||||
public function actions(User $actor, Opportunity $record): array
|
||||
{
|
||||
if ($record->owner_user_id === null || ! $this->access->canView($actor, $record)) {
|
||||
return [];
|
||||
}
|
||||
$actions = [];
|
||||
$state = $this->access->state($record);
|
||||
if ($this->access->scoped($actor, 'promoter', $record->organization_id, $record->opportunity_category)
|
||||
&& ($record->organization_id !== null || (int) $record->owner_user_id === $actor->id)
|
||||
&& $this->access->operational($actor, 'edit', $record->id)) {
|
||||
if (in_array($state, ['draft', 'needs_information'], true)) {
|
||||
$actions[] = 'submit';
|
||||
}
|
||||
if (in_array($state, ['approved', 'published', 'suspended'], true)) {
|
||||
$actions[] = 'request_revision';
|
||||
}
|
||||
if (! in_array($state, ['archived', 'rejected'], true)) {
|
||||
$actions[] = 'request_archive';
|
||||
}
|
||||
if ($state === 'rejected' && empty($record->workflow_context['appeal']['pending'])) {
|
||||
$actions[] = 'appeal';
|
||||
}
|
||||
}
|
||||
if ($this->access->mfa($actor) && ! $this->access->conflict($actor, $record)) {
|
||||
if ($this->access->scoped($actor, 'validator', $record->organization_id, $record->opportunity_category) && $this->access->operational($actor, 'validate', $record->id)) {
|
||||
if ($state === 'approved' && count(array_filter($record->workflow_context['conditions'] ?? [], fn ($condition) => $condition['status'] === 'open' && $condition['blocking_action'] === 'publish')) > 0) {
|
||||
$actions[] = 'review_gate';
|
||||
}
|
||||
if ($state === 'submitted') {
|
||||
$actions[] = 'start_review';
|
||||
}
|
||||
if (in_array($state, ['submitted', 'in_review', 'information_pending'], true)) {
|
||||
array_push($actions, 'request_correction', 'pending_opinion', 'reject', 'review_gate', 'approve');
|
||||
if ($this->responsibility($actor, $record, 'validation_coordinator')) {
|
||||
$actions[] = 'assign_review';
|
||||
}
|
||||
}
|
||||
if ($state === 'rejected' && ($record->workflow_context['appeal']['pending'] ?? false)
|
||||
&& $this->responsibility($actor, $record, 'appeal_reviewer')
|
||||
&& (int) ($record->workflow_context['rejection']['actor_id'] ?? 0) !== $actor->id) {
|
||||
array_push($actions, 'appeal_uphold', 'appeal_reopen');
|
||||
}
|
||||
if (count(array_filter($record->workflow_context['opinions'] ?? [], fn ($opinion) => ($opinion['recipient_id'] ?? 0) === $actor->id && ($opinion['status'] ?? '') === 'pending')) > 0) {
|
||||
$actions[] = 'respond_opinion';
|
||||
}
|
||||
}
|
||||
if ($this->access->scoped($actor, 'publisher', $record->organization_id, $record->opportunity_category)) {
|
||||
if ($state === 'approved' && $this->access->operational($actor, 'publish', $record->id)
|
||||
&& (int) ($record->workflow_context['approval']['actor_id'] ?? 0) !== $actor->id) {
|
||||
$actions[] = 'publish';
|
||||
if ($this->responsibility($actor, $record, 'publication_coordinator')) {
|
||||
$actions[] = 'assign_publication';
|
||||
}
|
||||
}
|
||||
if ($this->access->operational($actor, 'archive', $record->id)) {
|
||||
if ($record->status === 'published') {
|
||||
$actions[] = 'suspend';
|
||||
}
|
||||
if ($state !== 'archived') {
|
||||
$actions[] = 'archive';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($record->workflow_context['assignment']['assignee_user_id']) && (int) $record->workflow_context['assignment']['assignee_user_id'] !== $actor->id) {
|
||||
$actions = array_values(array_diff($actions, ['start_review', 'request_correction', 'pending_opinion', 'reject', 'review_gate', 'approve']));
|
||||
}
|
||||
if (isset($record->workflow_context['publication_assignment']['assignee_user_id']) && (int) $record->workflow_context['publication_assignment']['assignee_user_id'] !== $actor->id) {
|
||||
$actions = array_values(array_diff($actions, ['publish']));
|
||||
}
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
/** Scoped names/IDs only; no secrets or implicit assignees.
|
||||
* @return array<string,mixed> */
|
||||
public function participants(User $actor, Opportunity $record): array
|
||||
{
|
||||
$this->access->authorize($actor, 'view', $record);
|
||||
if (! $this->access->has($actor, 'validator') && ! $this->access->has($actor, 'publisher')) {
|
||||
return ['validators' => [], 'publishers' => [], 'condition_responsibles' => []];
|
||||
}
|
||||
$result = ['validators' => [], 'publishers' => [], 'condition_responsibles' => []];
|
||||
foreach (User::whereNotNull('email_verified_at')->whereNotNull('two_factor_confirmed_at')->get() as $candidate) {
|
||||
if ($this->access->canView($candidate, $record) && (($this->access->scoped($candidate, 'promoter', $record->organization_id, $record->opportunity_category) && $this->access->operational($candidate, 'edit', $record->id))
|
||||
|| ($this->access->scoped($candidate, 'validator', $record->organization_id, $record->opportunity_category) && $this->access->operational($candidate, 'validate', $record->id)))) {
|
||||
$result['condition_responsibles'][] = ['id' => $candidate->id, 'name' => $candidate->name];
|
||||
}
|
||||
if ($this->access->conflict($candidate, $record)) {
|
||||
continue;
|
||||
}
|
||||
foreach (['validator' => 'validators', 'publisher' => 'publishers'] as $role => $list) {
|
||||
if ($this->access->scoped($candidate, $role, $record->organization_id, $record->opportunity_category) && $this->access->operational($candidate, $role === 'validator' ? 'validate' : 'publish', $record->id)) {
|
||||
if ($role === 'publisher' && (int) ($record->workflow_context['approval']['actor_id'] ?? 0) === $candidate->id) {
|
||||
continue;
|
||||
}
|
||||
$result[$list][] = ['id' => $candidate->id, 'name' => $candidate->name, 'technical' => $this->responsibility($candidate, $record, 'technical_reviewer'), 'legal' => $this->responsibility($candidate, $record, 'legal_reviewer')];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/** @return list<string> */
|
||||
public function submissionGaps(Opportunity $record): array
|
||||
{
|
||||
try {
|
||||
$this->contract->validateSubmission($record);
|
||||
|
||||
return [];
|
||||
} catch (ValidationException $error) {
|
||||
return array_keys($error->errors());
|
||||
}
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $input */
|
||||
public function transition(User $actor, int $id, array $input): Opportunity
|
||||
{
|
||||
$record = Opportunity::withTrashed()->findOrFail($id);
|
||||
$this->access->authorize($actor, 'view', $record);
|
||||
abort_unless($record->owner_user_id !== null && ! $record->trashed(), 409, 'Workflow apenas para registos explicitamente sujeitos à política.');
|
||||
$data = Validator::make($input, ['etag' => 'required|string|size:64',
|
||||
'action' => 'required|in:submit,start_review,request_correction,pending_opinion,respond_opinion,reject,approve,publish,suspend,archive,request_archive,appeal,request_revision,review_gate,assign_review,assign_publication,appeal_uphold,appeal_reopen',
|
||||
'reason' => 'required|string|min:20|max:1000', 'correction_items' => 'sometimes|array', 'correction_items.*' => 'required|string|max:250',
|
||||
'gate' => 'sometimes|string|max:80', 'gate_decision' => 'sometimes|in:approved,rejected', 'assignee_user_id' => 'sometimes|integer|min:1',
|
||||
'opinion_id' => 'sometimes|uuid', 'recipient_user_id' => 'sometimes|integer|min:1',
|
||||
'evidence_document_ids' => 'sometimes|array', 'evidence_document_ids.*' => 'uuid', 'due_at' => 'prohibited',
|
||||
'confirm_publication' => 'sometimes|boolean', 'preview_hash' => 'sometimes|string|size:64',
|
||||
'condition' => 'sometimes|array:description,responsible_user_id,due_on,blocking_action',
|
||||
'condition.description' => 'required_with:condition|string|min:10|max:1000',
|
||||
'condition.responsible_user_id' => 'required_with:condition|integer|min:1',
|
||||
'condition.due_on' => 'sometimes|nullable|date_format:Y-m-d',
|
||||
'condition.blocking_action' => 'required_with:condition|in:approve,publish',
|
||||
'resolve_condition_ids' => 'sometimes|array', 'resolve_condition_ids.*' => 'uuid|distinct',
|
||||
])->validate();
|
||||
$action = $data['action'];
|
||||
if ($action !== 'review_gate' && (isset($data['condition']) || ! empty($data['resolve_condition_ids']))) {
|
||||
throw ValidationException::withMessages(['condition' => 'Condições só podem ser verificadas numa revisão especializada autorizada.']);
|
||||
}
|
||||
$this->authorizeAction($actor, $record, $action);
|
||||
|
||||
return DB::transaction(function () use ($actor, $id, $data, $action) {
|
||||
$record = Opportunity::whereKey($id)->lockForUpdate()->firstOrFail();
|
||||
abort_unless(hash_equals($this->management->etag($record), $data['etag']), 409, 'Versão alterada.');
|
||||
$this->authorizeAction($actor, $record, $action);
|
||||
$context = $record->workflow_context ?? [];
|
||||
$state = $this->access->state($record);
|
||||
$before = ['status' => $state, 'publication_status' => $record->status, 'version' => $record->management_version];
|
||||
$from = match ($action) {
|
||||
'submit' => ['draft', 'needs_information'], 'start_review' => ['submitted'],
|
||||
'request_correction', 'pending_opinion', 'respond_opinion', 'reject', 'approve', 'assign_review' => ['submitted', 'in_review', 'information_pending'],
|
||||
'review_gate' => ['submitted', 'in_review', 'information_pending', 'approved'],
|
||||
'publish' => ['approved'], 'suspend' => [$state],
|
||||
'assign_publication' => ['approved'],
|
||||
'request_revision' => ['approved', 'published', 'suspended'],
|
||||
'archive' => ['draft', 'submitted', 'in_review', 'information_pending', 'needs_information', 'approved', 'rejected', 'published', 'suspended'],
|
||||
'request_archive' => ['draft', 'submitted', 'in_review', 'information_pending', 'needs_information', 'approved', 'published', 'suspended'],
|
||||
'appeal', 'appeal_uphold', 'appeal_reopen' => ['rejected'],
|
||||
default => [],
|
||||
};
|
||||
abort_unless(in_array($state, $from, true), 409, 'Transição incompatível com o estado atual.');
|
||||
$decision = ['actor_id' => $actor->id, 'action' => $action, 'reason' => $data['reason'], 'at' => now()->toIso8601String(),
|
||||
'content_revision' => $context['content_revision'] ?? 1];
|
||||
if (isset($context['review_cycle'])) {
|
||||
$decision['review_cycle'] = $context['review_cycle'];
|
||||
}
|
||||
$next = $state;
|
||||
$snapshot = [];
|
||||
if ($action === 'submit' && $record->opportunity_category === 'land_rights') {
|
||||
// Serialize the existing JSON-backed §27 uniqueness check across records.
|
||||
DB::select('SELECT pg_advisory_xact_lock(111026,270000)');
|
||||
}
|
||||
if (in_array($action, ['submit', 'review_gate', 'pending_opinion', 'respond_opinion', 'approve', 'publish'], true)) {
|
||||
$snapshot = $this->contract->validateSubmission($record);
|
||||
if ($action !== 'submit') {
|
||||
abort_unless(hash_equals($context['submission']['hash'] ?? '', $snapshot['hash']), 409, 'Conteúdo ou recursos mudaram desde a submissão. Exige nova submissão/revisão.');
|
||||
}
|
||||
}
|
||||
if ($action === 'submit') {
|
||||
// New review attempt, even when the canonical content is unchanged.
|
||||
// Historical decisions/tasks and the content revision keep their IDs.
|
||||
$context['review_cycle'] = max((int) ($context['review_cycle'] ?? 0), $this->submissionCount($context)) + 1;
|
||||
$decision['review_cycle'] = $context['review_cycle'];
|
||||
foreach ($context['opinions'] ?? [] as $opinionId => $opinion) {
|
||||
if (($opinion['status'] ?? '') === 'pending') {
|
||||
$context['opinions'][$opinionId]['status'] = 'superseded';
|
||||
$this->tasks->complete($opinion['task_id'] ?? null, 'Nova versão submetida; parecer anterior preservado.');
|
||||
}
|
||||
}
|
||||
$baseline = $context['review_baseline'] ?? $context['submission'] ?? [];
|
||||
$materiality = app(OpportunityReviewMateriality::class)->reconcile($baseline, $snapshot, $context['reviews'] ?? [], $this->contract->gates($record), ! empty($context['force_review']));
|
||||
$context['materiality'] = array_diff_key($materiality, ['reviews' => true]);
|
||||
$context['reviews'] = $materiality['reviews'];
|
||||
app(OpportunityReviewConditions::class)->reconcile($context, $snapshot, $materiality['reopened']);
|
||||
$context['submission'] = [...$snapshot, ...$decision];
|
||||
$context['sla'] = ['policy_version' => null, 'due_at' => null, 'status' => 'unconfigured'];
|
||||
unset($context['approval'], $context['assignment'], $context['publication_assignment'], $context['review_baseline'], $context['force_review']);
|
||||
$record->first_submitted_at ??= now()->toIso8601String();
|
||||
$record->management_closed_once = true;
|
||||
$record->workflow_context = $context;
|
||||
$context['review_task_id'] = $this->tasks->ensure($record, 'opportunity_review', 'Validação da oportunidade '.$record->reference);
|
||||
$this->tasks->complete($context['correction_task_id'] ?? null, $data['reason']);
|
||||
$next = 'submitted';
|
||||
} elseif ($action === 'start_review' || $action === 'assign_review') {
|
||||
$subject = $action === 'start_review' ? $actor : User::whereKey($data['assignee_user_id'] ?? 0)->firstOrFail();
|
||||
abort_unless($this->access->scoped($subject, 'validator', $record->organization_id, $record->opportunity_category)
|
||||
&& $this->access->operational($subject, 'validate', $record->id) && ! $this->access->conflict($subject, $record)
|
||||
&& $subject->two_factor_confirmed_at !== null, 403, 'Responsável requer papel válido, MFA configurado e independência.');
|
||||
if ($this->tasks->closedReviewBinding($record, $context['review_task_id'] ?? null)) {
|
||||
// Recover only a completed task of this opportunity in an
|
||||
// already submitted legacy attempt. Never reopen/delete it.
|
||||
$oldTask = $context['review_task_id'];
|
||||
$context['review_cycle'] = max(1, (int) ($context['review_cycle'] ?? 0), $this->submissionCount($context));
|
||||
$record->workflow_context = $context;
|
||||
$context['review_task_id'] = $this->tasks->ensure($record, 'opportunity_review', 'Validação da oportunidade '.$record->reference);
|
||||
$context['review_task_binding_history'][] = ['previous_task_id' => $oldTask, 'task_id' => $context['review_task_id'],
|
||||
'review_cycle' => $context['review_cycle'], 'at' => now()->toIso8601String(), 'reason' => 'Completed legacy review binding replaced for the current submission; original preserved.'];
|
||||
$decision['review_cycle'] = $context['review_cycle'];
|
||||
}
|
||||
$context['review_task_id'] ??= $this->tasks->ensure($record, 'opportunity_review', 'Validação da oportunidade '.$record->reference);
|
||||
$this->tasks->assign($record, $context['review_task_id'], $subject);
|
||||
$context['assignment'] = [...$decision, 'assignee_user_id' => $subject->id];
|
||||
$next = 'in_review';
|
||||
} elseif ($action === 'review_gate') {
|
||||
if ($state === 'approved') {
|
||||
throw_unless(! empty($data['resolve_condition_ids']) && empty($data['condition']) && ($data['gate_decision'] ?? '') === 'approved', ValidationException::withMessages(['resolve_condition_ids' => 'Após aprovação, só verificar condições de publicação existentes; alterações exigem nova revisão.']));
|
||||
}
|
||||
$gate = $data['gate'] ?? '';
|
||||
abort_unless(in_array($gate, $this->contract->gates($record), true), 422, 'Gate não aplicável.');
|
||||
$legal = preg_match('/legal|registry|authority|confidentiality|license/', $gate) === 1;
|
||||
abort_unless($this->responsibility($actor, $record, $legal ? 'legal_reviewer' : 'technical_reviewer'), 403, 'Responsabilidade de revisão necessária.');
|
||||
$documents = $data['evidence_document_ids'] ?? [];
|
||||
abort_unless($documents !== [] && array_diff($documents, array_keys($snapshot['resources']['documents'] ?? [])) === [], 422, 'Selecione evidência documental desta versão.');
|
||||
abort_unless(isset($data['gate_decision']), 422, 'Indique decisão fundamentada do gate.');
|
||||
app(OpportunityReviewConditions::class)->review($record, $actor, $data, $snapshot, $context);
|
||||
$context['reviews'][$gate] = [...$decision, 'decision' => $data['gate_decision'], 'hash' => $snapshot['hash'], 'evidence_document_ids' => $documents];
|
||||
$context['reviews'][$gate]['scope_hash'] = app(OpportunityReviewMateriality::class)->hash($snapshot, $gate, $context['reviews'][$gate]);
|
||||
$context['reviews'][$gate]['scope_rule'] = OpportunityReviewMateriality::VERSION;
|
||||
$next = 'in_review';
|
||||
} elseif ($action === 'approve') {
|
||||
app(OpportunityReviewConditions::class)->authorize($context, $snapshot, 'approve');
|
||||
abort_if(count(array_filter($context['opinions'] ?? [], fn ($o) => ($o['hash'] ?? '') === $snapshot['hash'] && ($o['status'] ?? '') === 'pending')) > 0, 422, 'Parecer da versão atual ainda pendente.');
|
||||
abort_if(count(array_filter($context['opinions'] ?? [], fn ($o) => ($o['hash'] ?? '') === $snapshot['hash'] && ($o['response']['decision'] ?? '') === 'rejected')) > 0, 422, 'Parecer desfavorável exige correção e nova versão.');
|
||||
foreach ($this->contract->gates($record) as $gate) {
|
||||
$review = $context['reviews'][$gate] ?? [];
|
||||
abort_unless(($review['decision'] ?? null) === 'approved' && (($review['hash'] ?? '') === $snapshot['hash'] || ($review['accepted_submission_hash'] ?? '') === $snapshot['hash']), 422, 'Gate '.$gate.' pendente, rejeitado ou de outra versão.');
|
||||
abort_unless(app(OpportunityReviewMateriality::class)->matches($snapshot, $gate, $review), 409, 'Âmbito da revisão alterado.');
|
||||
$reviewer = User::whereKey($review['actor_id'])->firstOrFail();
|
||||
abort_unless($this->access->scoped($reviewer, 'validator', $record->organization_id, $record->opportunity_category)
|
||||
&& ! $this->access->conflict($reviewer, $record) && $this->access->operational($reviewer, 'validate', $record->id)
|
||||
&& $this->responsibility($reviewer, $record, preg_match('/legal|registry|authority|confidentiality|license/', $gate) === 1 ? 'legal_reviewer' : 'technical_reviewer'), 403, 'Revisor revogado, sem responsabilidade ou com conflito.');
|
||||
}
|
||||
$context['approval'] = [...$decision, 'hash' => $snapshot['hash'], 'gates' => $context['reviews'] ?? []];
|
||||
$this->tasks->complete($context['review_task_id'] ?? null, $data['reason']);
|
||||
$record->workflow_context = $context;
|
||||
$context['publication_task_id'] = $this->tasks->ensure($record, 'opportunity_publication', 'Preparação editorial '.$record->reference);
|
||||
$next = 'approved';
|
||||
} elseif ($action === 'assign_publication') {
|
||||
$subject = User::whereKey($data['assignee_user_id'] ?? 0)->firstOrFail();
|
||||
abort_unless($this->access->scoped($subject, 'publisher', $record->organization_id, $record->opportunity_category) && $this->access->operational($subject, 'publish', $record->id) && ! $this->access->conflict($subject, $record) && $subject->two_factor_confirmed_at !== null && (int) ($context['approval']['actor_id'] ?? 0) !== $subject->id, 403, 'Publicador exige MFA, âmbito e independência da aprovação.');
|
||||
$context['publication_task_id'] ??= $this->tasks->ensure($record, 'opportunity_publication', 'Preparação editorial '.$record->reference);
|
||||
$this->tasks->assign($record, $context['publication_task_id'], $subject);
|
||||
$context['publication_assignment'] = [...$decision, 'assignee_user_id' => $subject->id];
|
||||
} elseif ($action === 'publish') {
|
||||
app(OpportunityReviewConditions::class)->authorize($context, $snapshot, 'publish');
|
||||
Validator::make($data, ['confirm_publication' => 'required|accepted', 'preview_hash' => 'required|string|size:64'])->validate();
|
||||
$this->contract->validatePublication($snapshot);
|
||||
abort_unless(hash_equals($snapshot['hash'], $data['preview_hash']), 409, 'Pré-visualização diferente da versão aprovada.');
|
||||
abort_unless(($context['approval']['hash'] ?? '') === $snapshot['hash'], 409, 'Aprovação não corresponde ao conteúdo atual.');
|
||||
foreach ($this->contract->gates($record) as $gate) {
|
||||
$review = $context['approval']['gates'][$gate] ?? [];
|
||||
abort_unless(($review['decision'] ?? null) === 'approved' && (($review['hash'] ?? '') === $snapshot['hash'] || ($review['accepted_submission_hash'] ?? '') === $snapshot['hash']), 422, 'Revisão aprovada desta versão necessária.');
|
||||
$reviewer = User::whereKey($review['actor_id'])->firstOrFail();
|
||||
abort_unless($this->access->scoped($reviewer, 'validator', $record->organization_id, $record->opportunity_category)
|
||||
&& ! $this->access->conflict($reviewer, $record) && $this->access->operational($reviewer, 'validate', $record->id)
|
||||
&& $this->responsibility($reviewer, $record, preg_match('/legal|registry|authority|confidentiality|license/', $gate) === 1 ? 'legal_reviewer' : 'technical_reviewer'), 403, 'Revisor revogado, sem responsabilidade ou com conflito na publicação.');
|
||||
}
|
||||
$approver = User::whereKey($context['approval']['actor_id'] ?? 0)->firstOrFail();
|
||||
abort_unless($this->access->scoped($approver, 'validator', $record->organization_id, $record->opportunity_category)
|
||||
&& ! $this->access->conflict($approver, $record) && $this->access->operational($approver, 'validate', $record->id), 403, 'Aprovador revogado ou com conflito.');
|
||||
$p = $snapshot['payload'];
|
||||
if (! empty($p['review_due_date'])) {
|
||||
abort_unless($p['review_due_date'] > today()->toDateString(), 422, 'Data de revisão deve ser futura.');
|
||||
}
|
||||
if (isset($p['business_transaction'])) {
|
||||
abort_unless(in_array($p['business_transaction']['due_diligence_status'], ['data_room_ready', 'in_progress', 'completed', 'exceptions'], true), 422, 'Data room mínimo não preparado.');
|
||||
}
|
||||
if (isset($context['publication'])) {
|
||||
$context['publication_history'][] = $context['publication'];
|
||||
}
|
||||
$context['publication'] = [...$decision, 'hash' => $snapshot['hash'], 'visibility' => $p['visibility'],
|
||||
'public_fields' => ['title', 'summary', 'description', 'sector_id', 'province', 'district']];
|
||||
// Minimal public projection; contacts, valuations, evidence and originals remain private.
|
||||
$projection = $this->contract->publicProjection($p);
|
||||
$record->title = $projection['title'];
|
||||
$record->summary = $projection['summary'];
|
||||
$record->description = $projection['description'];
|
||||
$record->sector_id = $p['sector_id'];
|
||||
$locations = array_values(array_filter($snapshot['resources']['locations'], fn ($location) => $location['payload']['is_primary'] ?? false));
|
||||
$location = $locations[0]; // The contract requires exactly one primary location.
|
||||
$path = app(InvestmentGeography::class)->selection($location['payload'], true);
|
||||
$last = array_key_last($path);
|
||||
abort_unless($last !== null, 422, 'Localização principal sem hierarquia.');
|
||||
$record->primary_territory_id = $path[$last]->id;
|
||||
$record->province = $path[0]->name;
|
||||
$record->district = $path[1]->name;
|
||||
$record->geography_scope = $p['geographic_scope'] === 'national' ? 'national' : 'specific';
|
||||
$record->published_at = now();
|
||||
$record->status = 'published';
|
||||
$next = 'published';
|
||||
$this->tasks->complete($context['publication_task_id'] ?? null, $data['reason']);
|
||||
} elseif ($action === 'pending_opinion') {
|
||||
$gate = $data['gate'] ?? '';
|
||||
abort_unless(in_array($gate, $this->contract->gates($record), true), 422, 'Indique a revisão aplicável ao parecer.');
|
||||
$subject = User::whereKey($data['recipient_user_id'] ?? 0)->firstOrFail();
|
||||
abort_unless($this->access->scoped($subject, 'validator', $record->organization_id, $record->opportunity_category)
|
||||
&& $this->access->operational($subject, 'validate', $record->id) && ! $this->access->conflict($subject, $record) && $subject->two_factor_confirmed_at !== null
|
||||
&& $this->responsibility($subject, $record, preg_match('/legal|registry|authority|confidentiality|license/', $gate) === 1 ? 'legal_reviewer' : 'technical_reviewer'), 403, 'Destinatário exige responsabilidade, MFA e independência.');
|
||||
abort_if($subject->id === $actor->id, 422, 'O parecer deve ser solicitado a outro revisor.');
|
||||
$opinionId = (string) Str::uuid();
|
||||
$taskId = $this->tasks->ensure($record, 'opportunity_opinion:'.$opinionId, 'Parecer da oportunidade '.$record->reference);
|
||||
$this->tasks->assign($record, $taskId, $subject);
|
||||
$context['opinions'][$opinionId] = [...$decision, 'id' => $opinionId, 'recipient_id' => $subject->id, 'gate' => $gate, 'status' => 'pending', 'hash' => $snapshot['hash'], 'task_id' => $taskId];
|
||||
$next = 'information_pending';
|
||||
} elseif ($action === 'respond_opinion') {
|
||||
$opinionId = $data['opinion_id'] ?? '';
|
||||
$opinion = $context['opinions'][$opinionId] ?? [];
|
||||
abort_unless(($opinion['recipient_id'] ?? 0) === $actor->id, 403, 'Parecer atribuído a outro revisor.');
|
||||
abort_unless($this->responsibility($actor, $record, preg_match('/legal|registry|authority|confidentiality|license/', $opinion['gate'] ?? '') === 1 ? 'legal_reviewer' : 'technical_reviewer'), 403, 'Responsabilidade do parecer revogada.');
|
||||
abort_unless(($opinion['status'] ?? '') === 'pending' && ($opinion['hash'] ?? '') === $snapshot['hash'], 409, 'Parecer encerrado ou de outra versão.');
|
||||
$documents = $data['evidence_document_ids'] ?? [];
|
||||
abort_unless(isset($data['gate_decision']) && $documents !== [] && array_diff($documents, array_keys($snapshot['resources']['documents'] ?? [])) === [], 422, 'Resposta exige decisão e documentos desta versão.');
|
||||
$context['opinions'][$opinionId]['status'] = 'answered';
|
||||
$context['opinions'][$opinionId]['response'] = [...$decision, 'decision' => $data['gate_decision'], 'evidence_document_ids' => $documents];
|
||||
$this->tasks->complete($opinion['task_id'], $data['reason']);
|
||||
$next = count(array_filter($context['opinions'], fn ($o) => ($o['hash'] ?? '') === $snapshot['hash'] && ($o['status'] ?? '') === 'pending')) > 0 ? 'information_pending' : 'in_review';
|
||||
} elseif ($action === 'request_correction') {
|
||||
abort_unless($data['correction_items'] ?? [], 422, 'Indique campos e documentos a corrigir.');
|
||||
$this->tasks->complete($context['review_task_id'] ?? null, $data['reason']);
|
||||
$context['correction_items'] = $data['correction_items'];
|
||||
$context['correction_cycles'] = ($context['correction_cycles'] ?? 0) + 1;
|
||||
$record->workflow_context = $context;
|
||||
$context['correction_task_id'] = $this->tasks->ensure($record, 'opportunity_correction', 'Correções da oportunidade '.$record->reference);
|
||||
$next = 'needs_information';
|
||||
} elseif ($action === 'request_revision' || $action === 'appeal_reopen') {
|
||||
$this->tasks->complete($context['review_task_id'] ?? null, $data['reason']);
|
||||
$this->tasks->complete($context['publication_task_id'] ?? null, $data['reason']);
|
||||
$context['decision_history'][] = ['approval' => $context['approval'] ?? null, 'reviews' => $context['reviews'] ?? null, 'submission' => $context['submission'] ?? null];
|
||||
$context['review_baseline'] = $context['submission'] ?? [];
|
||||
$context['force_review'] = $action === 'appeal_reopen' || $state === 'suspended';
|
||||
unset($context['approval']);
|
||||
$next = 'needs_information';
|
||||
} elseif ($action === 'request_archive') {
|
||||
$context['request_archive'] = $decision;
|
||||
} elseif ($action === 'appeal') {
|
||||
abort_if($context['appeal']['pending'] ?? false, 409, 'Recurso já pendente.');
|
||||
$context['appeal'] = [...$decision, 'pending' => true];
|
||||
$context['appeal_task_id'] = $this->tasks->ensure($record, 'opportunity_appeal', 'Recurso da oportunidade '.$record->reference);
|
||||
} elseif ($action === 'appeal_uphold') {
|
||||
$next = 'rejected';
|
||||
} else {
|
||||
$next = match ($action) {
|
||||
'reject' => 'rejected', 'suspend' => 'suspended', 'archive' => 'archived'
|
||||
};
|
||||
if ($action === 'reject') {
|
||||
$context['rejection'] = $decision;
|
||||
$this->tasks->complete($context['review_task_id'] ?? null, $data['reason']);
|
||||
}
|
||||
if ($action === 'archive') {
|
||||
$context['archive'] = $decision;
|
||||
}
|
||||
if (in_array($action, ['suspend', 'archive'], true)) {
|
||||
$record->status = $next;
|
||||
foreach (['review_task_id', 'correction_task_id', 'publication_task_id', 'appeal_task_id'] as $task) {
|
||||
$this->tasks->complete($context[$task] ?? null, $data['reason']);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (in_array($action, ['appeal_uphold', 'appeal_reopen'], true)) {
|
||||
$context['appeal']['pending'] = false;
|
||||
$context['appeal']['decision'] = $decision;
|
||||
$this->tasks->complete($context['appeal_task_id'] ?? null, $data['reason']);
|
||||
}
|
||||
if (in_array($action, ['request_correction', 'reject'], true)) {
|
||||
if ($action === 'reject') {
|
||||
$context['force_review'] = true;
|
||||
}
|
||||
unset($context['approval']);
|
||||
}
|
||||
if (in_array($action, ['request_correction', 'reject', 'suspend', 'archive', 'request_revision', 'appeal_reopen'], true)) {
|
||||
foreach ($context['opinions'] ?? [] as $opinionId => $opinion) {
|
||||
if (($opinion['status'] ?? '') === 'pending') {
|
||||
$context['opinions'][$opinionId]['status'] = 'superseded';
|
||||
$this->tasks->complete($opinion['task_id'] ?? null, $data['reason']);
|
||||
}
|
||||
}
|
||||
}
|
||||
$context['working_state'] = $next;
|
||||
$context['last_decision'] = $decision;
|
||||
$context['events'][] = [...$decision, 'from' => $state, 'to' => $next];
|
||||
if ($record->status !== 'published' || in_array($action, ['suspend', 'archive'], true)) {
|
||||
$record->status = $next;
|
||||
}
|
||||
$record->management_version++;
|
||||
$record->workflow_context = $context;
|
||||
$record->save();
|
||||
$this->access->audit($actor, 'workflow_'.$action, ['record_id' => $record->id, 'before' => $before,
|
||||
'after' => ['status' => $next, 'publication_status' => $record->status, 'version' => $record->management_version], 'reason' => $data['reason']]);
|
||||
|
||||
return $record;
|
||||
});
|
||||
}
|
||||
|
||||
/** @param array<array-key, mixed> $context */
|
||||
private function submissionCount(array $context): int
|
||||
{
|
||||
$events = $context['events'] ?? [];
|
||||
abort_unless(is_array($events), 409, 'Histórico de submissões inconsistente; preservar e recuperar antes de continuar.');
|
||||
$count = 0;
|
||||
foreach ($events as $event) {
|
||||
if (is_array($event) && ($event['action'] ?? null) === 'submit') {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
||||
private function responsibility(User $actor, Opportunity $record, string $name): bool
|
||||
{
|
||||
foreach ($this->access->grants($actor, $name === 'publication_coordinator' ? 'publisher' : 'validator') as $grant) {
|
||||
if (($grant->organization_id === null || $grant->organization_id === $record->organization_id)
|
||||
&& in_array($record->opportunity_category, json_decode($grant->opportunity_types, true), true)
|
||||
&& in_array($name, json_decode($grant->responsibilities, true), true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function authorizeAction(User $actor, Opportunity $record, string $action): void
|
||||
{
|
||||
$this->access->authorize($actor, 'view', $record);
|
||||
$promoter = $this->access->scoped($actor, 'promoter', $record->organization_id, $record->opportunity_category)
|
||||
&& ($record->organization_id !== null || (int) $record->owner_user_id === $actor->id);
|
||||
if (in_array($action, ['submit', 'request_archive', 'appeal', 'request_revision'], true)) {
|
||||
abort_unless($promoter && $this->access->operational($actor, 'edit', $record->id), 403);
|
||||
} else {
|
||||
$role = in_array($action, ['publish', 'assign_publication', 'suspend', 'archive'], true) ? 'publisher' : 'validator';
|
||||
$operation = $role === 'publisher' ? (in_array($action, ['publish', 'assign_publication'], true) ? 'publish' : 'archive') : 'validate';
|
||||
abort_unless($this->access->scoped($actor, $role, $record->organization_id, $record->opportunity_category)
|
||||
&& $this->access->mfa($actor) && $this->access->operational($actor, $operation, $record->id) && ! $this->access->conflict($actor, $record), 403, 'Papel, MFA e independência necessários.');
|
||||
if ($action === 'publish') {
|
||||
abort_if((int) ($record->workflow_context['approval']['actor_id'] ?? 0) === $actor->id, 403, 'O aprovador não publica a mesma versão.');
|
||||
abort_if(isset($record->workflow_context['publication_assignment']['assignee_user_id']) && (int) $record->workflow_context['publication_assignment']['assignee_user_id'] !== $actor->id, 403, 'Publicação atribuída a outro Publicador; requer reatribuição explícita.');
|
||||
}
|
||||
if ($action === 'assign_publication') {
|
||||
abort_unless($this->responsibility($actor, $record, 'publication_coordinator'), 403);
|
||||
}
|
||||
if ($action === 'assign_review') {
|
||||
abort_unless($this->responsibility($actor, $record, 'validation_coordinator'), 403);
|
||||
}
|
||||
if (in_array($action, ['start_review', 'review_gate', 'request_correction', 'pending_opinion', 'reject', 'approve'], true)
|
||||
&& isset($record->workflow_context['assignment']['assignee_user_id'])) {
|
||||
abort_unless((int) $record->workflow_context['assignment']['assignee_user_id'] === $actor->id, 403, 'Tarefa atribuída a outro Validador; o coordenador deve registar a reatribuição.');
|
||||
}
|
||||
if (in_array($action, ['appeal_uphold', 'appeal_reopen'], true)) {
|
||||
abort_unless($this->responsibility($actor, $record, 'appeal_reviewer') && ($record->workflow_context['appeal']['pending'] ?? false)
|
||||
&& (int) ($record->workflow_context['rejection']['actor_id'] ?? 0) !== $actor->id, 403, 'Recurso exige instância independente da rejeição.');
|
||||
}
|
||||
if ($action === 'suspend') {
|
||||
abort_unless($record->status === 'published', 409);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Opportunity;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
/** Explicit internal review conditions in the existing workflow JSON and audit. */
|
||||
class OpportunityReviewConditions
|
||||
{
|
||||
/** @param array<string,mixed> $data
|
||||
* @param array<string,mixed> $snapshot
|
||||
* @param array<string,mixed> $context */
|
||||
public function review(Opportunity $record, User $actor, array $data, array $snapshot, array &$context): void
|
||||
{
|
||||
$gate = $data['gate'];
|
||||
foreach ($data['resolve_condition_ids'] ?? [] as $id) {
|
||||
$condition = $context['conditions'][$id] ?? null;
|
||||
$this->require($condition !== null && $condition['gate'] === $gate && $condition['status'] === 'open', 'resolve_condition_ids', 'Selecione uma condição aberta desta revisão.');
|
||||
$this->require(($data['gate_decision'] ?? '') === 'approved', 'gate_decision', 'A resolução exige verificação interna aprovada com evidência.');
|
||||
$documents = [];
|
||||
foreach ($data['evidence_document_ids'] ?? [] as $documentId) {
|
||||
$documents[$documentId] = $snapshot['resources']['documents'][$documentId]['sha256'];
|
||||
}
|
||||
$this->require($documents !== [], 'evidence_document_ids', 'A resolução exige documento ativo e analisado desta oportunidade.');
|
||||
$context['conditions'][$id]['status'] = 'resolved';
|
||||
$context['conditions'][$id]['resolution'] = ['actor_id' => $actor->id, 'at' => now()->toIso8601String(), 'reason' => $data['reason'], 'document_hashes' => $documents, 'content_revision' => $context['content_revision'] ?? 1, 'scope' => 'internal_verification_not_external_decision'];
|
||||
}
|
||||
if (! empty($data['condition'])) {
|
||||
$input = $data['condition'];
|
||||
$subject = User::query()->whereKey($input['responsible_user_id'])->first();
|
||||
$access = app(PortalProfileAccess::class);
|
||||
$this->require($subject !== null && $access->canView($subject, $record)
|
||||
&& (($access->scoped($subject, 'promoter', $record->organization_id, $record->opportunity_category) && $access->operational($subject, 'edit', $record->id))
|
||||
|| ($access->scoped($subject, 'validator', $record->organization_id, $record->opportunity_category) && $access->operational($subject, 'validate', $record->id))),
|
||||
'condition.responsible_user_id', 'Selecione um responsável autorizado neste âmbito; não atribua responsabilidade externa.');
|
||||
$id = (string) Str::uuid();
|
||||
$context['conditions'][$id] = ['id' => $id, 'gate' => $gate, 'description' => $input['description'], 'responsible_user_id' => $subject->id,
|
||||
'responsible_name' => $subject->name, 'due_on' => $input['due_on'] ?? null, 'blocking_action' => $input['blocking_action'],
|
||||
'status' => 'open', 'created_by' => $actor->id, 'created_at' => now()->toIso8601String(), 'scope' => 'internal_review_condition', 'resolution_history' => []];
|
||||
}
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $context
|
||||
* @param array<string,mixed> $snapshot
|
||||
* @param list<string> $reopened */
|
||||
public function reconcile(array &$context, array $snapshot, array $reopened): void
|
||||
{
|
||||
foreach ($context['conditions'] ?? [] as $id => $condition) {
|
||||
if ($condition['status'] !== 'resolved') {
|
||||
continue;
|
||||
}
|
||||
$matches = ! in_array($condition['gate'], $reopened, true);
|
||||
foreach ($condition['resolution']['document_hashes'] ?? [] as $documentId => $sha) {
|
||||
$matches = $matches && ($snapshot['resources']['documents'][$documentId]['sha256'] ?? null) === $sha;
|
||||
}
|
||||
if (! $matches) {
|
||||
$context['conditions'][$id]['resolution_history'][] = $condition['resolution'];
|
||||
unset($context['conditions'][$id]['resolution']);
|
||||
$context['conditions'][$id]['status'] = 'open';
|
||||
$context['conditions'][$id]['reopened_at'] = now()->toIso8601String();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $context
|
||||
* @param array<string,mixed> $snapshot */
|
||||
public function authorize(array $context, array $snapshot, string $action): void
|
||||
{
|
||||
foreach ($context['conditions'] ?? [] as $condition) {
|
||||
if ($action === 'approve' && $condition['blocking_action'] !== 'approve') {
|
||||
continue;
|
||||
}
|
||||
$resolved = $condition['status'] === 'resolved';
|
||||
foreach ($condition['resolution']['document_hashes'] ?? [] as $id => $sha) {
|
||||
$resolved = $resolved && ($snapshot['resources']['documents'][$id]['sha256'] ?? null) === $sha;
|
||||
}
|
||||
$this->require($resolved, 'conditions.'.$condition['id'], 'Condição pendente: '.$condition['description'].'. Responsável: '.$condition['responsible_name'].'. Prazo: '.($condition['due_on'] ?? 'não definido').'.');
|
||||
}
|
||||
}
|
||||
|
||||
private function require(bool $ok, string $field, string $message): void
|
||||
{
|
||||
if (! $ok) {
|
||||
throw ValidationException::withMessages([$field => $message]);
|
||||
}
|
||||
}
|
||||
}
|
||||
+166
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
/** §28.1: preserve signed decisions; only changed review scopes need new decisions. */
|
||||
class OpportunityReviewMateriality
|
||||
{
|
||||
public const VERSION = 'review-scopes-20261011-v3';
|
||||
|
||||
public const PREVIOUS_VERSION = 'review-scopes-20261011-v2';
|
||||
|
||||
/** @param array<string,mixed> $snapshot
|
||||
* @return array<string,mixed> */
|
||||
private function scope(array $snapshot, string $gate, bool $extended = true): array
|
||||
{
|
||||
$p = $snapshot['payload'] ?? [];
|
||||
$common = ['opportunity_category', 'promoter_id', 'promoter_type', 'sector_id', 'subsector_id', 'economic_activity_id', 'demand_statement', 'executive_summary'];
|
||||
$fields = match ($gate) {
|
||||
'property_review' => ['real_estate.property_type', 'real_estate.land_area', 'real_estate.built_area', 'real_estate.area_unit', 'real_estate.units', 'real_estate.occupancy_status', 'real_estate.price', 'real_estate.rent', 'real_estate.rent_periodicity', 'real_estate.valuation', 'real_estate.utilities'],
|
||||
'registry_urban_review' => ['real_estate.transaction_type', 'real_estate.title_type', 'real_estate.registration_number', 'real_estate.encumbrances', 'real_estate.land_area', 'real_estate.area_unit'],
|
||||
'building_compliance_review' => ['real_estate.construction_status', 'real_estate.property_condition', 'real_estate.built_area', 'real_estate.floors', 'real_estate.planning_permit_document_id', 'real_estate.use_license_document_id'],
|
||||
'cadastral_screening' => ['land_rights.parcels', 'land_rights.overlaps_conflicts'],
|
||||
'land_legal_review' => ['land_rights.operation_type', 'land_rights.duat_status', 'land_rights.duat_number', 'land_rights.holder_id', 'land_rights.holder_name', 'land_rights.issuing_authority_id', 'land_rights.issue_date', 'land_rights.expiry_date', 'land_rights.authorized_purpose', 'land_rights.improvements', 'land_rights.consideration'],
|
||||
'community_environment_review' => ['land_rights.communities', 'land_rights.community_consultation', 'environmental_social'],
|
||||
'competent_authority_clearance' => ['land_rights.required_authorizations', 'land_rights.exploitation_plan_document_id', 'land_rights.authorized_purpose'],
|
||||
'corporate_screening' => ['business_transaction.legal_entity_id', 'business_transaction.legal_form', 'business_transaction.beneficial_owners', 'business_transaction.percentage_offered'],
|
||||
'financial_review' => ['business_transaction.asking_price', 'business_transaction.valuation', 'business_transaction.financial_periods', 'business_transaction.assets_liabilities', 'business_transaction.employees', 'business_transaction.partner_contribution'],
|
||||
'legal_tax_due_diligence' => ['business_transaction.transaction_type', 'business_transaction.percentage_offered', 'business_transaction.contracts_licenses', 'business_transaction.litigation_contingencies', 'business_transaction.governance_rights', 'business_transaction.franchise_terms', 'business_transaction.tax_labor_compliance'],
|
||||
'partnership_governance_review' => ['business_transaction.percentage_offered', 'business_transaction.partner_contribution', 'business_transaction.governance_rights'],
|
||||
'brand_license_review' => ['business_transaction.franchise_terms', 'business_transaction.contracts_licenses'],
|
||||
'franchise_legal_review' => ['business_transaction.franchise_terms', 'business_transaction.contracts_licenses', 'business_transaction.litigation_contingencies'],
|
||||
'confidentiality_clearance' => ['visibility', 'publish_contact', 'public_contact_id', 'business_transaction.confidentiality_level', 'business_transaction.teaser', 'business_transaction.nda_document_id', 'business_transaction.data_room_index_document_id'],
|
||||
'technical_review' => ['demand_statement', 'opportunity_type', 'maturity_stage', 'investment_modalities', 'investor_profiles', 'products', 'assets', 'inputs', 'markets', 'competitive_advantage', 'employment', 'impact_indicators', 'total_investment', 'currency', 'investment_breakdown', 'secured_financing', 'funding_sought', 'financial_indicators', 'milestones', 'risks'],
|
||||
'legal_territorial_review' => ['licenses', 'environmental_social', 'relations', 'truth_declaration'],
|
||||
// Experimental modules have no approved scope contract: never carry their decisions.
|
||||
default => array_keys($p),
|
||||
};
|
||||
if ($extended) {
|
||||
$fields = [...$fields, ...match ($gate) {
|
||||
'land_legal_review' => ['land_rights.holder_document_id', 'land_rights.area_unit'],
|
||||
'community_environment_review' => ['land_rights.communities_affected'],
|
||||
'competent_authority_clearance' => ['land_rights.exploitation_plan_required'],
|
||||
'corporate_screening' => ['business_transaction.entity_registration'],
|
||||
'financial_review' => ['business_transaction.available_financial_years', 'business_transaction.history_status', 'business_transaction.history_declaration', 'business_transaction.history_declaration_document_id', 'business_transaction.projections'],
|
||||
'franchise_legal_review' => ['business_transaction.legal_entity_id', 'business_transaction.legal_form', 'business_transaction.beneficial_owners', 'business_transaction.entity_registration', 'business_transaction.governance_rights', 'business_transaction.tax_labor_compliance'],
|
||||
'confidentiality_clearance' => ['internal_contact_id'],
|
||||
default => [],
|
||||
}];
|
||||
}
|
||||
$data = [];
|
||||
foreach ([...$common, ...$fields] as $field) {
|
||||
if (! is_string($field)) {
|
||||
throw new \UnexpectedValueException('Canonical review fields must be named fields.');
|
||||
}
|
||||
$data[$field] = Arr::get($p, $field);
|
||||
}
|
||||
// Explicitly unclassified specialised fields conservatively reopen reviews.
|
||||
// They cannot silently become immaterial when a schema gains a new field.
|
||||
$classified = match ($p['opportunity_category'] ?? '') {
|
||||
'real_estate' => ['transaction_type', 'property_type', 'construction_status', 'property_condition', 'land_area', 'built_area', 'area_unit', 'units', 'rooms', 'floors', 'amenities', 'utilities', 'occupancy_status', 'title_type', 'registration_number', 'encumbrances', 'price', 'rent', 'rent_periodicity', 'deposit', 'valuation', 'viewing', 'planning_permit_document_id', 'use_license_document_id', 'title_document_id', 'title_holder_name', 'issuing_authority_id', 'expected_completion_date', 'occupancy_details', 'occupancy_document_id', 'amenities_other', 'urban_limit_document_id', 'max_built_area'],
|
||||
default => [],
|
||||
};
|
||||
if ($classified !== []) {
|
||||
$data['unclassified_module_fields'] = array_diff_key($p['real_estate'] ?? [], array_flip($classified));
|
||||
}
|
||||
if ($gate === 'property_review') {
|
||||
foreach (['rooms', 'amenities', 'deposit', 'occupancy_details', 'occupancy_document_id', 'amenities_other'] as $key) {
|
||||
$data['real_estate.'.$key] = Arr::get($p, 'real_estate.'.$key);
|
||||
}
|
||||
}
|
||||
if ($gate === 'registry_urban_review') {
|
||||
foreach (['title_document_id', 'title_holder_name', 'issuing_authority_id', 'urban_limit_document_id', 'max_built_area'] as $key) {
|
||||
$data['real_estate.'.$key] = Arr::get($p, 'real_estate.'.$key);
|
||||
}
|
||||
}
|
||||
if ($gate === 'building_compliance_review') {
|
||||
$data['real_estate.expected_completion_date'] = Arr::get($p, 'real_estate.expected_completion_date');
|
||||
}
|
||||
|
||||
// A changed evidence file always invalidates a decision relying on it.
|
||||
// Unrelated documents/images and editorial timestamps are not review evidence.
|
||||
return $data;
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $snapshot
|
||||
* @param array<string,mixed> $review */
|
||||
public function hash(array $snapshot, string $gate, array $review = [], bool $legacy = false, ?string $rule = null): string
|
||||
{
|
||||
$extended = ! $legacy && ($rule ?? self::VERSION) !== self::PREVIOUS_VERSION;
|
||||
$data = $this->scope($snapshot, $gate, $extended);
|
||||
$locationGates = ['registry_urban_review', 'cadastral_screening', 'legal_territorial_review', 'property_review'];
|
||||
if (! $legacy) {
|
||||
$locationGates = [...$locationGates, 'land_legal_review', 'community_environment_review', 'competent_authority_clearance'];
|
||||
}
|
||||
if (in_array($gate, $locationGates, true)) {
|
||||
$data['locations'] = array_map(fn ($r) => $r['payload'], $snapshot['resources']['locations'] ?? []);
|
||||
}
|
||||
foreach ($review['evidence_document_ids'] ?? [] as $id) {
|
||||
$r = $snapshot['resources']['documents'][$id] ?? null;
|
||||
$data['evidence'][$id] = $r ? ['sha256' => $r['sha256'] ?? null, 'payload' => $r['payload'] ?? [], 'deleted_at' => $r['deleted_at'] ?? null] : null;
|
||||
}
|
||||
|
||||
if ($extended) {
|
||||
// Nested references are part of the decision even when the reviewer
|
||||
// selected a different supporting file. Preserve the original bytes.
|
||||
$referenced = function (array $node) use (&$referenced, &$data, $snapshot): void {
|
||||
foreach ($node as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$referenced($value);
|
||||
} elseif (is_string($key) && is_string($value) && $value !== '' && (str_ends_with($key, 'document_id') || $key === 'image_id')) {
|
||||
$kind = $key === 'image_id' ? 'images' : 'documents';
|
||||
$resource = $snapshot['resources'][$kind][$value] ?? null;
|
||||
$data['referenced_resources'][$kind][$value] = $resource ? ['sha256' => $resource['sha256'] ?? null, 'payload' => $resource['payload'] ?? [], 'deleted_at' => $resource['deleted_at'] ?? null] : null;
|
||||
}
|
||||
}
|
||||
};
|
||||
$referenced($data);
|
||||
}
|
||||
|
||||
return $legacy ? hash('sha256', json_encode(Arr::sortRecursive($data), JSON_THROW_ON_ERROR)) : OpportunityCanonicalValue::hash($data);
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $snapshot
|
||||
* @param array<string,mixed> $review */
|
||||
public function matches(array $snapshot, string $gate, array $review): bool
|
||||
{
|
||||
if (! isset($review['scope_hash'])) {
|
||||
return true; // Caller must independently verify the original signed submission hash.
|
||||
}
|
||||
$rule = $review['scope_rule'] ?? '';
|
||||
$legacy = ! in_array($rule, [self::VERSION, self::PREVIOUS_VERSION], true);
|
||||
$expected = $this->hash($snapshot, $gate, $review, $legacy, $rule);
|
||||
|
||||
return hash_equals($review['scope_hash'], $expected);
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $before
|
||||
* @param array<string,mixed> $after
|
||||
* @param array<string,mixed> $reviews
|
||||
* @param list<string> $gates
|
||||
* @return array<string,mixed> */
|
||||
public function reconcile(array $before, array $after, array $reviews, array $gates, bool $force = false): array
|
||||
{
|
||||
$kept = [];
|
||||
$reopened = [];
|
||||
foreach ($gates as $gate) {
|
||||
$review = $reviews[$gate] ?? [];
|
||||
// Compare the signed baseline and new content with the new scope;
|
||||
// separately validate old scope signatures under their original rule.
|
||||
$priorHash = $this->hash($before, $gate, $review);
|
||||
$currentHash = $this->hash($after, $gate, $review);
|
||||
if (! $force && $before !== [] && ($review['decision'] ?? '') === 'approved' && $this->matches($before, $gate, $review) && hash_equals($priorHash, $currentHash)) {
|
||||
$kept[$gate] = [...$review, 'scope_hash' => $priorHash, 'scope_rule' => self::VERSION, 'accepted_submission_hash' => $after['hash'],
|
||||
'carried_forward' => ['rule' => self::VERSION, 'from_scope_hash' => $review['scope_hash'] ?? null, 'from_scope_rule' => $review['scope_rule'] ?? 'legacy_unspecified', 'from_submission_hash' => $before['hash'] ?? null, 'at' => now()->toIso8601String()]];
|
||||
} else {
|
||||
$reopened[] = $gate;
|
||||
}
|
||||
}
|
||||
|
||||
return ['rule' => self::VERSION, 'reviews' => $kept, 'reopened' => $reopened, 'retained' => array_keys($kept),
|
||||
'reason' => $force ? 'Suspensão, rejeição ou recurso exige nova decisão; motivo anterior preservado.' : 'Comparação dos campos e evidências aplicáveis a cada revisão (§28.1).',
|
||||
'final_approval' => 'Nova assinatura independente da versão; nenhum parecer ou decisão externa inventado.'];
|
||||
}
|
||||
}
|
||||
+269
@@ -0,0 +1,269 @@
|
||||
<?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('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/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('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') && 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->available() || ! $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->available() && $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 scoped(User $actor, string $role, ?string $organization, string $type): bool
|
||||
{
|
||||
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->has($actor, 'auditor')) {
|
||||
return false;
|
||||
}
|
||||
if (! $this->superuser($actor)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return DB::table('portal_security_approvals')->where('kind', 'elevation')->where('subject_user_id', $actor->id)
|
||||
->whereNotNull('approved_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
|
||||
{
|
||||
return $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();
|
||||
}
|
||||
|
||||
public function canView(User $actor, Opportunity $record): bool
|
||||
{
|
||||
if ($record->owner_user_id === null) {
|
||||
return $actor->can('manage-portal');
|
||||
}
|
||||
if (! $this->available() || ! $actor->hasVerifiedEmail()) {
|
||||
return false;
|
||||
}
|
||||
if ($this->has($actor, 'auditor') || $this->superuser($actor)) {
|
||||
return true;
|
||||
}
|
||||
$personal = $record->organization_id !== null || (int) $record->owner_user_id === $actor->id;
|
||||
|
||||
return ($personal && $this->scoped($actor, 'promoter', $record->organization_id, $record->opportunity_category))
|
||||
|| $this->scoped($actor, 'validator', $record->organization_id, $record->opportunity_category)
|
||||
|| $this->scoped($actor, 'publisher', $record->organization_id, $record->opportunity_category);
|
||||
}
|
||||
|
||||
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) && ! $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;
|
||||
}
|
||||
|
||||
return $query->where(function ($scope) use ($actor) {
|
||||
$scope->whereRaw('1=0');
|
||||
if ($actor->can('manage-portal')) {
|
||||
$scope->orWhereNull('owner_user_id');
|
||||
}
|
||||
foreach ($this->grants($actor) as $grant) {
|
||||
if ($grant->role === 'promoter' && ! $this->represents($actor, $grant->organization_id)) {
|
||||
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->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->available() || ! $actor->hasVerifiedEmail()) {
|
||||
return null;
|
||||
}
|
||||
$contexts = [];
|
||||
foreach ($this->grants($actor, 'promoter') as $grant) {
|
||||
if (! $this->represents($actor, $grant->organization_id)) {
|
||||
continue;
|
||||
}
|
||||
foreach (json_decode($grant->opportunity_types, true, 512, JSON_THROW_ON_ERROR) as $type) {
|
||||
if ($this->canCreate($actor, $grant->organization_id, $type)) {
|
||||
$contexts[] = ['organization_id' => $grant->organization_id, 'type' => $type];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ['contexts' => $contexts, 'mine' => $contexts ? '/minhas-oportunidades' : null, 'create' => $contexts ? '/minhas-oportunidades/create' : null,
|
||||
'request' => '/perfil/promotor', 'review' => $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();
|
||||
}
|
||||
}
|
||||
}
|
||||
+13
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+42
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
+1
@@ -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-CnfotKCe.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};
|
||||
+1
@@ -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-CnfotKCe.js";import{a,i as o,r as s}from"./shared-Be9dJVpd.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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
@@ -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-Dm0I4KSQ.js";import{r as l}from"./investment-territory-CAtZylUI.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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -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-Dm0I4KSQ.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};
|
||||
+1
@@ -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};
|
||||
+1
@@ -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-Dm0I4KSQ.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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -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-Dm0I4KSQ.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};
|
||||
+1
@@ -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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
@@ -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-Be9dJVpd.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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -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-Dm0I4KSQ.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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -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};
|
||||
+1
@@ -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};
|
||||
+1
@@ -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};
|
||||
+1
@@ -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-800gzAqm.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-NFc-CF3v.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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -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-Dm0I4KSQ.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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -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};
|
||||
+1
@@ -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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -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-CjnuxCML.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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
@@ -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-CnfotKCe.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};
|
||||
+1
@@ -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};
|
||||
+97
File diff suppressed because one or more lines are too long
+1
@@ -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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
+61
@@ -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);
|
||||
}
|
||||
+1
@@ -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-CnfotKCe.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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -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};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{t as e}from"./jsx-runtime-BpzPEenQ.js";import{t}from"./compiler-runtime-sKsOXjDo.js";import{n,r}from"./shared-Be9dJVpd.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};
|
||||
+1
@@ -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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -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-Be9dJVpd.js";import{Errors as a,labels as o}from"./shared-CjnuxCML.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};
|
||||
+1
@@ -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-Be9dJVpd.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]=(0,c.useState)(o),[C]=(0,c.useState)(o);async function w(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?C:S,...e?{first_user_id:Number(m),second_user_id:Number(g)}:{}});x(e?`Dupla inicializada. Inicie uma nova sessão como um dos titulares designados; MFA permanece obrigatório.`: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||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 w(),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.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||!m||!g||m===g||u.length<20,onClick:()=>void w(!0),children:`Inicializar apenas estas duas contas`})]})]}),(0,l.jsx)(`p`,{role:`status`,children:b})]})}export{u as default};
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+1
File diff suppressed because one or more lines are too long
+2
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
@@ -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-DMfgnj3H.js";import{t as a}from"./territory-geometry-preview-CzWwAlz7.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};
|
||||
+1
@@ -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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
@@ -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};
|
||||
+1
@@ -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-Be9dJVpd.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};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
@@ -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};
|
||||
+1
@@ -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};
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 696 B |
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+11
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
import{t as e}from"./createLucideIcon-oMeAlXbs.js";var t=e(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]);export{t};
|
||||
+1
File diff suppressed because one or more lines are too long
+1
File diff suppressed because one or more lines are too long
+1
@@ -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(),a={draft:`Rascunho`,support_requested:`Apoio solicitado`,internal_review:`Análise interna`,waiting_applicant:`A aguardar requerente`,referral_prepared:`Encaminhamento preparado (não enviado)`,closed:`Encerrado`};function o(t){let n=(0,r.c)(19),{cases:a}=t,o;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,i.jsxs)(`header`,{children:[(0,i.jsx)(`h1`,{className:`text-3xl font-bold`,children:`Gestão — Terra e DUAT`}),(0,i.jsx)(`p`,{children:`Fila interna. Não representa protocolo com autoridade pública.`})]}),n[0]=o):o=n[0];let c;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,i.jsx)(`thead`,{children:(0,i.jsxs)(`tr`,{children:[(0,i.jsx)(`th`,{className:`border p-2`,children:`Referência interna`}),(0,i.jsx)(`th`,{className:`border p-2`,children:`Requerente`}),(0,i.jsx)(`th`,{className:`border p-2`,children:`Estado InvestMoz`}),(0,i.jsx)(`th`,{className:`border p-2`,children:`Versão/actualização`}),(0,i.jsx)(`th`,{className:`border p-2`,children:`Acção`})]})}),n[1]=c):c=n[1];let l;n[2]===a.data?l=n[3]:(l=a.data.map(s),n[2]=a.data,n[3]=l);let u;n[4]===l?u=n[5]:(u=(0,i.jsx)(`div`,{className:`overflow-x-auto`,children:(0,i.jsxs)(`table`,{className:`w-full border-collapse text-left`,children:[c,(0,i.jsx)(`tbody`,{children:l})]})}),n[4]=l,n[5]=u);let d;n[6]===a.data.length?d=n[7]:(d=!a.data.length&&(0,i.jsx)(`p`,{children:`Sem pedidos registados.`}),n[6]=a.data.length,n[7]=d);let f;n[8]===a.prev_page_url?f=n[9]:(f=a.prev_page_url&&(0,i.jsx)(e,{href:a.prev_page_url,children:`Anterior`}),n[8]=a.prev_page_url,n[9]=f);let p;n[10]===a.next_page_url?p=n[11]:(p=a.next_page_url&&(0,i.jsx)(e,{href:a.next_page_url,children:`Seguinte`}),n[10]=a.next_page_url,n[11]=p);let m;n[12]!==f||n[13]!==p?(m=(0,i.jsxs)(`nav`,{className:`flex gap-4`,children:[f,p]}),n[12]=f,n[13]=p,n[14]=m):m=n[14];let h;return n[15]!==u||n[16]!==d||n[17]!==m?(h=(0,i.jsxs)(`main`,{className:`mx-auto max-w-6xl space-y-6 p-6`,children:[o,u,d,m]}),n[15]=u,n[16]=d,n[17]=m,n[18]=h):h=n[18],h}function s(t){return(0,i.jsxs)(`tr`,{children:[(0,i.jsx)(`td`,{className:`border p-2`,children:t.reference}),(0,i.jsx)(`td`,{className:`border p-2`,children:t.applicant??`—`}),(0,i.jsx)(`td`,{className:`border p-2`,children:a[t.status]??t.status}),(0,i.jsxs)(`td`,{className:`border p-2`,children:[t.version,` ·`,` `,new Date(t.updated_at).toLocaleString(`pt-MZ`)]}),(0,i.jsx)(`td`,{className:`border p-2`,children:(0,i.jsx)(e,{className:`underline`,href:`/management/terra-duat/${t.id}`,children:`Abrir`})})]},t.id)}export{o as default};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{c as e,n as t,r as n}from"./dist-BRfsww6z.js";import{t as r}from"./jsx-runtime-BpzPEenQ.js";import{t as i}from"./compiler-runtime-sKsOXjDo.js";var a=i(),o=r();function s(r){let i=(0,a.c)(16),{registrationEnabled:s}=r,{auth:c}=e().props,l=c.user,u;i[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,o.jsx)(t,{title:`Acesso à gestão`}),i[0]=u):u=i[0];let d,f,p;i[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,o.jsx)(n,{href:`/`,className:`text-emerald-700 underline`,children:`Voltar ao portal`}),f=(0,o.jsx)(`h1`,{className:`text-3xl font-semibold`,children:`Acesso à gestão do portal`}),p=(0,o.jsx)(`p`,{children:`Pode configurar a sua conta quando estiver pronto. A consulta de oportunidades e o envio de manifestações de interesse continuam disponíveis no portal público.`}),i[1]=d,i[2]=f,i[3]=p):(d=i[1],f=i[2],p=i[3]);let m=l?c.canManagePortal?`Acesso disponível`:l.email_verified_at?`Autorização pendente`:`Verificar o seu email`:`Preparar a sua conta`,h;i[4]===m?h=i[5]:(h=(0,o.jsx)(`h2`,{className:`text-xl font-semibold`,children:m}),i[4]=m,i[5]=h);let g;i[6]!==c.canManagePortal||i[7]!==s||i[8]!==l?(g=l?c.canManagePortal?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`p`,{children:`A sua conta tem acesso à gestão de pedidos, sectores e oportunidades.`}),(0,o.jsx)(n,{className:`inline-flex rounded-lg bg-slate-900 px-5 py-3 font-medium text-white`,href:`/management/interests`,children:`Abrir gestão`})]}):l.email_verified_at?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`p`,{children:`A sua conta está verificada, mas ainda não tem autorização de gestão. Contacte o responsável pelo portal para confirmar o acesso.`}),(0,o.jsx)(n,{className:`inline-flex rounded-lg bg-slate-900 px-5 py-3 font-medium text-white`,href:`/settings/profile`,children:`Consultar a minha conta`})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`p`,{children:`Confirme o endereço de email da sua conta. A confirmação do email não atribui permissões de gestão automaticamente.`}),(0,o.jsx)(n,{className:`inline-flex rounded-lg bg-slate-900 px-5 py-3 font-medium text-white`,href:`/email/verify`,children:`Verificar email`})]}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(`p`,{children:`Use o email autorizado pela equipa do portal. Depois de criar a conta, confirme o email através da ligação de verificação.`}),(0,o.jsxs)(`div`,{className:`flex flex-wrap gap-3`,children:[(0,o.jsx)(n,{className:`inline-flex rounded-lg bg-slate-900 px-5 py-3 font-medium text-white`,href:`/login`,children:`Entrar`}),s&&(0,o.jsx)(n,{className:`inline-flex rounded-lg bg-slate-900 px-5 py-3 font-medium text-white`,href:`/register`,children:`Criar conta`})]})]}),i[6]=c.canManagePortal,i[7]=s,i[8]=l,i[9]=g):g=i[9];let _;i[10]!==h||i[11]!==g?(_=(0,o.jsxs)(`section`,{className:`space-y-4 rounded-xl border bg-white p-6`,children:[h,g]}),i[10]=h,i[11]=g,i[12]=_):_=i[12];let v;i[13]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,o.jsx)(`p`,{children:(0,o.jsx)(n,{href:`/`,className:`text-emerald-700 underline`,children:`Configurar mais tarde e voltar ao portal`})}),i[13]=v):v=i[13];let y;return i[14]===_?y=i[15]:(y=(0,o.jsxs)(`main`,{className:`min-h-screen bg-slate-50 px-5 py-12 text-slate-900`,children:[u,(0,o.jsxs)(`div`,{className:`mx-auto max-w-2xl space-y-6`,children:[d,f,p,_,v]})]}),i[14]=_,i[15]=y),y}export{s as default};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user