@@ -0,0 +1,49 @@
|
||||
{
|
||||
"new": {
|
||||
"functional-document-alias-before-20261011.json": "f5ba4ec6fe106288e232180951680e7b159a7dd263ee5c2625e813a7d2a53ac8",
|
||||
"functional-document-alias-after-20261011.json": "b815f081263f7fa84ababa977e2ce1f26b632f68c644cac571571882b012c062",
|
||||
"functional-document-boundary-chromium-20261011.json": "d363469b0e470a6371ae9de5332d3a27088f807aba8cbc6642d235cb0e553b26",
|
||||
"functional-document-images-chromium-20261011.json": "cb83d4f24adc8a9d179ea0802ce9a16bad71725b599d46d771fd86d257716eaa",
|
||||
"functional-delivery-scope-chromium-20261011.json": "4eaeb7587651dd039680a1e6ec10a8a8cc45ec3953106a42cbd853149ce89d39",
|
||||
"functional-scope-dependencies-chromium-20261011.json": "3135d72f880a8235cc3a6cbb56a181d227b6f0adbf8df4482066c811011a59d1",
|
||||
"functional-scope-persistence-qa-20261011.json": "f3a8dabd880e57c5890cf9244b43657db0d220c0757c4edf021f4c8a81741501",
|
||||
"functional-scope-country-compatibility-qa-20261011.json": "4adac1c7c0b160e5b1baf517699ad38d8c3f1e32a6ad88c5e1580ef93877448f",
|
||||
"functional-scope-production-build-20261011.json": "b5a7653d1b040068abc0c3efe8323578f07ea5b8dad0f4d9dafc863880759d2a",
|
||||
"functional-scope-backup-restoration-qa-20261011.json": "600badfe0c16dcfaf7af8b3db75f2deac5544bffd46e15efd9ea1a41430f1de7",
|
||||
"functional-scope-target-backup-20261011.json": "6ff2f0e4feed0940083d914d82b7d8f38675f597a0f1d5033eb3f2573bf7f52c",
|
||||
"functional-scope-target-readonly-20261011.json": "8470c86459a544f86827c6d5ca7e92880d4eee0348044ef5fd2c0b6429abcb11",
|
||||
"functional-scope-destination-services-readonly-20261011.json": "d01c83695eed305f8fb4beef200e00c36ad9963aa6afc11af3554954400cef63",
|
||||
"functional-scope-finalize-20261011/csv-authoring-proof.json": "f7813559c930908fa36e7967faa769b32a7d6976172774fb0c7e51d8584fabf5"
|
||||
},
|
||||
"reused": {
|
||||
"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-production-build-20261011.json": "900b91c12e3cad124a7711f5f436a02a538c5a162fd83f9ea937d83608fe6a50",
|
||||
"functional-lease-editor-chromium-20261011.json": "7fee419c2e54c37e05592e4bcd457d159df97f20f78863140957364d0c960dcd",
|
||||
"functional-lease-persistence-qa-20261011.json": "0e58f98419d6ecec749118d6de402eac458335ac620918a58f6006786c25a2e1",
|
||||
"functional-lease-workflow-chromium-20261011.json": "e2b7d914c5f23e8b2651792d6e6ac4ced7acb6d0be866fee93463e5f74b2b6aa",
|
||||
"functional-lease-workflow-persistence-qa-20261011.json": "b96fedc339d6082d4da2d8bd2f54af59f47694942d2b61faed5a361a112c4077",
|
||||
"functional-lease-visible-chromium-20261011.json": "79c7acadc4e01e8c53be6bddc2bb9f8faefe594724359aa969cc3df2dc0137bd",
|
||||
"functional-consolidated-backup-restoration-qa-20261011.json": "e00d85a0bc50cbf7dca22e1a24aaf481bd584ab76784cc8ca4f61fa273f6aa1e",
|
||||
"functional-consolidated-country-compatibility-qa-20261011.json": "ab5be338f01fcbb425d432ac7392021d564890dd38f1e3ae1c5393d517bfefeb",
|
||||
"functional-lease-consolidation-20261011/verification.json": "1c31eb2ba00e40bb4bcb92d9986d61cd1dbcf68405898e321a9bf2fbaa1376f7"
|
||||
},
|
||||
"quality": {
|
||||
"existing_regression": "25 unaffected passes reused; one failure of semantic error preservation corrected and its test rerun successfully (50 assertions)",
|
||||
"production_build": "3c6d4c3dc538128f6a445b38a5b6e98c567149fde0a49ac8b46a4c7f7d6eb1a6",
|
||||
"typescript_exit": 0,
|
||||
"XML_before_fix_sha256": "b2ec4d75a849fae61b9f7825d8eb30bf45f6372056a20c62243eb3ab567000c0",
|
||||
"XML_affected_after_fix_sha256": "730b4aa0669f8461ed493ceacb467a89e40415ea24998e6ba2430979476ed917",
|
||||
"acceptance_is_criterion_based": true
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
@@ -0,0 +1,484 @@
|
||||
{
|
||||
"format": "investmoz-opportunity-workflow-scope-1",
|
||||
"base_revision": "485ee04c40b2754ab668f48fd84d8559fb19a8b98f4b9af50fc0517bb488ca76",
|
||||
"previous_candidate": {
|
||||
"revision": "8af63e2fe6570797a7e42cb115c8cd48e5ef3879ccdf040dc50ff67615712e31",
|
||||
"manifest_sha256": "410bc74e6befde6e51a6e8afe8d55a699d600c1a857f1fc7d395baba30cd49ca",
|
||||
"archive_sha256": "feb7f4e8ae2608f08ef90d3a0acfbe71ba118480c967e784fa5037b645cc3403",
|
||||
"preserved": true,
|
||||
"availability_blocked_by": "C126"
|
||||
},
|
||||
"code_revision": "d19dd63b67b49d5ab8aea541dbebc8f9c12423e9895fe7f3d80da045e80be2cb",
|
||||
"payload": {
|
||||
"app/Services/OpportunityCanonicalContract.php": "6ce5c72daefa70754d6154846de05da71ee275a047f60e95d8d2b6c8c66423c1",
|
||||
"app/Services/OpportunityCanonicalResponse.php": "31c2f60a1337c91c801b2576ee2af545f1d47b1abb76d5859463932b45268ae1",
|
||||
"app/Services/OpportunityProfileWorkflow.php": "9bc00b0c268b869ed5beb1eb2259cbd900a4ff7adcfbb590771737721364d3e3",
|
||||
"app/Services/OpportunityReviewConditions.php": "0f4362a347eb1b8a4a95b05c037f0180ca40e76793bdcbb9eae51226861fba41",
|
||||
"app/Services/OpportunityReviewMateriality.php": "efc0b17a75bb3063bc2995e85d0c571af4692daad1c41e342607beea6d6bc47f",
|
||||
"app/Services/PortalProfileAccess.php": "8d4b897a65fa45aae6b18cab85634fe216a3695d04c146efa8f4e2022e4133b8",
|
||||
"app/Services/VerifiedDocumentBinary.php": "1b26a873bc28da916c1efda3b0ef1a1bbd28c266504b897ce30a9407f2b486c7",
|
||||
"public/build/fonts-manifest.json": "66edf17c93351fe01158be7414a441a762f106417c74351881876b405b8b10ca",
|
||||
"public/build/manifest.json": "3c6d4c3dc538128f6a445b38a5b6e98c567149fde0a49ac8b46a4c7f7d6eb1a6",
|
||||
"public/build/assets/administration-C9PoYvB2.js": "73d0aa7ae971ae0d465547d952fc30c03c6441a580fc6aa0bc9b0b12c21f8308",
|
||||
"public/build/assets/ai-BR3K3Oo7.js": "d67b43f02d95de9ebdd38bf98095375b9f68bcc4dc56de08e6c91dec8445fe1d",
|
||||
"public/build/assets/analysis-Den0n8hy.js": "8ea738e730fdd9bbb36a24f51cfc48ade1c9733d70010ae59ace5078d02925b6",
|
||||
"public/build/assets/app-CdqBMdkz.js": "5ede976c51e0bb69368acd7abfe8d3f697c6d15d658a545e54ef79717d8a171b",
|
||||
"public/build/assets/app-kj8h1utZ.css": "4cfedaf0837b8be29cb1c98095251168d2564ef199a290b336f9126cbbbb15aa",
|
||||
"public/build/assets/appearance-C2jqUjeB.js": "7188b1ac8cf4a5755340694272835d6a071987c4eaf59ecbfdbc3c8d39596604",
|
||||
"public/build/assets/audit-NHkhbvR_.js": "9143d1abfdd50c9b28ef963705aee8becedf7470b43c8f3b9a4fe41151a18cdc",
|
||||
"public/build/assets/blank-2jFZEe2q.js": "9e53a0a455027f070e3041db1f445e8b63702f83e264442d8df87e20048ccbe9",
|
||||
"public/build/assets/business-BcbomU_w.js": "fba02a398abdf0844300362d4d198237a42e2824619fc2ce8ed71f24ab8ebc44",
|
||||
"public/build/assets/business-interest-26a_ToAZ.js": "86df1b91a4ac101772bb264465cdd404cb77a4ccffb8f623442757cf4efbfda4",
|
||||
"public/build/assets/business-marketplace-Ds3msqLq.js": "2c5bccd0d93a81d42244df462824dfd4ec73897c695c9e5773d46bfaf21502ee",
|
||||
"public/build/assets/business-objects-JRrwLpDW.js": "a2d026d9e985185638524afd436ddafbce067c0d7ace731206aa85635f4f4628",
|
||||
"public/build/assets/business-opportunity-CLVAwOea.js": "bf997c4d25a57145a8d67fe8caca11c1d3507c7c2240f05d481d53d6cce29eef",
|
||||
"public/build/assets/business-types-SGCXhH6X.js": "c792ab88a79f57c74d865c47e89e7f2b9aea190acb5c8c676071d4b0a802d58c",
|
||||
"public/build/assets/business-verifications-NaLnczNU.js": "a0d97b8b01b297d1c5e32bec73dd5876f8a69aa024bb72ed070ff1e242a19e2f",
|
||||
"public/build/assets/business-wizard-CaO3jHW9.js": "a1cb50b0756555630279c0639e2a86c0b4e7d9f59215e82500f11f855371d3c1",
|
||||
"public/build/assets/businesses-CeMk9jK9.js": "164cc6d8d952cae1e98afe86ea10ea838154c1ffebb1ace88a1293ce96234639",
|
||||
"public/build/assets/button-DAU4R6e9.js": "79b615d0b88db74491fb4b312ae70515d43332e8730f8baed64c81eec510171d",
|
||||
"public/build/assets/case-CIScUI-F.js": "a9b9ab1265e334198e1f577e043510a1f9f8bc31c97fd0405041fbb23ca2e185",
|
||||
"public/build/assets/case-CwaNqQ3i.js": "3631ab83f351a67a57cc3848994916e61b3fc69073dabc2175146cc38b7220ad",
|
||||
"public/build/assets/catalog-7dcIodDP.js": "cd9393786e0b5af822aefda91be81de8b36a954154c4bb812368d85e079cce1d",
|
||||
"public/build/assets/catalogue-BAifwvcC.js": "1075dd994c3d001f94d42ac7a3ed7131934e346ff5741f350e40923dde75a102",
|
||||
"public/build/assets/catalogue-BvsjAbb6.js": "0734890fbc64b6be959c90f3c9b1c0d1539dfbfdfa080dd27c55e541039de48f",
|
||||
"public/build/assets/catalogue-DBEnnfwZ.js": "d8a409f8ebbd907e950edaeedc7599bf3baea1a757a22a4386afe509d4661863",
|
||||
"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-CGpga7vk.js": "33175ee68d58d5b84b17a06b5ce9272d9581979913f468e8cfc01a06dcaf0dbd",
|
||||
"public/build/assets/context-DkZEhXWn.js": "6c976a85c65998726c9bd6c1eff86be98c1e17a90d3a2f2680f065cb4fdbd462",
|
||||
"public/build/assets/conversation-DdQABNp5.js": "de19189c4334a64c67012bdd2760c3dd388e0f727420e0e1a570c72a79fb74e3",
|
||||
"public/build/assets/convert-CzjWIBei.js": "b75cdb597af84295bf8cf18bf316d2feacd05e631e3883b1e78f5135ee6e398c",
|
||||
"public/build/assets/country-select-C3BLoPPG.js": "87822f75957659509b95011d1489f6bed2ff824c215fce862a7fd29186f5189f",
|
||||
"public/build/assets/createLucideIcon-oMeAlXbs.js": "9398e5f9d8be91b886b9f6283574d6eb89b8fa02a4c21866ab9e376c95b74b56",
|
||||
"public/build/assets/dashboard-B_29CXqc.js": "b39754be391a2aad96ff1f4ecfba70e3564ac1f9ca27fc2a28a142640fe1a28f",
|
||||
"public/build/assets/dashboard-XMtoOXWo.js": "247158641239fe2ee16195b71f98491f0f46a2d8da3cb38b45803f8af1f05100",
|
||||
"public/build/assets/desk-internal-operations-DTw-b5Fa.js": "89106cd58c0e08aac6ce74055cf94daf5f36eb6cbd418a92c41404f6ecb1991a",
|
||||
"public/build/assets/detail-b9yzNYu0.js": "caddca7e09d8e9cc7cd7e9591541d6738ccddb3faad4db32f686136dad8e6677",
|
||||
"public/build/assets/detail-FOohQ4zE.js": "1211870fb2f4349c8d98d0cd42222886101b2cd2bf1e22d868bf290aaa5b6f65",
|
||||
"public/build/assets/dialog-eonMReMH.js": "1dc6383736d6057f1671db62242d535b0cac981d275772b79b6a21a091cfa3c1",
|
||||
"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-CwzlTQyD.js": "63f9a34836953a343fe6bddbea4ebb981750c624fddb8bb4f3b5cd9bdc8fb779",
|
||||
"public/build/assets/editor-BMlgClYh.js": "b24bd9ec6dea88e961fc9592c83d98b44991294bef8873ba71d480e873a06060",
|
||||
"public/build/assets/editor-DZsQiQoX.js": "9861820888811485cd5cc8425a42a24edbdb78d33f5ecac5d6ad269c7bf692c2",
|
||||
"public/build/assets/editor-fiFdN76f.js": "f357862a5a7a6e7d894528155849b93f1012203a2dd6c0858e1d034a47ab8dc8",
|
||||
"public/build/assets/education-hFtvphPJ.js": "663b0b11bea8ad469a23ebd38e6751a120f45fff2c8b8097068259a862566f06",
|
||||
"public/build/assets/financial-calculators-CsDOUJxx.js": "e76679a1914b5c4dc6c3e74b1b2de8d3d792fcc891dcc61d0fa27042232e2b9a",
|
||||
"public/build/assets/fonts-C9MNnjVw.css": "3846a9bb60bfad92960eadcccaf0b4e129d74b11d48791506c8d1a827a385cc8",
|
||||
"public/build/assets/forgot-password-BWffkWuh.js": "5ad6f2de170d8377cd9799d510c8d5f7c44be5887438c0680f91c164ebba90ed",
|
||||
"public/build/assets/form-VQwmhal1.js": "a1ace61a6bdefd6c7502ce66a88854b38773efbe4d567c5b100028d4c86dc66b",
|
||||
"public/build/assets/guide-mndEuKFT.js": "fe519ab69363e83bb705b7dee5ab3fe17249eeb53687846b539668c435ccbd2b",
|
||||
"public/build/assets/history-DycMXf8z.js": "d55da4db5c06a705972df42896f6e63ea22fe965c559888694fbfa01e326bbbc",
|
||||
"public/build/assets/input-error-U1QKS0ED.js": "4acac92fa624552b14ac1a390e961f9e387d6eefeac384ad4e95bc73fdffa86e",
|
||||
"public/build/assets/install-B17maJSg.js": "db4da54912bd84b1779016c8d687eea851d121376e54adf839345de5ea1d8d04",
|
||||
"public/build/assets/installation-CbDmbtax.js": "96429bcc7f41cfa207160c4c507f015c3ed21eadcefc65670d6af527fdc6b924",
|
||||
"public/build/assets/installation-d9T0y3sF.js": "1dd90e11dfaa247bd70e5940db4b0e2757006a756c8fe6dca56f4a8000e6989c",
|
||||
"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-Bo2viMa_.js": "68ea59860e4b802aa77945f81f58f566ee89ad314b5add49a50f1579d7cc04c2",
|
||||
"public/build/assets/interest-gK2lvili.js": "ac53110ee33a8059b38d4c9d4febbd1c2320c34a420c92a382e4f8def6fc2dd7",
|
||||
"public/build/assets/interests-CRo-lkpk.js": "9fe3cf0dc5d3686945700ba6f9ee740b22437b9d8312aad2dc0461603a032275",
|
||||
"public/build/assets/investment-map-panel-Dk8fwr2m.js": "0fb8f9335d24555c7bd59bb1b0479a3969c54a1a4274d226036e9191bf4d78a6",
|
||||
"public/build/assets/investment-maturity-CydhhEfV.js": "c2cc75070cb664ab0b53466dde584dd5473f1b5fd992bf6a59ca8a01b7e19623",
|
||||
"public/build/assets/investment-territory-CggzoPQh.js": "6ffe9fb3fbbd203ad0937c5e51c75e4ff7adca8fe7b9f5741b1c586635da9a96",
|
||||
"public/build/assets/investor-DJlo84Aa.js": "1799806b7d51d59b916856d7000843b2672c080b1e485c679ee15be24ddf5283",
|
||||
"public/build/assets/investor-path-CAHGk6qB.js": "d097b941ba9393ef82351cbd6c1b3e96d17cc3a7d605e721a2ef282557db8422",
|
||||
"public/build/assets/investors-QOgPOoF1.js": "83f1ef77252d4c5e11465bf061502207c970fe83e1ab99f688a6c90403f0d0fc",
|
||||
"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-bDH1yrKq.js": "41dde5e8353edaf72124690afc3e35622c5340e74560b84528922efec3b4744e",
|
||||
"public/build/assets/leads-CY1I4JJM.js": "f232b7f52c42e854538cd010ee7fce0207112db31427ed33fd7abdd4b25a8ffb",
|
||||
"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-BWEpCz-F.js": "ef41eecb5031440a661d89543aa164aedc45010baffe92930c1857a9f356e918",
|
||||
"public/build/assets/manage-BGiDWykx.js": "324cac5b6bb4a347c10097de2bb3b100b0c1ff01e88589717b58db1b00c2abcc",
|
||||
"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-BOSjowrG.js": "1a8d399e26f3f9560e9dab4cd1d8bfb2e03ad2df66510e1d1e11c2057840f6be",
|
||||
"public/build/assets/operation-key-Dr4VtGxa.js": "416fed7a5197657971af7f378998557c9dba2f99e266e39149b727e598bea439",
|
||||
"public/build/assets/opportunities-71v8XO7M.js": "825b2e8011df96b506065f83310ea8bdc818c1c3cb87297f5b81137bbcd3af43",
|
||||
"public/build/assets/opportunity-draft-Dp29iHga.js": "5c372240026964dedb45d0aa362a074a0c7515406f293d66ef716235317e6c29",
|
||||
"public/build/assets/opportunity-install-C1w-SpiA.js": "c90b855cb97a3172987f3c1de51c23c36d3e002b694306df84f10b1a23bdd1fd",
|
||||
"public/build/assets/opportunity-origin-C3EY4u16.js": "1447c6a0f9600f54c70aeac289c400c46e90133ce391fe8c67d5e01d313f2c50",
|
||||
"public/build/assets/opportunity-resources-DbozJpRd.js": "c6432cc161c2b426505218b526589370c6467337bb814d25742fd811a020bd8a",
|
||||
"public/build/assets/panel-DfUMBo7-.js": "c04548bc6fc7ab12af67b150d397bad4479b17abee7fc994aab4a11993a75de8",
|
||||
"public/build/assets/partnership-source-links-VfrXk2FZ.js": "a4d6c8500f2417983312ae667b96f035df9654f37aa4a7bc86f0cc01fda0ddd8",
|
||||
"public/build/assets/passkey-verify-BVjVf9Ia.js": "c5d4480a686cce6e4e857e76e4c95595f0ea557660874479c97d19e08e6b4ba5",
|
||||
"public/build/assets/password-CB_NxgQN.js": "4415e495723009fc084111bafd2b7714221a3712e5f1d2a4dfa0e698f6308c7a",
|
||||
"public/build/assets/password-input-CbF7QAPJ.js": "de600cb247478c435889b9ebca33d0516761d774204868efd5dec7cb49711361",
|
||||
"public/build/assets/portal-api-tEuwFTsU.js": "190505d0a96d610ef2893cf06c63edab30f427593452bbc0dafc9d8f8a826c70",
|
||||
"public/build/assets/PortalInvestidor-Cn3goaVy.js": "5580275bb7c275db2e9099a98e5f25a6138814ead219d27843ce36ba75cadef1",
|
||||
"public/build/assets/portfolio-BH0NcG0A.js": "592a6aa996eb44a2fbf43ce1954eea892c364bedccdec5628ce5ee2f1d397f66",
|
||||
"public/build/assets/print-EIzSB6Ku.js": "bad87486159deb855589aa92fc7032ea28de222693c2816f2ff54b1583ef6513",
|
||||
"public/build/assets/profile-D2iy6Wwf.js": "d0b8b4c69dda5743b723a611663cd8075b9a72f3d5591d09ef55492c7487204f",
|
||||
"public/build/assets/profile-DI8jOMpJ.js": "fa61a660215e0fae8826c99105a593753bcd0276ed68a20abd77ae869561f73a",
|
||||
"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-C-jqGmSL.js": "4e88698a29a7ce16f6a2b5d0de3fa99c3d7e5d37462359db35a68f2e17907f26",
|
||||
"public/build/assets/register-BE_zPoLA.js": "245e4b12ec8e6c850625b444d65e95f40f67042aae7fa608d129fb64a2cd905f",
|
||||
"public/build/assets/relationship-repair-icMyiee3.js": "fd440a52cf98dfe2f56f36315c1955998cd03ee8e4c8d754709a414abce29359",
|
||||
"public/build/assets/request-BJxix9-B.js": "bc0bd28c5bfcc7edbba66e7fee884d6162da315ddea2966eccd1f9479cb2a8f3",
|
||||
"public/build/assets/request-CTLATt-Z.js": "d92c67c1de4bb00a29805305d9a1f5ee1de650592abdf35143f81d06f4c6a137",
|
||||
"public/build/assets/reset-password-C2kNOiuW.js": "44d1af94189fd858e4423dc840ada4b7b5691134d895868fd0ca3486e79ddc39",
|
||||
"public/build/assets/result-DISqwOy8.js": "aecb107db902f9a32c176a189a4c884c9273e03784216d3a868d627d9994f80c",
|
||||
"public/build/assets/rolldown-runtime-Dd_uD5pT.js": "c5f0356f5d0918a3137e4e811fd18950efe8ac8f6bf84d1d4da7811c477a24d8",
|
||||
"public/build/assets/room-BVQMwzyO.js": "caa1f8c988a0f3a7f22b48893510b76585bcdd8a5ec5c206969709ac34015761",
|
||||
"public/build/assets/security-DNgJxHMY.js": "c5524f74a4056179ab97bb77637ca508d28f00c726ec7d42158c212067ef10ec",
|
||||
"public/build/assets/services-J1jkNiFw.js": "4dd902d578eae137a05b9e5f22597832afa5c6e74a1e7af46224444cc52218b9",
|
||||
"public/build/assets/shared--o_lipYU.js": "58324103e62bbc948886fccaf53e2e5466036d41524758780f1ce01569b90c88",
|
||||
"public/build/assets/shared-Cj9EC3ob.js": "9a424b6d1c51092662c68af06ff9c4e501b33798948b11ba11b0917e1016e3a5",
|
||||
"public/build/assets/shared-D-va8joy.js": "d29e8ae254fa9195fb20ef02c47845173d305d1f77e8cfd4d0ad84766841e600",
|
||||
"public/build/assets/shared-DDFDWkxk.js": "bd41e994ff779cea7e0d0e6659017919467e7870a91b2c9a549cb90b15f48686",
|
||||
"public/build/assets/show-Bves4hDl.js": "f1991ea8de911d9648db6705658b57e178bcf1f592006fdc536373e38c32b7f5",
|
||||
"public/build/assets/show-ChiKlf2m.js": "de35d2a085b85ada8031eb162a7bd15c2d92bd38bec2a0891415bcff8a2c9ab5",
|
||||
"public/build/assets/sources-DgoyzAng.js": "7d3fba52406193f9b0acd85b02b08aba741214881067658b0d6591f603c7ffc4",
|
||||
"public/build/assets/spinner-hD8hHC_m.js": "0091bbe0e4125cbe30ecd10ec9ff65cff9b7bd270125913d85b4449144aa91fd",
|
||||
"public/build/assets/structure-geography-CF4FelOd.js": "758f68cdcd16c95e4ba58dfea3c9dc5b2994e42d3fcb4ccdc4d44b555b808781",
|
||||
"public/build/assets/structures-BDioN7jv.js": "c30be41f11c4f896de0db18f2d21999be7d157c900b36622727b432f7845304f",
|
||||
"public/build/assets/submission-D0afYOPx.js": "d6ab67ae227743505dfef3e55844d5808d564c03863247ce83ae4d2ed5591a31",
|
||||
"public/build/assets/territorial-source-evidence-eKB4ZB36.js": "14048631c51933a0389cea37ae1909a02ea86d564a5a05452a48b40f055cd605",
|
||||
"public/build/assets/territory-associations-MqWd4f2n.js": "0aa14c9a3bd82bdad3d57a4170fe1f1b37eb6ccf61ef032db53f50d2b251af0d",
|
||||
"public/build/assets/territory-geometry-import-CnaJ_Kvy.js": "be452b8c4dbb722a0349179a3dca15943581eef98c7d812721e7f1327f9fa9c7",
|
||||
"public/build/assets/territory-geometry-preview-XD0LNOrx.js": "cd3cbaeadf8fd2cf234732527abd5f14bcf4454e2dd57bf878a2cab41e290c5e",
|
||||
"public/build/assets/text-link-BBvcP60s.js": "0e7b5234d766855dbcbd5a78fe3e8c54fa6ffa1ad6163009d7b312eafd19f307",
|
||||
"public/build/assets/two-factor-challenge-yzwmJShf.js": "971dcdfda67b83d4fd569789e4ff86d186ef1b76aa7a4f0caeb01ada5e10357e",
|
||||
"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-lSYJv7Wc.js": "ee05f9fbb9fc70be4d8c98754935ed4b0d439532e8c393a4a3a7d777eba1f6a4",
|
||||
"public/build/assets/value-text-BztaYdGl.js": "873576810a6ba4eb8c9c116f53cdc649b21ab2995aa2adadd4c85130b04bacd2",
|
||||
"public/build/assets/verification-BOcn3HIw.js": "10addac3d8f1865e855943e0685e88a268ffd8013ff7a7d51fb89d755b12074e",
|
||||
"public/build/assets/verify-email-CzJwdKL0.js": "9d06558124b9f7701af240e1e0fdf9ce6adae464b1a0d389f5d65579e8a274a4",
|
||||
"public/build/assets/wayfinder-Dp7PqxvV.js": "3d4c90228fda731e37f541f3087fdf5387d9d59433e35b267b64a97196f70781",
|
||||
"public/build/assets/welcome-Gkt7sWR5.js": "0a9dd4b9fb0176bee9d74d7285df15f9b9af16ce0988303d4962985ef561bbb5",
|
||||
"public/build/assets/workspace-4_R1CLYI.js": "5d4c742569d9ad33ac7bac01c6433c646f79f939d2f57b7878860c0d25dcee22",
|
||||
"public/build/assets/workspace-B3EOrmNE.js": "867e85c2ed43a66b84d0a8d90c4f8119ad25cdec3d2aac5656c71e5f2f7f4d18",
|
||||
"public/build/assets/workspace-BPaOtN1b.js": "26d6ec3dab00a71a3c1af3a74274ea1222becf2de2f967cb00066136e43ffd94",
|
||||
"public/build/assets/zone-attachments-KitFPwHk.js": "d747008b6045ed307065544b4b582a5a881ceb5b55665943f3a4aa1db5118cbd",
|
||||
"public/build/assets/zone-DD91TL43.js": "ebdd6a2522199161652c36f0fb809e60d268711df7a000b344c4ffef6ae33b76",
|
||||
"public/build/assets/zone-map--b6bNUwl.js": "9edb055cf4e24487b949d15f515bd9d6261394e4386fb79f5129b0496b221733",
|
||||
"public/build/assets/zone-relations-CV5dVal6.js": "ca4387306371847deb9bf5b3f7cff2925862fccb7847470cce84be85efe311e1",
|
||||
"public/build/assets/zones-CJjfG_Q8.js": "0cbc0669bdde2f64378159097bdb8482657bafd939c02c6b1788b23369c84f77",
|
||||
"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": "6cc22e0813da6a414bcca1df15fe094fd59a5b1add12b47d83e22f021cbc2d29",
|
||||
"resources/js/pages/management/opportunity-resources.tsx": "c89e1438020999e0dd2185b04e1f782923ddcabdceaf15df91cd08b92edf213e"
|
||||
},
|
||||
"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",
|
||||
"app/Services/VerifiedDocumentBinary.php": "7a0535a6809dc28bf3892ee74c78e123ead592417b2a574538d861af9b82e87a",
|
||||
"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",
|
||||
"resources/js/pages/management/opportunity-resources.tsx": "8ce1749f0f293a555b8cbd0079b9532d929416e88463a872ec1e83841fe504c3"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"additional_changes": [
|
||||
"app/Services/OpportunityCanonicalContract.php",
|
||||
"app/Services/OpportunityProfileWorkflow.php",
|
||||
"app/Services/PortalProfileAccess.php",
|
||||
"app/Services/VerifiedDocumentBinary.php",
|
||||
"resources/js/pages/management/opportunity-draft.tsx",
|
||||
"resources/js/pages/management/opportunity-resources.tsx"
|
||||
],
|
||||
"production_manifest_sha256": "3c6d4c3dc538128f6a445b38a5b6e98c567149fde0a49ac8b46a4c7f7d6eb1a6",
|
||||
"recompilation_required": true,
|
||||
"profile_fingerprint": "a9f0dcb6f66a6e67685d495d66bd4aaee3378d0a58ae4ff88e66bc0dc74d4323",
|
||||
"resources_fingerprint": "39340fef678a8eafe016fa1d8980bcc3dfb567f08d9497311f5a4ad780ca2be8",
|
||||
"included_categories": [
|
||||
"investment_project",
|
||||
"real_estate",
|
||||
"land_rights",
|
||||
"business_sale",
|
||||
"business_partnership",
|
||||
"franchise"
|
||||
],
|
||||
"included_cases": [
|
||||
30,
|
||||
31,
|
||||
32,
|
||||
33,
|
||||
34,
|
||||
35,
|
||||
54
|
||||
],
|
||||
"included_scope": "Existing base-category internal workflow, compatible Response, scoped group-private resources, materiality/conditions, filters and scoped accessibility; sale/lease completed vacant unencumbered preparation branch",
|
||||
"unavailable": [
|
||||
"Individual per-file recipients/sharing/NDA/revocation",
|
||||
"Opportunity restoration pending R-ARCHIVE/R-DRAFT decision",
|
||||
"Full normative Response/27 export",
|
||||
"Real estate planned/under-construction/occupied/renovation/encumbered/urban-limit submission",
|
||||
"Experimental modular categories/offers/SLA",
|
||||
"Legacy integration and integrated journey/190000",
|
||||
"Geometry imports/publication",
|
||||
"Real devices/full accessibility and external legal decisions"
|
||||
],
|
||||
"effects": {
|
||||
"code_files": 14,
|
||||
"new_service_files": 1,
|
||||
"assets": 158,
|
||||
"new_routes": 0,
|
||||
"new_configuration_files": 0,
|
||||
"prospective_installations": [
|
||||
"030000",
|
||||
"040000"
|
||||
],
|
||||
"prospective_new_tables": 7,
|
||||
"prospective_new_columns": 5,
|
||||
"automatic_accounts": 0,
|
||||
"automatic_organizations": 0,
|
||||
"automatic_representations": 0,
|
||||
"automatic_publications": 0,
|
||||
"active_writes": 0
|
||||
},
|
||||
"privacy_policy": "Existing opportunity organization/type/role authorization; authenticated manager alone cannot bypass it. Classifications remain metadata, not individual grants. Publication of teaser does not publish files. Original/image derivatives require current authorization through every binary route.",
|
||||
"QA_evidence": {
|
||||
"functional-document-alias-before-20261011.json": "f5ba4ec6fe106288e232180951680e7b159a7dd263ee5c2625e813a7d2a53ac8",
|
||||
"functional-document-alias-after-20261011.json": "b815f081263f7fa84ababa977e2ce1f26b632f68c644cac571571882b012c062",
|
||||
"functional-document-boundary-chromium-20261011.json": "d363469b0e470a6371ae9de5332d3a27088f807aba8cbc6642d235cb0e553b26",
|
||||
"functional-document-images-chromium-20261011.json": "cb83d4f24adc8a9d179ea0802ce9a16bad71725b599d46d771fd86d257716eaa",
|
||||
"functional-delivery-scope-chromium-20261011.json": "4eaeb7587651dd039680a1e6ec10a8a8cc45ec3953106a42cbd853149ce89d39",
|
||||
"functional-scope-dependencies-chromium-20261011.json": "3135d72f880a8235cc3a6cbb56a181d227b6f0adbf8df4482066c811011a59d1",
|
||||
"functional-scope-persistence-qa-20261011.json": "f3a8dabd880e57c5890cf9244b43657db0d220c0757c4edf021f4c8a81741501",
|
||||
"functional-scope-country-compatibility-qa-20261011.json": "4adac1c7c0b160e5b1baf517699ad38d8c3f1e32a6ad88c5e1580ef93877448f",
|
||||
"functional-scope-production-build-20261011.json": "b5a7653d1b040068abc0c3efe8323578f07ea5b8dad0f4d9dafc863880759d2a",
|
||||
"functional-scope-backup-restoration-qa-20261011.json": "600badfe0c16dcfaf7af8b3db75f2deac5544bffd46e15efd9ea1a41430f1de7",
|
||||
"functional-scope-target-backup-20261011.json": "6ff2f0e4feed0940083d914d82b7d8f38675f597a0f1d5033eb3f2573bf7f52c",
|
||||
"functional-scope-target-readonly-20261011.json": "8470c86459a544f86827c6d5ca7e92880d4eee0348044ef5fd2c0b6429abcb11",
|
||||
"functional-scope-destination-services-readonly-20261011.json": "d01c83695eed305f8fb4beef200e00c36ad9963aa6afc11af3554954400cef63",
|
||||
"functional-scope-finalize-20261011/csv-authoring-proof.json": "f7813559c930908fa36e7967faa769b32a7d6976172774fb0c7e51d8584fabf5"
|
||||
},
|
||||
"reused_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-production-build-20261011.json": "900b91c12e3cad124a7711f5f436a02a538c5a162fd83f9ea937d83608fe6a50",
|
||||
"functional-lease-editor-chromium-20261011.json": "7fee419c2e54c37e05592e4bcd457d159df97f20f78863140957364d0c960dcd",
|
||||
"functional-lease-persistence-qa-20261011.json": "0e58f98419d6ecec749118d6de402eac458335ac620918a58f6006786c25a2e1",
|
||||
"functional-lease-workflow-chromium-20261011.json": "e2b7d914c5f23e8b2651792d6e6ac4ced7acb6d0be866fee93463e5f74b2b6aa",
|
||||
"functional-lease-workflow-persistence-qa-20261011.json": "b96fedc339d6082d4da2d8bd2f54af59f47694942d2b61faed5a361a112c4077",
|
||||
"functional-lease-visible-chromium-20261011.json": "79c7acadc4e01e8c53be6bddc2bb9f8faefe594724359aa969cc3df2dc0137bd",
|
||||
"functional-consolidated-backup-restoration-qa-20261011.json": "e00d85a0bc50cbf7dca22e1a24aaf481bd584ab76784cc8ca4f61fa273f6aa1e",
|
||||
"functional-consolidated-country-compatibility-qa-20261011.json": "ab5be338f01fcbb425d432ac7392021d564890dd38f1e3ae1c5393d517bfefeb",
|
||||
"functional-lease-consolidation-20261011/verification.json": "1c31eb2ba00e40bb4bcb92d9986d61cd1dbcf68405898e321a9bf2fbaa1376f7"
|
||||
},
|
||||
"quality": {
|
||||
"existing_regression": "25 unaffected passes reused; one failure of semantic error preservation corrected and its test rerun successfully (50 assertions)",
|
||||
"production_build": "3c6d4c3dc538128f6a445b38a5b6e98c567149fde0a49ac8b46a4c7f7d6eb1a6",
|
||||
"typescript_exit": 0,
|
||||
"XML_before_fix_sha256": "b2ec4d75a849fae61b9f7825d8eb30bf45f6372056a20c62243eb3ab567000c0",
|
||||
"XML_affected_after_fix_sha256": "730b4aa0669f8461ed493ceacb467a89e40415ea24998e6ba2430979476ed917",
|
||||
"acceptance_is_criterion_based": true
|
||||
},
|
||||
"QA_backup": {
|
||||
"at": "2026-10-11T14:24:27+00:00",
|
||||
"source": {
|
||||
"database": "stability_consumers_20261011_084534_test",
|
||||
"port": 55441
|
||||
},
|
||||
"restored": {
|
||||
"database": "functional_restore_20261011_142353_test",
|
||||
"port": 55441
|
||||
},
|
||||
"tables": 295,
|
||||
"sequences": 31,
|
||||
"files": 288,
|
||||
"dump_sha256": "30b495e372109f408223a107d81016ae05172ac82ffce0b3a3b344074644748d",
|
||||
"files_sha256": "f9806586595bd4728006b90bde8cea9b41d89e222a1bba9d9bdff5d810a7fc9a",
|
||||
"MFA_envelopes_readable": 17,
|
||||
"code_revision": "d19dd63b67b49d5ab8aea541dbebc8f9c12423e9895fe7f3d80da045e80be2cb",
|
||||
"acervo": {
|
||||
"all_referenced_QA_originals_included": true,
|
||||
"source_document": {
|
||||
"resource_id": 29,
|
||||
"document_id": "589ed9ac-967e-439e-9dde-b0fb3996e546",
|
||||
"sha256": "bf26caeee0437a8d292bf29be59247e2862c14e79b5ae465c00322747af72af5",
|
||||
"metadata_version": 3,
|
||||
"published": false
|
||||
},
|
||||
"lease_fixture": 54,
|
||||
"synthetic_QA_data_not_for_active_import": true,
|
||||
"lease_documents": [
|
||||
{
|
||||
"resource_id": "219a4ca3-911e-42d4-a958-7c76d6e6073a",
|
||||
"sha256": "0b88c46f0dfff9610c8dca5a0c9496a725474f6c1f6008130dae38a50fc0b60d",
|
||||
"malware_scan_status": "clean",
|
||||
"storage_encryption": "laravel"
|
||||
},
|
||||
{
|
||||
"resource_id": "a61f9a47-82a7-49cc-958e-edd115729333",
|
||||
"sha256": "af4b3f71a43131136d5f430089d03b77ff831664a91fa9d3fe11e849e5b04c45",
|
||||
"malware_scan_status": "clean",
|
||||
"storage_encryption": "laravel"
|
||||
},
|
||||
{
|
||||
"resource_id": "eb6803c3-497d-4d33-aa53-caf1c38b043c",
|
||||
"sha256": "fea263d1c028b60944d1961015f854040e56d581f1264fe63af750ca15804d39",
|
||||
"malware_scan_status": "clean",
|
||||
"storage_encryption": "laravel"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"destination_backup": {
|
||||
"at": "2026-10-11T14:24:45+00:00",
|
||||
"target": {
|
||||
"database": "investemoz",
|
||||
"port": 5432,
|
||||
"read_only": "on"
|
||||
},
|
||||
"restored_only_in_QA": {
|
||||
"database": "workflow_target_20261011_142421_test",
|
||||
"port": 55441
|
||||
},
|
||||
"tables": 288,
|
||||
"sequences": 31,
|
||||
"files": 799,
|
||||
"originals": 4,
|
||||
"MFA_envelopes_readable": 2,
|
||||
"dump_sha256": "c3c9477b089d33292d31ee0e053db55911f2f59febe31a25295bccb40fa9a883",
|
||||
"files_sha256": "1e1c2e4627b25e0fa05dc8b35a964d0c701f8532092ae2ac29a835ec8fa4c4a5",
|
||||
"candidate_code_revision": "d19dd63b67b49d5ab8aea541dbebc8f9c12423e9895fe7f3d80da045e80be2cb",
|
||||
"read_only_active": true,
|
||||
"installer_readiness": false
|
||||
},
|
||||
"COUNTRY02_compatibility": {
|
||||
"result": "passed",
|
||||
"at": "2026-10-11T14:23:01+00:00",
|
||||
"active_current_COUNTRY02_fingerprint": "162daff6ce08117582dd7d796639d02b156d1b940cd85ef3587ff88a65747edd",
|
||||
"candidate_COUNTRY02_fingerprint": "04672ef137a8e3fb819c63c281f13106af407534dd0f72a61a533e771649f605",
|
||||
"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
|
||||
},
|
||||
"destination_inventory": {
|
||||
"at": "2026-10-11T14:11:18+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
|
||||
},
|
||||
"activation_ready": false,
|
||||
"activation_authorized": false,
|
||||
"activation_blocks": [
|
||||
"ClamD destination signatures_stale; fresh real scan needed",
|
||||
"Destination supervised document/image worker/GD operation not demonstrated",
|
||||
"Final upgrade rehearsal of restored active target and scoped installer readiness/preview proofs needed",
|
||||
"Legitimate bootstrap holders and functional scopes not designated",
|
||||
"Administrative map geometry absent; separate authorization/import required if that display is included"
|
||||
],
|
||||
"restoration_decisions_pending": {
|
||||
"R-ARCHIVE": "Independent scoped Publisher with MFA/reason/audit -> needs_information nonpublic; explicit new submission/review/publication, no automatic republication",
|
||||
"R-DRAFT": "Author or authorized organization coeditor -> private draft only never submitted/published; reason/audit and original ID/history preserved"
|
||||
},
|
||||
"preserved": [
|
||||
"COUNTRY02 active/050000",
|
||||
"A/B and C37 closures",
|
||||
"five phases/19 existing stage numbering",
|
||||
"IDs/URLs/contracts/classifications/relations/originals/cipher/audit",
|
||||
"active TLS/session/services/code/database"
|
||||
],
|
||||
"audit_counts": {
|
||||
"requirements": 3401,
|
||||
"rows": 3401,
|
||||
"source_occurrences": 7739,
|
||||
"states": {
|
||||
"parcial": 3236,
|
||||
"não implementado": 152,
|
||||
"dependente de decisão concreta": 5,
|
||||
"implementado mas não ativado": 1,
|
||||
"concluído e demonstrado": 7
|
||||
},
|
||||
"updated_IDs": [
|
||||
"AUD-OP-01",
|
||||
"AUD-OP-02",
|
||||
"AUD-OP-03",
|
||||
"AUD-OP-04",
|
||||
"AUD-OPS-01",
|
||||
"AUD-PROFILE-07",
|
||||
"AUD-PROFILE-29",
|
||||
"AUD-PROFILE-31",
|
||||
"AUD-PROFILE-32",
|
||||
"AUD-UI-01"
|
||||
],
|
||||
"new_IDs": 0
|
||||
},
|
||||
"revision": "e871f8aadb59602dcfa5b1a5f4475d277c7e0b87ea2930fd5ad7af783e203b08",
|
||||
"sealed_at": "2026-10-11T14:31:06.516999+00:00"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"revision": "e871f8aadb59602dcfa5b1a5f4475d277c7e0b87ea2930fd5ad7af783e203b08",
|
||||
"code_revision": "d19dd63b67b49d5ab8aea541dbebc8f9c12423e9895fe7f3d80da045e80be2cb",
|
||||
"archive": "investmoz-workflow-e871f8aadb59.zip",
|
||||
"sha256": "df1cf028eb33936df74af4993fa4a31c0f4a6f19b8bb396b9108fe28b1b2fd42",
|
||||
"manifest_sha256": "fb6192f9bae79c0e4f7c9c52c28dd1794a008bf02acdc527161fa462f181aa62",
|
||||
"payload_files": 172,
|
||||
"members": 176,
|
||||
"activation_ready": false,
|
||||
"activation_authorized": false
|
||||
}
|
||||
+500
@@ -0,0 +1,500 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Opportunity;
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use Opis\JsonSchema\CompliantValidator;
|
||||
use Opis\JsonSchema\Errors\ErrorFormatter;
|
||||
use Opis\JsonSchema\Errors\ValidationError;
|
||||
|
||||
/** Explicit adapter of §25/26 to existing IDs and resource collections; never renumbers records. */
|
||||
class OpportunityCanonicalContract
|
||||
{
|
||||
public const BASE_CATEGORIES = ['investment_project', 'real_estate', 'land_rights', 'business_sale', 'business_partnership', 'franchise'];
|
||||
|
||||
/** Availability of this bounded base-category delivery, without rewriting existing contracts/data. */
|
||||
public function deliveryBlockers(array $payload): array
|
||||
{
|
||||
$errors = [];
|
||||
if (! in_array($payload['opportunity_category'] ?? '', self::BASE_CATEGORIES, true) && ! app(OpportunityModularProfiles::class)->enabled()) {
|
||||
$errors['canonical.opportunity_category'] = 'Categoria fora desta entrega: concessão, financiamento, fornecimento e outros permanecem indisponíveis. Os registos anteriores são preservados.';
|
||||
}
|
||||
if (($payload['opportunity_category'] ?? '') === 'real_estate') {
|
||||
$property = $payload['real_estate'] ?? [];
|
||||
foreach (['construction_status' => ['completed'], 'occupancy_status' => ['vacant'], 'transaction_type' => ['sale', 'lease']] as $field => $values) {
|
||||
if (! empty($property[$field]) && ! in_array($property[$field], $values, true)) {
|
||||
$errors['canonical.real_estate.'.$field] = 'Variante indisponível para submissão nesta entrega. Pode guardar e recuperar a preparação; estão incluídas venda e arrendamento de imóvel concluído e desocupado.';
|
||||
}
|
||||
}
|
||||
if (array_filter($property['encumbrances'] ?? [], fn ($row) => ! empty($row['type']) && $row['type'] !== 'none')) {
|
||||
$errors['canonical.real_estate.encumbrances'] = 'Imóvel com encargos: pode preparar e guardar; a submissão deste ramo não está incluída nesta entrega.';
|
||||
}
|
||||
if (! empty($property['max_built_area']) || ! empty($property['urban_limit_document_id'])) {
|
||||
$errors['canonical.real_estate.max_built_area'] = 'Limitações urbanísticas adicionais: preparação disponível; este ramo de submissão aguarda demonstração própria.';
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
public const VERSION = 'opportunity-canonical-adapter-20261010-semantic1';
|
||||
|
||||
/** @return array<string,mixed> */
|
||||
public function schema(bool $draft = false): array
|
||||
{
|
||||
$bytes = file_get_contents(resource_path('data/investmoz-opportunity-modular.schema.json'));
|
||||
if ($bytes === false) {
|
||||
throw new \RuntimeException('Opportunity schema unavailable.');
|
||||
}
|
||||
$schema = json_decode($bytes, true, 512, JSON_THROW_ON_ERROR);
|
||||
// The original conditions were omitted from the extracted Create/Patch definitions.
|
||||
foreach (['opportunity', 'realEstate', 'landRights', 'businessTransaction'] as $name) {
|
||||
$schema['$defs'][$name.'Create']['allOf'] = $schema['$defs'][$name]['allOf'] ?? [];
|
||||
}
|
||||
$schema = app(OpportunityCategoryFields::class)->enrich($schema);
|
||||
$schema = app(OpportunityModularProfiles::class)->extend($schema);
|
||||
$schema = $this->writeSchema($schema, $draft);
|
||||
$properties = &$schema['$defs']['opportunityCreate']['properties'];
|
||||
unset($properties['mutation_context']); // Actor, audit reason and revision are server-owned.
|
||||
$properties['sector_id'] = ['type' => 'integer', 'minimum' => 1];
|
||||
$properties['promoter_id'] = ['type' => ['string', 'integer']];
|
||||
// References point to the existing collections; their metadata is recovered on the server.
|
||||
foreach (['locations', 'documents', 'images'] as $field) {
|
||||
$properties[$field]['items'] = ['type' => 'string', 'format' => 'uuid'];
|
||||
}
|
||||
$properties['evidences'] = ['type' => 'array', 'items' => ['$ref' => '#/$defs/evidenceCreate']];
|
||||
if (! $draft) {
|
||||
$properties['evidences']['minItems'] = 1;
|
||||
}
|
||||
$properties['evidences']['items'] = ['type' => 'object', 'additionalProperties' => false,
|
||||
'properties' => ['title' => ['type' => 'string'], 'evidence_type' => ['type' => 'string'],
|
||||
'document_id' => ['type' => 'string', 'format' => 'uuid'], 'description' => ['type' => 'string']],
|
||||
...($draft ? [] : ['required' => ['title', 'evidence_type', 'document_id']])];
|
||||
$schema['$ref'] = '#/$defs/opportunityCreate';
|
||||
$schema['$id'] = 'urn:investmoz:'.self::VERSION.($draft ? ':draft' : ':submit');
|
||||
|
||||
return $schema;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string,mixed> $node
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
private function writeSchema(array $node, bool $draft): array
|
||||
{
|
||||
if (isset($node['$ref']) && preg_match('~^#/\$defs/(.+)$~', $node['$ref'], $match)) {
|
||||
// Collections in the normative Create still referenced response definitions.
|
||||
$defs = ['product', 'asset', 'input', 'market', 'impact', 'moneyItem', 'milestone', 'license', 'risk', 'relation', 'employment', 'environmentalSocial', 'localizedPublication', 'realEstate', 'landRights', 'businessTransaction', 'parcel', 'improvement', 'community'];
|
||||
if (in_array($match[1], $defs, true)) {
|
||||
$node['$ref'] .= 'Create';
|
||||
}
|
||||
}
|
||||
if ($draft) {
|
||||
unset($node['required'], $node['minItems'], $node['minProperties'], $node['contains'], $node['allOf']);
|
||||
if (isset($node['type'])) {
|
||||
$node['type'] = array_values(array_unique([...(array) $node['type'], 'null']));
|
||||
}
|
||||
if (isset($node['enum']) && ! in_array(null, $node['enum'], true)) {
|
||||
$node['enum'][] = null;
|
||||
}
|
||||
if (isset($node['minLength'])) {
|
||||
$node['minLength'] = 0;
|
||||
}
|
||||
if (($node['const'] ?? null) === true) {
|
||||
unset($node['const']);
|
||||
$node['type'] = 'boolean';
|
||||
}
|
||||
}
|
||||
foreach ($node as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
if (in_array($key, ['properties', '$defs'], true)) {
|
||||
foreach ($value as $name => $child) {
|
||||
$value[$name] = $this->writeSchema($child, $draft);
|
||||
}
|
||||
$node[$key] = $value;
|
||||
} elseif (in_array($key, ['items', 'if', 'then', 'else'], true)) {
|
||||
$node[$key] = $this->writeSchema($value, $draft);
|
||||
} elseif (in_array($key, ['allOf', 'oneOf', 'anyOf'], true)) {
|
||||
$node[$key] = array_map(fn ($child) => $this->writeSchema($child, $draft), $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $node;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string,mixed> $payload
|
||||
* @return array<string,mixed>
|
||||
*/
|
||||
public function draft(array $payload): array
|
||||
{
|
||||
abort_unless(config('portal.opportunity_specialized_drafts_enabled'), 422, 'Contrato especializado indisponível.');
|
||||
$this->validateSchema($payload, true);
|
||||
|
||||
return $payload;
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $payload */
|
||||
private function validateSchema(array $payload, bool $draft): void
|
||||
{
|
||||
$schema = $this->schema($draft);
|
||||
$validator = new CompliantValidator(null, 100, false);
|
||||
$data = $this->schemaData($payload, $schema['$defs']['opportunityCreate'], $schema['$defs']);
|
||||
$result = $validator->validate($data, json_decode(json_encode($schema, JSON_THROW_ON_ERROR)));
|
||||
if ($error = $result->error()) {
|
||||
$errors = [];
|
||||
foreach ((new ErrorFormatter)->format($error) as $path => $messages) {
|
||||
$errors['canonical'.str_replace('/', '.', $path)] = $messages;
|
||||
}
|
||||
$required = function (ValidationError $node) use (&$required, &$errors): void {
|
||||
if ($node->keyword() === 'required') {
|
||||
$prefix = 'canonical.'.implode('.', $node->data()->fullPath());
|
||||
foreach ($node->args()['missing'] ?? [] as $field) {
|
||||
$errors[rtrim($prefix, '.').'.'.$field] = ['Preencha este campo antes de submeter.'];
|
||||
}
|
||||
}
|
||||
foreach ($node->subErrors() as $child) {
|
||||
$required($child);
|
||||
}
|
||||
};
|
||||
$required($error);
|
||||
throw ValidationException::withMessages($errors);
|
||||
}
|
||||
}
|
||||
|
||||
/** @param array<string,mixed> $node
|
||||
* @param array<string,mixed> $defs
|
||||
*/
|
||||
private function schemaData(mixed $value, array $node, array $defs): mixed
|
||||
{
|
||||
if (isset($node['$ref'])) {
|
||||
$name = basename($node['$ref']);
|
||||
$node = $defs[$name] ?? $node;
|
||||
}
|
||||
if (! is_array($value)) {
|
||||
return $value;
|
||||
}
|
||||
if (in_array('object', (array) ($node['type'] ?? []), true) || isset($node['properties'])) {
|
||||
$result = new \stdClass;
|
||||
foreach ($value as $key => $item) {
|
||||
$result->{$key} = $this->schemaData($item, $node['properties'][$key] ?? [], $defs);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
return array_map(fn ($item) => $this->schemaData($item, $node['items'] ?? [], $defs), $value);
|
||||
}
|
||||
|
||||
/** @return array<string,mixed> */
|
||||
public function validateSubmission(Opportunity $record): array
|
||||
{
|
||||
$values = app(OpportunityManagement::class)->values($record);
|
||||
$payload = $values['canonical'] ?? [];
|
||||
$this->validateSchema($payload, false);
|
||||
$errors = [];
|
||||
$check = function (bool $valid, string $path, string $message) use (&$errors): void {
|
||||
if (! $valid) {
|
||||
$errors['canonical.'.$path] = $message;
|
||||
}
|
||||
};
|
||||
$check(($payload['opportunity_category'] ?? null) === $record->opportunity_category, 'opportunity_category', 'A categoria deve coincidir com o registo e a autorização.');
|
||||
$check(($payload['promoter_id'] ?? null) === ($record->organization_id ?? (int) $record->owner_user_id), 'promoter_id', '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,
|
||||
]))];
|
||||
}
|
||||
}
|
||||
+508
@@ -0,0 +1,508 @@
|
||||
<?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)) {
|
||||
$blockers = $this->contract->deliveryBlockers($this->management->values($record)['canonical'] ?? []);
|
||||
try {
|
||||
$snapshot = $this->contract->validateSubmission($record);
|
||||
} catch (ValidationException $error) {
|
||||
$errors = $error->errors();
|
||||
foreach ($blockers as $field => $message) {
|
||||
$errors[$field][] = $message;
|
||||
}
|
||||
throw ValidationException::withMessages($errors);
|
||||
}
|
||||
if ($blockers !== []) {
|
||||
throw ValidationException::withMessages($blockers);
|
||||
}
|
||||
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.'];
|
||||
}
|
||||
}
|
||||
+274
@@ -0,0 +1,274 @@
|
||||
<?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/VerifiedDocumentBinary.php'),
|
||||
app_path('Services/PortalProfileAdministration.php'), app_path('Services/PortalSuperusers.php'),
|
||||
app_path('Services/OpportunityProfileWorkflow.php'), app_path('Http/Controllers/PortalProfileController.php'), app_path('Http/Controllers/DashboardController.php'),
|
||||
app_path('Http/Controllers/OpportunityManagementController.php'),
|
||||
app_path('Services/OpportunityCanonicalContract.php'), app_path('Services/OpportunityCanonicalResponse.php'), app_path('Services/OpportunityCategoryFields.php'), app_path('Services/OpportunityModularProfiles.php'), app_path('Services/OpportunityWorkflowTasks.php'), base_path('composer.json'), base_path('composer.lock'),
|
||||
app_path('Services/OpportunityReviewMateriality.php'), app_path('Services/OpportunityReviewConditions.php'), app_path('Services/OpportunityCanonicalMetadata.php'), app_path('Services/OpportunityCompleteness.php'), app_path('Services/OpportunityCanonicalValue.php'),
|
||||
resource_path('data/investmoz-opportunity-modular.schema.json'), resource_path('js/components/opportunity-canonical-fields.tsx'), resource_path('js/components/opportunity-parcel-geometry.tsx'),
|
||||
app_path('Http/Controllers/OpportunityResourceController.php'),
|
||||
app_path('Http/Controllers/InvestmentTerritoryController.php'),
|
||||
app_path('Http/Middleware/PortalProfileSession.php'), app_path('Http/Middleware/ProtectProfileOpportunity.php'),
|
||||
app_path('Http/Middleware/ProtectPrivilegedIdentity.php'), app_path('Http/Middleware/EnsurePortalProfiles.php'),
|
||||
app_path('Http/Middleware/AuditProfileDecision.php'), app_path('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
|
||||
{
|
||||
$included = in_array($type, OpportunityCanonicalContract::BASE_CATEGORIES, true) || app(OpportunityModularProfiles::class)->enabled();
|
||||
|
||||
return $included && $this->available() && $this->scoped($actor, 'promoter', $organization, $type) && $this->operational($actor, 'create');
|
||||
}
|
||||
|
||||
public function legacyWriteAllowed(User $actor): bool
|
||||
{
|
||||
// A deliberate v1 assignment cannot use the old allowlist to bypass its scope.
|
||||
if (! $actor->can('manage-portal')) {
|
||||
return false;
|
||||
}
|
||||
if (! Schema::hasTable('portal_role_assignments')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Revocation/expiry must not silently restore an older, wider privilege.
|
||||
return ! DB::table('portal_role_assignments')->where('user_id', $actor->id)->exists()
|
||||
&& ! DB::table('portal_superuser_pair')->where(fn ($q) => $q->where('first_user_id', $actor->id)->orWhere('second_user_id', $actor->id))->exists()
|
||||
&& ! DB::table('portal_security_approvals')->where('kind', 'replacement')->whereNotNull('consumed_at')->where('scope->old_user_id', $actor->id)->exists();
|
||||
}
|
||||
|
||||
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 = [];
|
||||
$seen = [];
|
||||
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) {
|
||||
$key = ($grant->organization_id ?? 'individual').'|'.$type;
|
||||
if (! isset($seen[$key]) && $this->canCreate($actor, $grant->organization_id, $type)) {
|
||||
$contexts[] = ['organization_id' => $grant->organization_id, 'type' => $type];
|
||||
$seen[$key] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ['contexts' => $contexts, '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();
|
||||
}
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use Illuminate\Contracts\Encryption\DecryptException;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||
use Symfony\Component\HttpFoundation\HeaderUtils;
|
||||
|
||||
/** Authorization/publication stays with the consumer; originals share integrity and cipher handling. */
|
||||
class VerifiedDocumentBinary
|
||||
{
|
||||
public function respond(\stdClass $document, bool $inline = false): Response|BinaryFileResponse
|
||||
{
|
||||
$this->authorizeOpportunityAttachment($document);
|
||||
abort_unless($document->status === 'active' && $document->malware_scan_status === 'clean'
|
||||
&& ($document->deleted_at ?? null) === null && hash_equals(trim($document->sha256), trim((string) $document->malware_scanned_sha256)), 404);
|
||||
$disk = Storage::disk('local');
|
||||
$root = realpath($disk->path(''));
|
||||
$path = realpath($disk->path($document->storage_key));
|
||||
abort_unless($root && $path && str_starts_with(strtolower($path), strtolower($root.DIRECTORY_SEPARATOR)) && is_file($path), 404);
|
||||
$headers = ['X-Content-Type-Options' => 'nosniff', 'Cache-Control' => 'private, no-store'];
|
||||
if ($inline) {
|
||||
$headers['Content-Type'] = $document->media_type;
|
||||
$headers['Content-Security-Policy'] = "sandbox; default-src 'none'; style-src 'unsafe-inline'";
|
||||
}
|
||||
if (($document->storage_encryption ?? null) === 'laravel') {
|
||||
try {
|
||||
$bytes = Crypt::decryptString($disk->get($document->storage_key));
|
||||
} catch (DecryptException) {
|
||||
abort(404);
|
||||
}
|
||||
abort_unless(hash_equals(trim($document->sha256), hash('sha256', $bytes)), 404);
|
||||
$headers['Content-Type'] = $document->media_type;
|
||||
$headers['Content-Disposition'] = HeaderUtils::makeDisposition($inline ? 'inline' : 'attachment', basename($document->file_name), 'document');
|
||||
|
||||
return response($bytes, 200, $headers);
|
||||
}
|
||||
abort_unless(($document->storage_encryption ?? null) === null, 404);
|
||||
$checksum = hash_file('sha256', $path);
|
||||
abort_unless(is_string($checksum) && hash_equals(trim($document->sha256), $checksum), 404);
|
||||
|
||||
return $inline ? response()->file($path, $headers)->setContentDisposition('inline', basename($document->file_name)) : response()->download($path, basename($document->file_name), $headers);
|
||||
}
|
||||
|
||||
/** The general document route must not bypass the opportunity's current authorization. */
|
||||
private function authorizeOpportunityAttachment(\stdClass $document): void
|
||||
{
|
||||
$links = collect();
|
||||
foreach (['opportunity_documents', 'opportunity_images'] as $table) {
|
||||
if (! Schema::hasTable($table)) {
|
||||
continue;
|
||||
}
|
||||
$query = DB::table($table)->where('document_id', $document->id);
|
||||
if ($table === 'opportunity_images') {
|
||||
$query->orWhereRaw("payload->'derivatives' @> ?::jsonb", [json_encode([['document_id' => $document->id]], JSON_THROW_ON_ERROR)]);
|
||||
}
|
||||
$links = $links->concat($query->get(['opportunity_id', 'deleted_at']));
|
||||
}
|
||||
$privateOrigin = in_array($document->source_system ?? null, ['opportunity-resources', 'opportunity-image-derivatives'], true);
|
||||
if ($links->isEmpty() && ! $privateOrigin) {
|
||||
return; // Other consumers retain their own publication/authorization rules.
|
||||
}
|
||||
$actor = request()->user();
|
||||
abort_unless($actor instanceof \App\Models\User, 403, 'Anexo privado: é necessário acesso autorizado à oportunidade.');
|
||||
foreach ($links as $link) {
|
||||
$opportunity = \App\Models\Opportunity::find($link->opportunity_id);
|
||||
if ($link->deleted_at === null && $opportunity && $opportunity->status !== 'archived'
|
||||
&& app(PortalProfileAccess::class)->canView($actor, $opportunity)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
abort(403, 'O perfil atual não autoriza consultar este anexo da oportunidade.');
|
||||
}
|
||||
}
|
||||
+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-CdqBMdkz.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-CdqBMdkz.js";import{a,i as o,r as s}from"./shared-D-va8joy.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-DDFDWkxk.js";import{r as l}from"./investment-territory-CggzoPQh.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-DDFDWkxk.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-DDFDWkxk.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-DDFDWkxk.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-D-va8joy.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-DDFDWkxk.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-CbF7QAPJ.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-BVjVf9Ia.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-DDFDWkxk.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
@@ -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-Cj9EC3ob.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
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-CdqBMdkz.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-CdqBMdkz.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-D-va8joy.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{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-D-va8joy.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};
|
||||
+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-D-va8joy.js";import{Errors as a,labels as o}from"./shared-Cj9EC3ob.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};
|
||||
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-Bo2viMa_.js";import{t as a}from"./territory-geometry-preview-XD0LNOrx.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-D-va8joy.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