Compare commits

...
4 Commits
15 changed files with 1360 additions and 20 deletions
@@ -12882,5 +12882,659 @@
},
"authenticated_destination": "Fresh read confirmede3601c12;installer inactive",
"new_backup_restore": "Verified fresh backup and real isolated restore;no active restore performed"
},
"iva_l1_g6b_homologation_20261024": {
"status": "installed_delta_verified_partial_L1",
"candidate": "f75f36f0e36a5d9981f631b6e22f3c9e723ee454",
"base": "a23f1dcb",
"last_known_remote_main": "e3601c12",
"coverage": {
"AUD-SIM-L1-P055": "author_art_import",
"AUD-SIM-L1-P057": "fire_brigade_vehicle"
},
"runtime_delta": [
{
"path": "resources/js/lib/iva-import-exemptions.ts",
"sha256_LF": "af818d49abb78aaa5f271c686c74c5394472317c7a3ab5c23e9ea64b1b7d440c"
},
{
"path": "resources/js/components/simulation-import-exemptions.tsx",
"sha256_LF": "c78e55c1ca71d9d17bea0992d627264f4b96d5526e8db20339e6fa3419712eeb"
}
],
"counts_current": {
"delivered": 70,
"QA": 0,
"functional_pending": 62,
"documentary": 1,
"total": 133
},
"counts_after_delivery_only": {
"delivered": 70,
"QA": 0,
"functional_pending": 62,
"documentary": 1,
"total": 133
},
"proofs_reused": {
"frontend_new": 4,
"existing_import_suite": 5,
"frontend_total": 9,
"API_tests": 1,
"API_assertions": 23,
"QA_database": "simulator_fiscal_delta_20261021_test:55441",
"transaction_rollback": true,
"types": "passed",
"production_build": "passed;existing plugin warnings",
"QA_build": "passed;existing chunk warning",
"QA_storage": "save/recover/reject and UTF8 split-multibyte boundary passed;Buffer concatenation before decoding;temporary file only",
"UI": {
"actor": "Codex",
"method": "Edge/CUA observed",
"URL": "http://127.0.0.1:18643/g6b.html",
"observed": [
"unknown condition ->indeterminate",
"failed condition ->nonapplication,normal tax unknown",
"affirmative conditions ->exempt import VAT0.00",
"switch treatment ->only applicable questions;answers,document,2500MZN retained",
"save/recover/report ->P055/P057,Manica,2026-12,documents,sources",
"four previous UI results;20salesbooks,1purchase and1importbook identical"
],
"manual_Tempo_reply": null,
"screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g6b-imports-20261024\\qa-recovered-report.png",
"screenshot_sha256": "7f6ef7c5a3ee5aca026ad29279510b2ab9fa63d76d13b878007a5c58f4163a7e"
},
"Word_PDF": "Existing exporter proofs reused;no new pagination claim"
},
"rollback": "l1-g6b-readonly-rollback-20261024.patch checked;not applied",
"backup_restore": {
"backup": {
"stage": "/var/backups/investmoz-l1-g6b-delivery-20261024/backup",
"target": {
"database": "teste_investidor",
"port": 5432
},
"tables": 174,
"files_verified": 369,
"dump_sha256": "acfe60e926890eb240e3233cee37653bd207148ac7f554458a5845c690287897",
"files_sha256": "9b10a08af9f91965166c311b331a3c068af4fc737088ab529846f0a00a3231fb",
"restore_verified": false
},
"restore": {
"restore_verified": true,
"tables_verified": 174,
"container_network": "none",
"database": "l1_g6b_restore_20261024",
"port": 55441,
"source_dump_sha256": "acfe60e926890eb240e3233cee37653bd207148ac7f554458a5845c690287897",
"active_database_writes": 0
}
},
"activation": "Git FF/webhook/installer completed;zero migrations/imports",
"served_revision_and_delta": "verified",
"limits": "2026/MZN;classificação L1 de12(1)(j/l),sem direitosaduaneirosL13,dedução/campo11L2,baseaduaneira,taxa normal presumida,apuramento integral ou submissãoAT. P080/P084/P085 explicitamente abertos;L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.",
"L1_complete": false,
"P001": "05/06 only",
"beverages": "L2/L3;not closed",
"statistics_AI": "deferred",
"authenticated_preflight": {
"installed": {
"status": "installed",
"commit": "e3601c124d50fa2b52ea9d9fb86fbddf1d224d51",
"release": "/var/www/investmoz-homologacao/releases/e3601c124d50fa2b52ea9d9fb86fbddf1d224d51-b40b5ef1",
"previous_release": "/var/www/investmoz-homologacao/releases/6f056359df4231f9e1802922782b21263a8dae0b-5bf30d7b",
"database_migrations": 0,
"content_imports": 0
},
"current_link": "/var/www/investmoz-homologacao/releases/e3601c124d50fa2b52ea9d9fb86fbddf1d224d51-b40b5ef1",
"release_revision": {
"commit": "e3601c124d50fa2b52ea9d9fb86fbddf1d224d51",
"branch": "main",
"built_at": "2026-10-24T17:23:49.644454+00:00",
"manifest_sha256": "4972fe7be0ab6293c73e2d731084a6986079044fea4548e07d9537d4d3ca20f7"
},
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
"configuration_keys": [
"repository",
"branch",
"target_url",
"legacy_root",
"state_root",
"release_root",
"current_link",
"shared_assets",
"php",
"schema_contract",
"ci_environment",
"postgis_image",
"test_database",
"qa_port",
"retention",
"webhook_secret_file"
],
"safe_paths": {
"repository": "nala/Investidor-V2",
"release_root": "/var/www/investmoz-homologacao/releases",
"postgis_image": "postgis/postgis@sha256:01a6a70e41e6c4467c8f55f6063555ed72db2d6662cd0d571040d42eadaeb6f6"
},
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604"
},
"authenticated_destination": "Fresh read confirmede3601c12;installer inactive",
"new_backup_restore": "Verified fresh backup and real isolated restore;no active restore performed",
"beverages_followup": {
"source": "CIVA13(2),20(1)(d)",
"L2": "Dedução do IVA da via13(2),com montante/documento/condições próprios",
"L3": "Restituição da via13(2),conforme procedimento aplicável;pedido não equivale a deferimento",
"closed_by_G6B": false
},
"fresh_destination_preflight": "completed authenticatede3601c12 before installation;see authenticated_preflight",
"treatment": "P055/author_art_import,12(1)(j);P057/fire_brigade_vehicle,12(1)(l);classificação IVA na importação,sem direitosaduaneiros nem dedução/campo11",
"served_commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"installation": {
"protected": {
"installed": {
"status": "installed",
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"release": "/var/www/investmoz-homologacao/releases/4cebd617651ca877bd4715c661973873e69f05e1-f916c854",
"previous_release": "/var/www/investmoz-homologacao/releases/e3601c124d50fa2b52ea9d9fb86fbddf1d224d51-b40b5ef1",
"database_migrations": 0,
"content_imports": 0
},
"runtime_files_verified": 2,
"persistent_files_and_env_verified": 369,
"tables_compared": 174,
"changed_tables": {
"cache": {
"before": {
"rows": 105,
"checksum": "f2fce5ce32819b6c221a5104ee3f5608"
},
"after": {
"rows": 105,
"checksum": "26f89504af67b9996eef7792a6ccb0a3"
}
},
"sessions": {
"before": {
"rows": 32,
"checksum": "54b7fbc8bc6f9c17aff50ad13a817c34"
},
"after": {
"rows": 33,
"checksum": "0280882f0accf2401359095570a1e734"
}
}
},
"preserved_counts": {
"published_fiches": 29,
"relations": 28,
"geometries": 408
},
"migration_count": 0,
"content_imports": 0,
"comparison_role": "postgres_before_and_after;sameexportedsnapshotbaseline;noapplicationRLSvisibilityinference",
"writes_by_verification": 0
},
"public": {
"status": "installed_delta_verified",
"served_revision": {
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"branch": "main",
"built_at": "2026-10-24T17:36:44.073710+00:00",
"manifest_sha256": "820184910bf076609ce3c05dcc4995d0543ff5cbc672ca2fc3c73e856fdc1c97"
},
"manifest_hash_matches": true,
"compiled_delta_markers": {
"import-beneficiaries/1": [
"assets/project-dossier-tRE-vqtC.js"
],
"author_art_import": [
"assets/project-dossier-tRE-vqtC.js"
],
"fire_brigade_vehicle": [
"assets/project-dossier-tRE-vqtC.js"
],
"eligibleArtImporter": [
"assets/project-dossier-tRE-vqtC.js"
],
"exclusiveOwnUse": [
"assets/project-dossier-tRE-vqtC.js"
],
"12(1)(j/l)": [
"assets/project-dossier-tRE-vqtC.js"
]
},
"assets": [
{
"file": "assets/project-dossier-tRE-vqtC.js",
"status": 200,
"sha256": "1b2cc3687cb342676eb3e8bfa940863b3a2173dac95b8df47653f1b17d171a5c"
},
{
"file": "assets/simulation-form-CPZAFZU3.js",
"status": 200,
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
},
{
"file": "assets/project-dossier-document-CSZUuL22.js",
"status": 200,
"sha256": "ab39b32a9ef8cb4f8af02490ede1c1cab3c119d11fe699ad2f3fe4ccd0d5b54d"
},
{
"file": "assets/services-D5YnZvXr.js",
"status": 200,
"sha256": "a2257e2880d5e380e04bdfe1fd59bcb0e0a86946380340f898ed87e5840e35b0"
}
],
"simulator_status": 200,
"simulator_entry": "assets/app-6hf5mUzo.js",
"existing_fiscal_availability": {
"data": {
"enabled": true,
"coverage_start": "2026-01-01",
"coverage_end": "2026-12-31",
"message": "IVA geral sobre base líquida disponível; enquadramento declarado."
}
},
"synthetic_private_writes": 0,
"method": "Read-only installedrevision/manifest/newcompiledcatalogueandreaders/simulatorentry;acceptedQAproofsreused"
},
"installer": {
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
"installed": {
"status": "installed",
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"release": "/var/www/investmoz-homologacao/releases/4cebd617651ca877bd4715c661973873e69f05e1-f916c854",
"previous_release": "/var/www/investmoz-homologacao/releases/e3601c124d50fa2b52ea9d9fb86fbddf1d224d51-b40b5ef1",
"database_migrations": 0,
"content_imports": 0
},
"latest_report": {
"status": "installed",
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"release": "/var/www/investmoz-homologacao/releases/4cebd617651ca877bd4715c661973873e69f05e1-f916c854",
"previous_release": "/var/www/investmoz-homologacao/releases/e3601c124d50fa2b52ea9d9fb86fbddf1d224d51-b40b5ef1",
"database_migrations": 0,
"content_imports": 0,
"requested_commits": [
"4cebd617651ca877bd4715c661973873e69f05e1"
],
"finished_at": "2026-10-24T17:36:46.889389+00:00"
},
"log_file": "1792863315560969954.log",
"summaries": [
"OK (1 test, 3106 assertions)",
"built in 24.99s",
"OK (59 tests, 317 assertions)",
"# tests 309",
"# pass 309",
"# fail 0"
],
"log_bytes": 118487
},
"rollback_executed": false
}
},
"iva_l1_g6c_P053_P054_import_assets_QA_demonstrated_20261024": {
"key": "iva_l1_g6c_P053_P054_import_assets_QA_demonstrated_20261024",
"status": "demonstrated_QA_not_installed",
"candidate": "8e5565d5e0501ecd2a40ae684f4948b867308c54",
"base": "72e56f7a",
"homologation": "4cebd617/72e56f7a",
"group": "G6C",
"branches": {
"AUD-SIM-L1-P053": [
"eligible_ship_import",
"ship_operation_object_import"
],
"AUD-SIM-L1-P054": [
"eligible_aircraft_import",
"aircraft_operation_object_import"
]
},
"branch_count": 2,
"treatment_count": 4,
"source": {
"reference": "CIVA12(1)(h/i),Lei13/2016PDF11/p1426(269),by reference13(1)(f/g) and13(1)(c/d),PDF12/p1426(270);full-page visual proofs G6A/G4B reused;2022PDF2/p2252(26) and2025PDF13/p2180(13) retain h/i and do not change13",
"acceptance": "Tempo08/10/2026;no generic authenticity/legal revalidation",
"archive": [
{
"file": "docs\\investmoz\\simulations\\source-archive\\BR-16-I-Serie-2008-04-16.pdf",
"sha256": "fc373ff5637edf75ec6a9595dec8763a8503d4ee786e3b7d8f1c742eae9d80ee",
"pages": 28
},
{
"file": "docs\\investmoz\\simulations\\source-archive\\BR-248-I-Suplemento-1-2025.pdf",
"sha256": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251",
"pages": 21
},
{
"file": "docs\\investmoz\\simulations\\source-archive\\BR-89-I-Serie-2017-06-08.pdf",
"sha256": "11f0cab15eb6e51010952203ffa24fdc533a24fd642e19525fe4f46b17a1f5e5",
"pages": 16
},
{
"file": "docs\\investmoz\\simulations\\source-archive\\BR-95-I-Suplemento-2025-05-21.pdf",
"sha256": "e0e682e2c027c3cd9c1d46a73a3f48bc5f6bdbf05667fd97314d7a3f6a456358",
"pages": 2
},
{
"file": "docs\\investmoz\\simulations\\source-archive\\Lei-13-2016-CIVA-BR-156-10-suplemento.pdf",
"sha256": "b90dc7c14ecea2e378c4a62e8e5a47d54a5644c457baeb8b8053b92fd2a5710b",
"pages": 32
},
{
"file": "docs\\investmoz\\simulations\\source-archive\\Lei-22-2022-IVA-republicada-BR-250-2-suplemento.pdf",
"sha256": "ea1b0dc6f5cf6e595f6d9a19e7042f398999e0087caef1785f6e8fac571b5f53",
"pages": 18
}
],
"existing_corpus_references": [
"docs/investmoz/document-corpus-inventory-2026-10-06.csv",
"docs/investmoz/fiscal-source-references-2026-10-06.csv"
]
},
"preservation": {
"base": "72e56f7ae5b3c5d8c0f22b61778ec291b2bca2f6",
"delivered_ids": [
"AUD-SIM-L1-P003",
"AUD-SIM-L1-P004",
"AUD-SIM-L1-P005",
"AUD-SIM-L1-P006",
"AUD-SIM-L1-P007",
"AUD-SIM-L1-P008",
"AUD-SIM-L1-P009",
"AUD-SIM-L1-P010",
"AUD-SIM-L1-P011",
"AUD-SIM-L1-P012",
"AUD-SIM-L1-P013",
"AUD-SIM-L1-P014",
"AUD-SIM-L1-P015",
"AUD-SIM-L1-P016",
"AUD-SIM-L1-P017",
"AUD-SIM-L1-P018",
"AUD-SIM-L1-P019",
"AUD-SIM-L1-P020",
"AUD-SIM-L1-P021",
"AUD-SIM-L1-P022",
"AUD-SIM-L1-P023",
"AUD-SIM-L1-P024",
"AUD-SIM-L1-P025",
"AUD-SIM-L1-P026",
"AUD-SIM-L1-P027",
"AUD-SIM-L1-P028",
"AUD-SIM-L1-P029",
"AUD-SIM-L1-P030",
"AUD-SIM-L1-P031",
"AUD-SIM-L1-P032",
"AUD-SIM-L1-P033",
"AUD-SIM-L1-P034",
"AUD-SIM-L1-P035",
"AUD-SIM-L1-P036",
"AUD-SIM-L1-P037",
"AUD-SIM-L1-P038",
"AUD-SIM-L1-P039",
"AUD-SIM-L1-P040",
"AUD-SIM-L1-P041",
"AUD-SIM-L1-P042",
"AUD-SIM-L1-P043",
"AUD-SIM-L1-P044",
"AUD-SIM-L1-P045",
"AUD-SIM-L1-P049",
"AUD-SIM-L1-P051",
"AUD-SIM-L1-P055",
"AUD-SIM-L1-P057",
"AUD-SIM-L1-P061",
"AUD-SIM-L1-P062",
"AUD-SIM-L1-P063",
"AUD-SIM-L1-P064",
"AUD-SIM-L1-P065",
"AUD-SIM-L1-P066",
"AUD-SIM-L1-P067",
"AUD-SIM-L1-P068",
"AUD-SIM-L1-P069",
"AUD-SIM-L1-P070",
"AUD-SIM-L1-P071",
"AUD-SIM-L1-P072",
"AUD-SIM-L1-P073",
"AUD-SIM-L1-P074",
"AUD-SIM-L1-P075",
"AUD-SIM-L1-P076",
"AUD-SIM-L1-P077",
"AUD-SIM-L1-P078",
"AUD-SIM-L1-P079",
"AUD-SIM-L1-P081",
"AUD-SIM-L1-P082",
"AUD-SIM-L1-P083",
"AUD-SIM-L1-P086"
],
"confirmed_losses": [],
"accepted_active_receipt": "l1-g6b-delivery-20261024.json;4cebd617/72e56f7a;174tables/369files/29published/28relations/408geometries;no schema/content/permissions changes",
"frozen_fixture_sha256": "acbd2187c64bf4952b90117d247e5d8440b71cf094aad36ffe147e2098ef9d17",
"sales_books": 20,
"purchase_books": 1,
"import_books": 2,
"import_histories": {
"opportunity:330": 3,
"opportunity:331": 4
},
"preserved_open": [
"P080",
"P084",
"P085"
],
"counts": {
"delivered": 70,
"QA": 0,
"functional_pending": 62,
"documentary": 1,
"total": 133
}
},
"tests": {
"frontend_new": 4,
"existing_import_suites": 9,
"frontend_total": 13,
"API_tests": 1,
"API_assertions": 24,
"QA_database": "simulator_fiscal_delta_20261021_test:55441",
"transaction_rollback": true,
"types": "passed",
"production_build": "passed;existing plugin timing warnings",
"QA_build": "passed;existing chunk warning",
"QA_storage": "save/recover/reject and split-multibyte UTF8 boundary passed;inherited Buffer concatenation preserved",
"UI": {
"actor": "Codex",
"method": "Edge/CUA observed",
"URL": "http://127.0.0.1:18644/g6c.html",
"observed": [
"four treatments mapped to two IDs",
"object link unknown ->indeterminate;negative ->nonapplication;affirmative ->exempt0.00",
"switch object to principal aircraft ->own condition unknown,object response retained;return ->response restored",
"4000MZN/document/2026-12 conserved",
"save/recover/report ->P053/P054/four treatments,Manica,opportunity332,source12h/i and13f/g",
"four previous new-book UI results;all23acceptedbooks identical"
],
"manual_Tempo_reply": null,
"screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g6c-imports-20261024\\qa-recovered-report.png",
"screenshot_sha256": "d09a98c6a6c73a526c8803358eef6448cdc634a8a430c6ab8fe691ecdbd32bf4"
},
"Word_PDF": "Existing exporter proofs reused;no new pagination claim"
},
"implementation": {
"existing_snapshot_key": "importExemptions",
"no_schema_change": true,
"scoped_version": "import-assets/1 only for selected asset treatments;G6A/G6B keys/source remain unchanged",
"shared_definitions": "internationalShipEligibility/internationalAircraftEligibility export existing G4B strings without changing sale treatments",
"legacy_books": "20sales,1purchase and2importbooks identical/current without recalculation",
"history": "explicit classification archives previous result;edits keep earlier version",
"not_applicable_UI": "only conditions for selected principal asset/object;hidden answers retained",
"field11": "no deduction or ModeloA totals populated by classification",
"rollback": "l1-g6c-readonly-rollback-20261024.patch checked,not applied;readers/history/reports retained"
},
"counts": {
"delivered": 70,
"QA": 2,
"functional_pending": 60,
"documentary": 1,
"total": 133
},
"G6": {
"delivered": 4,
"QA": 2,
"functional_pending": 9
},
"limits": "2026/MZN;classificação12(1)(h/i),bem principal ou objecto da exploração identificado,sem baseaduaneira,direitosL13,dedução/campo11L2,taxa normal presumida,apuramento integral ou submissãoAT. Não encerraP052/abastecimentos. P080/P084/P085 explicitamente abertos;L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas."
},
"iva_l1_g6c_delivery_preparation_20261024": {
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
"candidate": "8e5565d5e0501ecd2a40ae684f4948b867308c54",
"base": "72e56f7a",
"last_known_remote_main": "4cebd617",
"coverage": {
"AUD-SIM-L1-P053": [
"eligible_ship_import",
"ship_operation_object_import"
],
"AUD-SIM-L1-P054": [
"eligible_aircraft_import",
"aircraft_operation_object_import"
]
},
"branch_count": 2,
"treatment_count": 4,
"runtime_delta": [
{
"path": "resources/js/lib/iva-import-exemptions.ts",
"sha256_LF": "6f35a4ee2e8a6a53e0d8313913914903ae48a5c685412a6df4aa44fe2d3ed2a6"
},
{
"path": "resources/js/lib/iva-international-assets.ts",
"sha256_LF": "b434f014e9165c44d4d1498f804f85dd5eaa7fc31409faebefd2267ba7a1a371"
},
{
"path": "resources/js/components/simulation-import-exemptions.tsx",
"sha256_LF": "d53931a3e30551ddac31f81de78220de2a5e269c71c213ca43d375e8e7fc3551"
}
],
"counts_current": {
"delivered": 70,
"QA": 2,
"functional_pending": 60,
"documentary": 1,
"total": 133
},
"counts_after_delivery_only": {
"delivered": 72,
"QA": 0,
"functional_pending": 60,
"documentary": 1,
"total": 133
},
"proofs_reused": {
"frontend_new": 4,
"existing_import_suites": 9,
"frontend_total": 13,
"API_tests": 1,
"API_assertions": 24,
"QA_database": "simulator_fiscal_delta_20261021_test:55441",
"transaction_rollback": true,
"types": "passed",
"production_build": "passed;existing plugin timing warnings",
"QA_build": "passed;existing chunk warning",
"QA_storage": "save/recover/reject and split-multibyte UTF8 boundary passed;inherited Buffer concatenation preserved",
"UI": {
"actor": "Codex",
"method": "Edge/CUA observed",
"URL": "http://127.0.0.1:18644/g6c.html",
"observed": [
"four treatments mapped to two IDs",
"object link unknown ->indeterminate;negative ->nonapplication;affirmative ->exempt0.00",
"switch object to principal aircraft ->own condition unknown,object response retained;return ->response restored",
"4000MZN/document/2026-12 conserved",
"save/recover/report ->P053/P054/four treatments,Manica,opportunity332,source12h/i and13f/g",
"four previous new-book UI results;all23acceptedbooks identical"
],
"manual_Tempo_reply": null,
"screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g6c-imports-20261024\\qa-recovered-report.png",
"screenshot_sha256": "d09a98c6a6c73a526c8803358eef6448cdc634a8a430c6ab8fe691ecdbd32bf4"
},
"Word_PDF": "Existing exporter proofs reused;no new pagination claim"
},
"rollback": "l1-g6c-readonly-rollback-20261024.patch checked;not applied",
"backup_restore": {
"backup": {
"stage": "/var/backups/investmoz-l1-g6c-delivery-20261024/backup",
"target": {
"database": "teste_investidor",
"port": 5432
},
"tables": 174,
"files_verified": 369,
"dump_sha256": "c036d0f4c188fcd1392c1ee0140fd1d41239151bab116647e3ed71e2ba6a50ea",
"files_sha256": "3d13cca301ab91abf29848b522a19316dea284bc5d9e41ae8b88971866401ac7",
"restore_verified": false
},
"restore": {
"restore_verified": true,
"tables_verified": 174,
"container_network": "none",
"database": "l1_g6c_restore_20261024",
"port": 55441,
"source_dump_sha256": "c036d0f4c188fcd1392c1ee0140fd1d41239151bab116647e3ed71e2ba6a50ea",
"active_database_writes": 0
}
},
"activation": "Existing normal Git FF/webhook/installer;no push or installation in QA passage",
"served_revision_and_delta": "pending delivery;homologation remains4cebd617",
"limits": "2026/MZN;classificação12(1)(h/i),bem principal ou objecto da exploração identificado,sem baseaduaneira,direitosL13,dedução/campo11L2,taxa normal presumida,apuramento integral ou submissãoAT. Não encerraP052/abastecimentos. P080/P084/P085 explicitamente abertos;L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.",
"L1_complete": false,
"P001": "05/06 only",
"beverages": "L2/L3;not closed",
"statistics_AI": "deferred",
"authenticated_preflight": {
"installed": {
"status": "installed",
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"release": "/var/www/investmoz-homologacao/releases/4cebd617651ca877bd4715c661973873e69f05e1-f916c854",
"previous_release": "/var/www/investmoz-homologacao/releases/e3601c124d50fa2b52ea9d9fb86fbddf1d224d51-b40b5ef1",
"database_migrations": 0,
"content_imports": 0
},
"current_link": "/var/www/investmoz-homologacao/releases/4cebd617651ca877bd4715c661973873e69f05e1-f916c854",
"release_revision": {
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"branch": "main",
"built_at": "2026-10-24T17:36:44.073710+00:00",
"manifest_sha256": "820184910bf076609ce3c05dcc4995d0543ff5cbc672ca2fc3c73e856fdc1c97"
},
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
"configuration_keys": [
"repository",
"branch",
"target_url",
"legacy_root",
"state_root",
"release_root",
"current_link",
"shared_assets",
"php",
"schema_contract",
"ci_environment",
"postgis_image",
"test_database",
"qa_port",
"retention",
"webhook_secret_file"
],
"safe_paths": {
"repository": "nala/Investidor-V2",
"release_root": "/var/www/investmoz-homologacao/releases",
"postgis_image": "postgis/postgis@sha256:01a6a70e41e6c4467c8f55f6063555ed72db2d6662cd0d571040d42eadaeb6f6"
},
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604"
},
"authenticated_destination": "Fresh read confirmed4cebd617;installer inactive",
"new_backup_restore": "Verified fresh backup and real isolated restore;no active restore performed"
}
}
@@ -1,6 +1,6 @@
{
"key": "iva_l1_g6b_P055_P057_import_exemptions_QA_demonstrated_20261024",
"status": "demonstrated_QA_not_installed",
"status": "delivered_with_QA_proofs_preserved",
"candidate": "f75f36f0e36a5d9981f631b6e22f3c9e723ee454",
"base": "a23f1dcb",
"homologation": "e3601c12/a23f1dcb",
@@ -184,15 +184,15 @@
"roll_back": "l1-g6b-readonly-rollback-20261024.patch checked,not applied;readers/history/reports retained"
},
"counts": {
"delivered": 68,
"QA": 2,
"delivered": 70,
"QA": 0,
"functional_pending": 62,
"documentary": 1,
"total": 133
},
"G6": {
"delivered": 2,
"QA": 2,
"delivered": 4,
"QA": 0,
"functional_pending": 11
},
"limits": "2026/MZN;classificação L1 de12(1)(j/l),sem direitosaduaneirosL13,dedução/campo11L2,baseaduaneira,taxa normal presumida,apuramento integral ou submissãoAT. P080/P084/P085 explicitamente abertos;L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.",
@@ -203,5 +203,18 @@
"fix": "Concatenate buffers before UTF8 decoding;boundary regression test passed",
"verification": "Reset from exact private API recovery via explicit QA button;save/recover/report repeated;all20sales+1purchase+1importbooks identical to frozen baseline",
"helper_sha256": "3cbaac752269c91c6675a10e95646292cc8191949c23700b37805ed46a49672f"
},
"qa_acceptance_status": "demonstrated_QA_not_installed",
"qa_acceptance_counts": {
"delivered": 68,
"QA": 2,
"functional_pending": 62,
"documentary": 1,
"total": 133
},
"delivery_followup": {
"served_commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"record": "iva_l1_g6b_homologation_20261024",
"receipt": "l1-g6b-delivery-20261024.json"
}
}
@@ -0,0 +1,211 @@
{
"key": "iva_l1_g6c_P053_P054_import_assets_QA_demonstrated_20261024",
"status": "demonstrated_QA_not_installed",
"candidate": "8e5565d5e0501ecd2a40ae684f4948b867308c54",
"base": "72e56f7a",
"homologation": "4cebd617/72e56f7a",
"group": "G6C",
"branches": {
"AUD-SIM-L1-P053": [
"eligible_ship_import",
"ship_operation_object_import"
],
"AUD-SIM-L1-P054": [
"eligible_aircraft_import",
"aircraft_operation_object_import"
]
},
"branch_count": 2,
"treatment_count": 4,
"source": {
"reference": "CIVA12(1)(h/i),Lei13/2016PDF11/p1426(269),by reference13(1)(f/g) and13(1)(c/d),PDF12/p1426(270);full-page visual proofs G6A/G4B reused;2022PDF2/p2252(26) and2025PDF13/p2180(13) retain h/i and do not change13",
"acceptance": "Tempo08/10/2026;no generic authenticity/legal revalidation",
"archive": [
{
"file": "docs\\investmoz\\simulations\\source-archive\\BR-16-I-Serie-2008-04-16.pdf",
"sha256": "fc373ff5637edf75ec6a9595dec8763a8503d4ee786e3b7d8f1c742eae9d80ee",
"pages": 28
},
{
"file": "docs\\investmoz\\simulations\\source-archive\\BR-248-I-Suplemento-1-2025.pdf",
"sha256": "ccf2a8deeca820f2dd076b4b2141b1efe3f6a806568c3a587ca59a8e92f4c251",
"pages": 21
},
{
"file": "docs\\investmoz\\simulations\\source-archive\\BR-89-I-Serie-2017-06-08.pdf",
"sha256": "11f0cab15eb6e51010952203ffa24fdc533a24fd642e19525fe4f46b17a1f5e5",
"pages": 16
},
{
"file": "docs\\investmoz\\simulations\\source-archive\\BR-95-I-Suplemento-2025-05-21.pdf",
"sha256": "e0e682e2c027c3cd9c1d46a73a3f48bc5f6bdbf05667fd97314d7a3f6a456358",
"pages": 2
},
{
"file": "docs\\investmoz\\simulations\\source-archive\\Lei-13-2016-CIVA-BR-156-10-suplemento.pdf",
"sha256": "b90dc7c14ecea2e378c4a62e8e5a47d54a5644c457baeb8b8053b92fd2a5710b",
"pages": 32
},
{
"file": "docs\\investmoz\\simulations\\source-archive\\Lei-22-2022-IVA-republicada-BR-250-2-suplemento.pdf",
"sha256": "ea1b0dc6f5cf6e595f6d9a19e7042f398999e0087caef1785f6e8fac571b5f53",
"pages": 18
}
],
"existing_corpus_references": [
"docs/investmoz/document-corpus-inventory-2026-10-06.csv",
"docs/investmoz/fiscal-source-references-2026-10-06.csv"
]
},
"preservation": {
"base": "72e56f7ae5b3c5d8c0f22b61778ec291b2bca2f6",
"delivered_ids": [
"AUD-SIM-L1-P003",
"AUD-SIM-L1-P004",
"AUD-SIM-L1-P005",
"AUD-SIM-L1-P006",
"AUD-SIM-L1-P007",
"AUD-SIM-L1-P008",
"AUD-SIM-L1-P009",
"AUD-SIM-L1-P010",
"AUD-SIM-L1-P011",
"AUD-SIM-L1-P012",
"AUD-SIM-L1-P013",
"AUD-SIM-L1-P014",
"AUD-SIM-L1-P015",
"AUD-SIM-L1-P016",
"AUD-SIM-L1-P017",
"AUD-SIM-L1-P018",
"AUD-SIM-L1-P019",
"AUD-SIM-L1-P020",
"AUD-SIM-L1-P021",
"AUD-SIM-L1-P022",
"AUD-SIM-L1-P023",
"AUD-SIM-L1-P024",
"AUD-SIM-L1-P025",
"AUD-SIM-L1-P026",
"AUD-SIM-L1-P027",
"AUD-SIM-L1-P028",
"AUD-SIM-L1-P029",
"AUD-SIM-L1-P030",
"AUD-SIM-L1-P031",
"AUD-SIM-L1-P032",
"AUD-SIM-L1-P033",
"AUD-SIM-L1-P034",
"AUD-SIM-L1-P035",
"AUD-SIM-L1-P036",
"AUD-SIM-L1-P037",
"AUD-SIM-L1-P038",
"AUD-SIM-L1-P039",
"AUD-SIM-L1-P040",
"AUD-SIM-L1-P041",
"AUD-SIM-L1-P042",
"AUD-SIM-L1-P043",
"AUD-SIM-L1-P044",
"AUD-SIM-L1-P045",
"AUD-SIM-L1-P049",
"AUD-SIM-L1-P051",
"AUD-SIM-L1-P055",
"AUD-SIM-L1-P057",
"AUD-SIM-L1-P061",
"AUD-SIM-L1-P062",
"AUD-SIM-L1-P063",
"AUD-SIM-L1-P064",
"AUD-SIM-L1-P065",
"AUD-SIM-L1-P066",
"AUD-SIM-L1-P067",
"AUD-SIM-L1-P068",
"AUD-SIM-L1-P069",
"AUD-SIM-L1-P070",
"AUD-SIM-L1-P071",
"AUD-SIM-L1-P072",
"AUD-SIM-L1-P073",
"AUD-SIM-L1-P074",
"AUD-SIM-L1-P075",
"AUD-SIM-L1-P076",
"AUD-SIM-L1-P077",
"AUD-SIM-L1-P078",
"AUD-SIM-L1-P079",
"AUD-SIM-L1-P081",
"AUD-SIM-L1-P082",
"AUD-SIM-L1-P083",
"AUD-SIM-L1-P086"
],
"confirmed_losses": [],
"accepted_active_receipt": "l1-g6b-delivery-20261024.json;4cebd617/72e56f7a;174tables/369files/29published/28relations/408geometries;no schema/content/permissions changes",
"frozen_fixture_sha256": "acbd2187c64bf4952b90117d247e5d8440b71cf094aad36ffe147e2098ef9d17",
"sales_books": 20,
"purchase_books": 1,
"import_books": 2,
"import_histories": {
"opportunity:330": 3,
"opportunity:331": 4
},
"preserved_open": [
"P080",
"P084",
"P085"
],
"counts": {
"delivered": 70,
"QA": 0,
"functional_pending": 62,
"documentary": 1,
"total": 133
}
},
"tests": {
"frontend_new": 4,
"existing_import_suites": 9,
"frontend_total": 13,
"API_tests": 1,
"API_assertions": 24,
"QA_database": "simulator_fiscal_delta_20261021_test:55441",
"transaction_rollback": true,
"types": "passed",
"production_build": "passed;existing plugin timing warnings",
"QA_build": "passed;existing chunk warning",
"QA_storage": "save/recover/reject and split-multibyte UTF8 boundary passed;inherited Buffer concatenation preserved",
"UI": {
"actor": "Codex",
"method": "Edge/CUA observed",
"URL": "http://127.0.0.1:18644/g6c.html",
"observed": [
"four treatments mapped to two IDs",
"object link unknown ->indeterminate;negative ->nonapplication;affirmative ->exempt0.00",
"switch object to principal aircraft ->own condition unknown,object response retained;return ->response restored",
"4000MZN/document/2026-12 conserved",
"save/recover/report ->P053/P054/four treatments,Manica,opportunity332,source12h/i and13f/g",
"four previous new-book UI results;all23acceptedbooks identical"
],
"manual_Tempo_reply": null,
"screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g6c-imports-20261024\\qa-recovered-report.png",
"screenshot_sha256": "d09a98c6a6c73a526c8803358eef6448cdc634a8a430c6ab8fe691ecdbd32bf4"
},
"Word_PDF": "Existing exporter proofs reused;no new pagination claim"
},
"implementation": {
"existing_snapshot_key": "importExemptions",
"no_schema_change": true,
"scoped_version": "import-assets/1 only for selected asset treatments;G6A/G6B keys/source remain unchanged",
"shared_definitions": "internationalShipEligibility/internationalAircraftEligibility export existing G4B strings without changing sale treatments",
"legacy_books": "20sales,1purchase and2importbooks identical/current without recalculation",
"history": "explicit classification archives previous result;edits keep earlier version",
"not_applicable_UI": "only conditions for selected principal asset/object;hidden answers retained",
"field11": "no deduction or ModeloA totals populated by classification",
"rollback": "l1-g6c-readonly-rollback-20261024.patch checked,not applied;readers/history/reports retained"
},
"counts": {
"delivered": 70,
"QA": 2,
"functional_pending": 60,
"documentary": 1,
"total": 133
},
"G6": {
"delivered": 4,
"QA": 2,
"functional_pending": 9
},
"limits": "2026/MZN;classificação12(1)(h/i),bem principal ou objecto da exploração identificado,sem baseaduaneira,direitosL13,dedução/campo11L2,taxa normal presumida,apuramento integral ou submissãoAT. Não encerraP052/abastecimentos. P080/P084/P085 explicitamente abertos;L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas."
}
@@ -1,5 +1,5 @@
{
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
"status": "installed_delta_verified_partial_L1",
"candidate": "f75f36f0e36a5d9981f631b6e22f3c9e723ee454",
"base": "a23f1dcb",
"last_known_remote_main": "e3601c12",
@@ -18,8 +18,8 @@
}
],
"counts_current": {
"delivered": 68,
"QA": 2,
"delivered": 70,
"QA": 0,
"functional_pending": 62,
"documentary": 1,
"total": 133
@@ -85,8 +85,8 @@
"active_database_writes": 0
}
},
"activation": "Existing normal Git FF/webhook/installer;no push or installation in QA passage",
"served_revision_and_delta": "pending delivery;homologation remainse3601c12",
"activation": "Git FF/webhook/installer completed;zero migrations/imports",
"served_revision_and_delta": "verified",
"limits": "2026/MZN;classificação L1 de12(1)(j/l),sem direitosaduaneirosL13,dedução/campo11L2,baseaduaneira,taxa normal presumida,apuramento integral ou submissãoAT. P080/P084/P085 explicitamente abertos;L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.",
"L1_complete": false,
"P001": "05/06 only",
@@ -135,5 +135,158 @@
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604"
},
"authenticated_destination": "Fresh read confirmede3601c12;installer inactive",
"new_backup_restore": "Verified fresh backup and real isolated restore;no active restore performed"
"new_backup_restore": "Verified fresh backup and real isolated restore;no active restore performed",
"beverages_followup": {
"source": "CIVA13(2),20(1)(d)",
"L2": "Dedução do IVA da via13(2),com montante/documento/condições próprios",
"L3": "Restituição da via13(2),conforme procedimento aplicável;pedido não equivale a deferimento",
"closed_by_G6B": false
},
"fresh_destination_preflight": "completed authenticatede3601c12 before installation;see authenticated_preflight",
"treatment": "P055/author_art_import,12(1)(j);P057/fire_brigade_vehicle,12(1)(l);classificação IVA na importação,sem direitosaduaneiros nem dedução/campo11",
"served_commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"installation": {
"protected": {
"installed": {
"status": "installed",
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"release": "/var/www/investmoz-homologacao/releases/4cebd617651ca877bd4715c661973873e69f05e1-f916c854",
"previous_release": "/var/www/investmoz-homologacao/releases/e3601c124d50fa2b52ea9d9fb86fbddf1d224d51-b40b5ef1",
"database_migrations": 0,
"content_imports": 0
},
"runtime_files_verified": 2,
"persistent_files_and_env_verified": 369,
"tables_compared": 174,
"changed_tables": {
"cache": {
"before": {
"rows": 105,
"checksum": "f2fce5ce32819b6c221a5104ee3f5608"
},
"after": {
"rows": 105,
"checksum": "26f89504af67b9996eef7792a6ccb0a3"
}
},
"sessions": {
"before": {
"rows": 32,
"checksum": "54b7fbc8bc6f9c17aff50ad13a817c34"
},
"after": {
"rows": 33,
"checksum": "0280882f0accf2401359095570a1e734"
}
}
},
"preserved_counts": {
"published_fiches": 29,
"relations": 28,
"geometries": 408
},
"migration_count": 0,
"content_imports": 0,
"comparison_role": "postgres_before_and_after;sameexportedsnapshotbaseline;noapplicationRLSvisibilityinference",
"writes_by_verification": 0
},
"public": {
"status": "installed_delta_verified",
"served_revision": {
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"branch": "main",
"built_at": "2026-10-24T17:36:44.073710+00:00",
"manifest_sha256": "820184910bf076609ce3c05dcc4995d0543ff5cbc672ca2fc3c73e856fdc1c97"
},
"manifest_hash_matches": true,
"compiled_delta_markers": {
"import-beneficiaries/1": [
"assets/project-dossier-tRE-vqtC.js"
],
"author_art_import": [
"assets/project-dossier-tRE-vqtC.js"
],
"fire_brigade_vehicle": [
"assets/project-dossier-tRE-vqtC.js"
],
"eligibleArtImporter": [
"assets/project-dossier-tRE-vqtC.js"
],
"exclusiveOwnUse": [
"assets/project-dossier-tRE-vqtC.js"
],
"12(1)(j/l)": [
"assets/project-dossier-tRE-vqtC.js"
]
},
"assets": [
{
"file": "assets/project-dossier-tRE-vqtC.js",
"status": 200,
"sha256": "1b2cc3687cb342676eb3e8bfa940863b3a2173dac95b8df47653f1b17d171a5c"
},
{
"file": "assets/simulation-form-CPZAFZU3.js",
"status": 200,
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
},
{
"file": "assets/project-dossier-document-CSZUuL22.js",
"status": 200,
"sha256": "ab39b32a9ef8cb4f8af02490ede1c1cab3c119d11fe699ad2f3fe4ccd0d5b54d"
},
{
"file": "assets/services-D5YnZvXr.js",
"status": 200,
"sha256": "a2257e2880d5e380e04bdfe1fd59bcb0e0a86946380340f898ed87e5840e35b0"
}
],
"simulator_status": 200,
"simulator_entry": "assets/app-6hf5mUzo.js",
"existing_fiscal_availability": {
"data": {
"enabled": true,
"coverage_start": "2026-01-01",
"coverage_end": "2026-12-31",
"message": "IVA geral sobre base líquida disponível; enquadramento declarado."
}
},
"synthetic_private_writes": 0,
"method": "Read-only installedrevision/manifest/newcompiledcatalogueandreaders/simulatorentry;acceptedQAproofsreused"
},
"installer": {
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
"installed": {
"status": "installed",
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"release": "/var/www/investmoz-homologacao/releases/4cebd617651ca877bd4715c661973873e69f05e1-f916c854",
"previous_release": "/var/www/investmoz-homologacao/releases/e3601c124d50fa2b52ea9d9fb86fbddf1d224d51-b40b5ef1",
"database_migrations": 0,
"content_imports": 0
},
"latest_report": {
"status": "installed",
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"release": "/var/www/investmoz-homologacao/releases/4cebd617651ca877bd4715c661973873e69f05e1-f916c854",
"previous_release": "/var/www/investmoz-homologacao/releases/e3601c124d50fa2b52ea9d9fb86fbddf1d224d51-b40b5ef1",
"database_migrations": 0,
"content_imports": 0,
"requested_commits": [
"4cebd617651ca877bd4715c661973873e69f05e1"
],
"finished_at": "2026-10-24T17:36:46.889389+00:00"
},
"log_file": "1792863315560969954.log",
"summaries": [
"OK (1 test, 3106 assertions)",
"built in 24.99s",
"OK (59 tests, 317 assertions)",
"# tests 309",
"# pass 309",
"# fail 0"
],
"log_bytes": 118487
},
"rollback_executed": false
}
}
@@ -0,0 +1,151 @@
{
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
"candidate": "8e5565d5e0501ecd2a40ae684f4948b867308c54",
"base": "72e56f7a",
"last_known_remote_main": "4cebd617",
"coverage": {
"AUD-SIM-L1-P053": [
"eligible_ship_import",
"ship_operation_object_import"
],
"AUD-SIM-L1-P054": [
"eligible_aircraft_import",
"aircraft_operation_object_import"
]
},
"branch_count": 2,
"treatment_count": 4,
"runtime_delta": [
{
"path": "resources/js/lib/iva-import-exemptions.ts",
"sha256_LF": "6f35a4ee2e8a6a53e0d8313913914903ae48a5c685412a6df4aa44fe2d3ed2a6"
},
{
"path": "resources/js/lib/iva-international-assets.ts",
"sha256_LF": "b434f014e9165c44d4d1498f804f85dd5eaa7fc31409faebefd2267ba7a1a371"
},
{
"path": "resources/js/components/simulation-import-exemptions.tsx",
"sha256_LF": "d53931a3e30551ddac31f81de78220de2a5e269c71c213ca43d375e8e7fc3551"
}
],
"counts_current": {
"delivered": 70,
"QA": 2,
"functional_pending": 60,
"documentary": 1,
"total": 133
},
"counts_after_delivery_only": {
"delivered": 72,
"QA": 0,
"functional_pending": 60,
"documentary": 1,
"total": 133
},
"proofs_reused": {
"frontend_new": 4,
"existing_import_suites": 9,
"frontend_total": 13,
"API_tests": 1,
"API_assertions": 24,
"QA_database": "simulator_fiscal_delta_20261021_test:55441",
"transaction_rollback": true,
"types": "passed",
"production_build": "passed;existing plugin timing warnings",
"QA_build": "passed;existing chunk warning",
"QA_storage": "save/recover/reject and split-multibyte UTF8 boundary passed;inherited Buffer concatenation preserved",
"UI": {
"actor": "Codex",
"method": "Edge/CUA observed",
"URL": "http://127.0.0.1:18644/g6c.html",
"observed": [
"four treatments mapped to two IDs",
"object link unknown ->indeterminate;negative ->nonapplication;affirmative ->exempt0.00",
"switch object to principal aircraft ->own condition unknown,object response retained;return ->response restored",
"4000MZN/document/2026-12 conserved",
"save/recover/report ->P053/P054/four treatments,Manica,opportunity332,source12h/i and13f/g",
"four previous new-book UI results;all23acceptedbooks identical"
],
"manual_Tempo_reply": null,
"screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g6c-imports-20261024\\qa-recovered-report.png",
"screenshot_sha256": "d09a98c6a6c73a526c8803358eef6448cdc634a8a430c6ab8fe691ecdbd32bf4"
},
"Word_PDF": "Existing exporter proofs reused;no new pagination claim"
},
"rollback": "l1-g6c-readonly-rollback-20261024.patch checked;not applied",
"backup_restore": {
"backup": {
"stage": "/var/backups/investmoz-l1-g6c-delivery-20261024/backup",
"target": {
"database": "teste_investidor",
"port": 5432
},
"tables": 174,
"files_verified": 369,
"dump_sha256": "c036d0f4c188fcd1392c1ee0140fd1d41239151bab116647e3ed71e2ba6a50ea",
"files_sha256": "3d13cca301ab91abf29848b522a19316dea284bc5d9e41ae8b88971866401ac7",
"restore_verified": false
},
"restore": {
"restore_verified": true,
"tables_verified": 174,
"container_network": "none",
"database": "l1_g6c_restore_20261024",
"port": 55441,
"source_dump_sha256": "c036d0f4c188fcd1392c1ee0140fd1d41239151bab116647e3ed71e2ba6a50ea",
"active_database_writes": 0
}
},
"activation": "Existing normal Git FF/webhook/installer;no push or installation in QA passage",
"served_revision_and_delta": "pending delivery;homologation remains4cebd617",
"limits": "2026/MZN;classificação12(1)(h/i),bem principal ou objecto da exploração identificado,sem baseaduaneira,direitosL13,dedução/campo11L2,taxa normal presumida,apuramento integral ou submissãoAT. Não encerraP052/abastecimentos. P080/P084/P085 explicitamente abertos;L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.",
"L1_complete": false,
"P001": "05/06 only",
"beverages": "L2/L3;not closed",
"statistics_AI": "deferred",
"authenticated_preflight": {
"installed": {
"status": "installed",
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"release": "/var/www/investmoz-homologacao/releases/4cebd617651ca877bd4715c661973873e69f05e1-f916c854",
"previous_release": "/var/www/investmoz-homologacao/releases/e3601c124d50fa2b52ea9d9fb86fbddf1d224d51-b40b5ef1",
"database_migrations": 0,
"content_imports": 0
},
"current_link": "/var/www/investmoz-homologacao/releases/4cebd617651ca877bd4715c661973873e69f05e1-f916c854",
"release_revision": {
"commit": "4cebd617651ca877bd4715c661973873e69f05e1",
"branch": "main",
"built_at": "2026-10-24T17:36:44.073710+00:00",
"manifest_sha256": "820184910bf076609ce3c05dcc4995d0543ff5cbc672ca2fc3c73e856fdc1c97"
},
"service": "ExecMainStatus=0\nActiveState=inactive\nSubState=dead\n",
"configuration_keys": [
"repository",
"branch",
"target_url",
"legacy_root",
"state_root",
"release_root",
"current_link",
"shared_assets",
"php",
"schema_contract",
"ci_environment",
"postgis_image",
"test_database",
"qa_port",
"retention",
"webhook_secret_file"
],
"safe_paths": {
"repository": "nala/Investidor-V2",
"release_root": "/var/www/investmoz-homologacao/releases",
"postgis_image": "postgis/postgis@sha256:01a6a70e41e6c4467c8f55f6063555ed72db2d6662cd0d571040d42eadaeb6f6"
},
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604"
},
"authenticated_destination": "Fresh read confirmed4cebd617;installer inactive",
"new_backup_restore": "Verified fresh backup and real isolated restore;no active restore performed"
}
@@ -0,0 +1,10 @@
--- a/resources/js/lib/iva-import-exemptions.ts
+++ b/resources/js/lib/iva-import-exemptions.ts
@@ -65,6 +65,7 @@
}
export function importExemptionCurrent(draft:Record<string,unknown>,book:ImportExemptionBook):boolean {return !!book.result&&book.result.sourceKey===key(draft,book);}
export function recordImportExemptions(draft:Record<string,unknown>,book:ImportExemptionBook):ImportExemptionBook {
+ throw new Error('Novas classificacoes de importacao temporariamente suspensas; resultados guardados e relatorios disponiveis.');
if(!book.rows.length||new Set(book.rows.map(r=>r.id)).size!==book.rows.length)throw new Error('Indique importações com identificadores distintos; versões anteriores conservadas.');
const result:ImportExemptionCalculation={version:importExemptionVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:[...new Set(book.rows.map(row=>importRuleSource(row.treatment)))].join(' | '),inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateImportExemption(row,draft.currency))};
return {...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};
@@ -1,6 +1,37 @@
# Rastreabilidade, utilização e formação
## 24/10/2026 — G6C/P053/P054 demonstrado em QA
**P053→eligible_ship_import /ship_operation_object_import;P054→eligible_aircraft_import /aircraft_operation_object_import. DoisIDs/quatrotratamentos**,candidata`8e5565d5`,registo`iva_l1_g6c_P053_P054_import_assets_QA_demonstrated_20261024`. Importação12(1)(h/i),por referência aos meios13(1)(f/g) e actividades13(1)(c/d);não venda interna nem abastecimentoP052. Página integralLei13/2016PDF11/p1426(269) ePDF12/p1426(270),já conferidasG6A/G4B,e alterações2022/2025 reutilizadas. Fonte oficial aceiteTempo08/10;sem nova validação jurídica genérica. Identificar meio/utilização e,para objecto,ligação concreta à respectiva exploração. No avião,companhia principalmente internacional,não voo isolado;na embarcação,actividade legal própria,não barco de recreio genérico.
DefiniçõesG4B exportadas sem mudar texto nem tratamentos de venda. Classificador de importações existente,sem schema/permissões novos;versãoimport-assets/1 só quando seleccionados os novos tratamentos,sem invalidar chaves/fontes/resultadosG6A/G6B. Condições desconhecidas→indeterminado,não→não aplicação desta isenção,sim com contexto→IVAisento0.00MZN;sem taxa normal presumida. Trocar de objecto para avião apresenta a condição própria em falta,conserva resposta de ligação/documento/4000MZN e resultado anterior;regressar recupera respostas. Classificar novamente arquiva a versão anterior.
4testesnovos+9importaçõesexistentes aprovados;APIprivadaQA1teste/24asserções,guarda*_test:55441 e rollback;tipos/produção/QAaprovados,avisosexistentes deplugins/chunks. UICodex/Edge-CUA:ligação por indicar→indeterminado,não→não aplicação,sim→isenção;troca/regresso de tratamento;Guardar→Recuperar sem divergênciaUTF8→Relatório comquatrotratamentos,opportunity332/Manica/2026-12,documento11/2026,fontes e4versõesanteriores. Preservados23livrosanteriores:20vendas,1aquisiçõesG5B e2importaçõesG6A/G6B,incluindo resultados/fontes/históricos,íntegros/actuais sem recálculo. AuxiliarQA mantém correcçãoUTF8 e passa teste de quebra multibyte;provas de exportadoresWord/PDF reutilizadas,sem nova alegação de paginação ou conferência manualTempo.
**70entregues+2QA+60funcionaispendentes+P001=133.** G6:4entregues/2QA/9pendentes. Homologação4cebd617/72e56f7a inalterada. [Manifesto preparado](../simulations/l1-g6c-delivery-20261024.json),contenção de novas classificações conferida,não aplicada;leitores/histórico/relatório mantidos. Destino/main autenticados frescos e backup/restauro isolado continuam necessários antes de instalação;esta passagem não fezpush nem alterou oactivo. **P080/P084/P085 explicitamente abertos;L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.** Classificação da importação permanece separada da dedução/campo11L2,direitosL13,baseaduaneira e totaisModeloA;P086 e fonteBR89/2017 preservados.
## 24/10/2026 — preparação G6C e preservação antes dos testes
Inventário existente: **70ramos entregues**,conforme matriz e reciboG6B4cebd617/72e56f7a;sem perda confirmada. Provas aceites de comparação código/schema/dados/configuração/permissões reutilizadas:174tabelas/369ficheiros,29fichas/28relações/408geometrias. Congelados20livrosvendas,1aquisiçõesG5B e2importaçõesG6A/G6B,com resultados/fontes/históricos,sem recálculo;fixtureiva-g6b-inputs.json. Nenhuma redução de âmbito prevista;sem novos testes ou alterações noactivo nesta preparação. **P080/P084/P085 explicitamente abertos.** Saldo70entregues+62funcionaispendentes+P001=133.
G6C delimita **P053→eligible_ship_import /ship_operation_object_import,12(1)(h)** e **P054→eligible_aircraft_import /aircraft_operation_object_import,12(1)(i)**. São doisIDs/quatrotratamentos:bem principal ou objecto incorporado/utilizado na respectiva exploração. Fonte:CIVA republicadoLei13/2016PDF11/p1426(269),por referência a13(1)(f/g),PDF12/p1426(270),com actividades marítimas13(1)(c/d);páginas integrais já conferidas visualmente emG6A/G4B,reutilizadas. Lei22/2022PDF2/p2252(26) eLei10/2025PDF13/p2180(13) mantêm h/i,sem alterar13. Inventários dos seis originais/hashes e gerais existentes reutilizados;sem nova autenticação jurídica genérica da fonte oficial aceiteTempo08/10.
Reutilizar as definições de embarcação e avião já executadas emG4B,sem mudar os tratamentos de venda:exportam-se apenas as definições existentes. No avião,a companhia dedica-se principalmente ao tráfego internacional;não basta voo isolado. Embarcação deve corresponder às actividades de13(1)(c/d),não qualquer barco de recreio. Objecto exige ligação concreta à exploração do meio elegível identificado,não compra genérica do operador. Documento/período/moeda e pressupostos mantidos na importação;sem recalcular vendas nem deduzir no campo11. Escolha técnica:versão adicionalimport-assets/1 só nos livros com os novos tratamentos,chaves anterioresG6A/G6B conservadas. Campos aplicáveis por tratamento,respostas e histórico conservados ao mudar;desconhecido não significa zero ou não aplicação. Baseaduaneira/direitosL13,deduçãoL2 e apuramento integral ficam fora deste incremento. L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.
## 24/10/2026 — G6B/P055/P057 entregue na homologação 4cebd617
**P055→author_art_import /12(1)(j);P057→fire_brigade_vehicle /12(1)(l). Doisramos** de classificação do IVA na importação em2026/MZN. A Tempo aceitou a candidataf75f36f0 concluída emQA segundo o relatório1efb32c2 e autorizou integração/disponibilização peloGit existente,com preservação de alterações concorrentes e conferência apenas do delta instalado. Reutilizadas provas aceites de condições,indeterminação/não aplicação/isenção,gravação/recuperação/relatório e20livrosvendas+1aquisições+1importaçõesG6A;sem repetir aceitação ou atribuir nova conferência manual àTempo. A correcção deUTF8 do auxiliarQA conserva-se documentada;API privada eactivo não sofreram essa alteração.
Gitfast-forward sobree3601c12;consulta fresca de main e destino autenticado sem avanço concorrente encontrado;68ramos e recibos anteriores preservados. Sessão SSH anterior terminada,renovada pelo responsável no auxiliar existente,sem registar credenciais. Backup novo e restauro real isolado sem rede:174tabelas/369ficheiros. Delta instalado:revisão efectivamente servida,manifesto/hash,seis marcadores,dois ficheiros funcionais,simuladorHTTP200. Preservação:174tabelas,369ficheiros/configuração,29fichas publicadas/28relações/408geometrias,identidadePostgreSQL equivalente antes/depois;apenas diferenças operacionais cache/sessões registadas. Zero migrações/importações/alterações de permissões ou ensaios sintéticos noactivo. Backup/release anterior conservados;contenção de novas classificações conferida,não aplicada;leitores/histórico/relatórios mantidos.
[Manifesto/recibo](../simulations/l1-g6b-delivery-20261024.json),registo `iva_l1_g6b_homologation_20261024`. **70entregues+62funcionaispendentes+P001=133;sem candidatasQA por disponibilizar.** G6:4entregues/11pendentes. **P080/P084/P085 explicitamente abertos;L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.** Classificação não fixa baseaduaneira/direitos,nem preenche dedução/campo11 ou totaisModeloA;P086 permanece disposição eliminada/encaminhamento aplicável,fonteBR89/2017 preservada.
## 24/10/2026 — G6B/P055/P057 demonstrado em QA
**P055→author_art_import /12(1)(j);P057→fire_brigade_vehicle /12(1)(l)**,candidata`f75f36f0`,registo`iva_l1_g6b_P055_P057_import_exemptions_QA_demonstrated_20261024`. Doisramos existentes da matriz. Página integralLei13/2016PDF11/p1426(269) e redacções2022/2025 aceites reutilizadas;artistas-autores residentes,seus herdeiros ou legatários conforme texto integral da condição,sem benefício genérico para comerciante de arte. No veículo,corporação de bombeiros e destino exclusivamente à actividade própria. Fonte/identidade/residência/relação/finalidade constam do enquadramento e fundamento factual;sem nova validação jurídica genérica.
File diff suppressed because one or more lines are too long
@@ -9,7 +9,7 @@ export function SimulationImportExemptions({draft,onChange}:{draft:Record<string
const change=(id:string,patch:Partial<ImportExemptionRow>)=>save({...book,rows:book.rows.map(row=>row.id===id?{...row,...patch}:row)});
return <details className="space-y-3 rounded border p-3">
<summary>IVA na importação — enquadramentos disponíveis</summary>
<p>Oportunidade: {String(draft.context_opportunity||'entrada geral')}. Indique apenas importações relevantes. Escolha entre reimportação no mesmo estado, ouro pelo Banco de Moçambique, objectos de arte ou veículo de combate a incêndios. Cobertura2026/MZN; as compras internas e os seus resultados conservam-se.</p>
<p>Oportunidade: {String(draft.context_opportunity||'entrada geral')}. Indique apenas importações relevantes: reimportação no mesmo estado, ouro pelo Banco de Moçambique, objectos de arte, veículo de combate a incêndios, embarcação/avião elegível ou objecto da sua exploração. Escolha o ramo para apresentar as condições aplicáveis. Cobertura2026/MZN; as compras internas e os seus resultados conservam-se.</p>
<p>O valor declarado/previsional é conservado, sem o fixar como base aduaneira. A classificação não preenche o campo11 de dedução nem os totais do ModeloA. Uma condição não cumprida afasta só esta isenção; o imposto normal fica por enquadrar. Nas projecções, as respostas são pressupostos, sem certificação aduaneira.</p>
{error&&<p role="alert">{error}</p>}
<button type="button" className="underline" onClick={()=>save({...book,rows:[...book.rows,newImportExemption(crypto.randomUUID(),String(draft.currency??''))]})}>Acrescentar importação relevante</button>
+11 -3
View File
@@ -1,19 +1,27 @@
import { acquisitionScope } from './iva-acquisitions.ts';
import { internationalShipEligibility,internationalAircraftEligibility } from './iva-international-assets.ts';
type Choice = ''|'yes'|'no';
export const importExemptionVersion = 'import-exemptions/1';
export const importExemptionSource = 'CIVA republicado pela Lei13/2016, BR156/10.º suplemento, art.12(1)(d/f),PDF11/p.1426(269). Lei22/2022,PDF2/p.2252(26),mantém d/f; Lei10/2025,PDF12–13/p.2180(12–13),mantém d/f. Cobertura2026/MZN; classificação do IVA na importação,sem cálculo de direitos aduaneiros ou dedução no campo11.';
export const importBeneficiaryVersion = 'import-beneficiaries/1';
export const importBeneficiarySource = 'CIVA republicado pela Lei13/2016, BR156/10.º suplemento, art.12(1)(j/l),PDF11/p.1426(269). Lei22/2022,PDF2/p.2252(26),e Lei10/2025,PDF13/p.2180(13),mantêm j/l. Cobertura2026/MZN; importação de objectos de arte e veículo de combate a incêndios nas condições próprias,sem dedução no campo11 nem cálculo de direitos aduaneiros.';
export const importAssetVersion = 'import-assets/1';
export const importAssetSource = 'CIVA republicado pela Lei13/2016, BR156/10.º suplemento, art.12(1)(h/i),PDF11/p.1426(269),por referência a13(1)(f/g),PDF12/p.1426(270),e actividades de13(1)(c/d). Lei22/2022,PDF2/p.2252(26),e Lei10/2025,PDF13/p.2180(13),mantêm h/i;13 não alterado nesses diplomas. Cobertura2026/MZN; importação de embarcação/avião elegível ou objecto incorporado/utilizado na respectiva exploração,sem dedução no campo11,base aduaneira ou cálculo de direitos aduaneiros.';
export const importExemptionRules = [
{id:'reimport_same_state',branch:'P049',label:'Reimportação por quem exportou, no mesmo estado',article:'12(1)(d)',conditions:[['sameExporter','A reimportação é efectuada por quem exportou os bens'],['sameState','Os bens regressam no mesmo estado em que foram exportados'],['customsExempt','Esta reimportação beneficia de isenção de direitos aduaneiros']]},
{id:'central_bank_gold',branch:'P051',label:'Importação de ouro pelo Banco de Moçambique',article:'12(1)(f)',conditions:[['gold','Os bens importados são ouro'],['centralBank','A importação é efectuada pelo Banco de Moçambique']]},
{id:'author_art_import',branch:'P055',label:'Objectos de arte pelos artistas-autores, herdeiros ou legatários',article:'12(1)(j)',conditions:[['artObjects','Os bens importados são objectos de arte'],['eligibleArtImporter','A importação é efectuada pelos próprios artistas-autores, residentes no território nacional, seus herdeiros ou legatários; a identidade, residência e relação aplicáveis estão identificadas no fundamento factual']]},
{id:'fire_brigade_vehicle',branch:'P057',label:'Veículo de combate a incêndios por corporação de bombeiros',article:'12(1)(l)',conditions:[['fireVehicle','O bem importado é um veículo de combate a incêndios'],['fireBrigade','A importação é efectuada por uma corporação de bombeiros'],['exclusiveOwnUse','O veículo destina-se exclusivamente a ser utilizado na actividade própria da corporação']]},
{id:'eligible_ship_import',branch:'P053',label:'Importação de embarcação elegível',article:'12(1)(h)',conditions:[['eligibleShip',internationalShipEligibility],['importedShip','O bem importado é a própria embarcação elegível identificada; não um serviço nem qualquer bem adquirido pelo operador']]},
{id:'ship_operation_object_import',branch:'P053',label:'Importação de objecto incorporado ou utilizado na exploração de embarcação elegível',article:'12(1)(h)',conditions:[['eligibleShip',internationalShipEligibility],['shipObjectLink','O objecto importado está incorporado na embarcação elegível identificada ou é utilizado na sua exploração; objecto, embarcação e ligação concreta identificados no documento ou pressuposto, não um fornecimento genérico ao operador']]},
{id:'eligible_aircraft_import',branch:'P054',label:'Importação de avião de companhia principalmente internacional',article:'12(1)(i)',conditions:[['eligibleAircraft',internationalAircraftEligibility],['importedAircraft','O bem importado é o próprio avião elegível identificado; não um serviço nem qualquer bem adquirido pela companhia']]},
{id:'aircraft_operation_object_import',branch:'P054',label:'Importação de objecto incorporado ou utilizado na exploração de avião elegível',article:'12(1)(i)',conditions:[['eligibleAircraft',internationalAircraftEligibility],['aircraftObjectLink','O objecto importado está incorporado no avião elegível identificado ou é utilizado na sua exploração; objecto, avião e ligação concreta identificados no documento ou pressuposto, não um fornecimento genérico à companhia']]},
] as const;
type Condition = 'sameExporter'|'sameState'|'customsExempt'|'gold'|'centralBank'|'artObjects'|'eligibleArtImporter'|'fireVehicle'|'fireBrigade'|'exclusiveOwnUse';
type Condition = 'sameExporter'|'sameState'|'customsExempt'|'gold'|'centralBank'|'artObjects'|'eligibleArtImporter'|'fireVehicle'|'fireBrigade'|'exclusiveOwnUse'|'eligibleShip'|'importedShip'|'shipObjectLink'|'eligibleAircraft'|'importedAircraft'|'aircraftObjectLink';
function beneficiaryImport(id:string):boolean {return id==='author_art_import'||id==='fire_brigade_vehicle';}
export function importRuleSource(id:string):string {return beneficiaryImport(id)?importBeneficiarySource:importExemptionSource;}
function assetImport(id:string):boolean {return ['eligible_ship_import','ship_operation_object_import','eligible_aircraft_import','aircraft_operation_object_import'].includes(id);}
export function importRuleSource(id:string):string {return assetImport(id)?importAssetSource:beneficiaryImport(id)?importBeneficiarySource:importExemptionSource;}
export type ImportExemptionRow = {id:string;treatment:string;description:string;period:string;origin:'projected'|'effective';currency:string;declaredValue:string;goodsCode:string;originCountry:string;importer:string;documentRef:string;documentDate:string;evidence:string;conditions:Partial<Record<Condition,Choice>>};
type ImportResult = {id:string;status:'exempt'|'not_applicable'|'indeterminate';importVat:string|null;reason:string};
export type ImportExemptionCalculation = {version:string;revision:number;calculatedAt:string;opportunity:string;location:string;sourceKey:string;source:string;inputs:ImportExemptionRow[];rows:ImportResult[]};
@@ -53,7 +61,7 @@ export function evaluateImportExemption(row:ImportExemptionRow,currency:unknown)
}
function key(draft:Record<string,unknown>,book:ImportExemptionBook):string {
const base={version:importExemptionVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},currency:draft.currency,rows:book.rows};
return JSON.stringify(book.rows.some(row=>beneficiaryImport(row.treatment))?{...base,beneficiaryVersion:importBeneficiaryVersion}:base);
return JSON.stringify({...base,...(book.rows.some(row=>beneficiaryImport(row.treatment))?{beneficiaryVersion:importBeneficiaryVersion}:{}),...(book.rows.some(row=>assetImport(row.treatment))?{assetVersion:importAssetVersion}:{})});
}
export function importExemptionCurrent(draft:Record<string,unknown>,book:ImportExemptionBook):boolean {return !!book.result&&book.result.sourceKey===key(draft,book);}
export function recordImportExemptions(draft:Record<string,unknown>,book:ImportExemptionBook):ImportExemptionBook {
@@ -4,6 +4,8 @@ const source = 'CIVA republicado Lei13/2016, BR156/10.º suplemento, art.13(1)(c
const scope = 'Operação abrangida pelo CIVA em Moçambique, com territorialidade identificada; não basta o sector, a localização do investimento ou a residência estrangeira do cliente';
const ship = 'Embarcação identificada, afecta a navegação marítima em alto mar com transporte remunerado de passageiros ou actividade comercial, industrial ou de pesca; ou a salvamento, assistência marítima ou pesca costeira, nos termos de13(1)(c/d). A natureza e utilização constam do documento ou pressuposto; não qualquer barco de recreio';
const aircraft = 'Avião identificado e utilizado por companhia de navegação aérea que se dedica principalmente ao tráfego internacional; companhia e utilização identificadas, não bastando um voo internacional isolado';
export const internationalShipEligibility = ship;
export const internationalAircraftEligibility = aircraft;
const make=(id:string,label:string,letter:string,conditions:string[]):OperationTreatment=>({id,label,field:'05',rate:0,article:`CIVA arts.13(1)(${letter}),19(1)(b)(i)`,source,logicVersion:'international-assets/1',conditions:[scope,...conditions]});
export const internationalAssetTreatments:OperationTreatment[] = [
@@ -0,0 +1,50 @@
<?php
namespace Tests\Feature;
use App\Models\User;
use Illuminate\Foundation\Testing\DatabaseTransactions;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
use Tests\TestCase;
final class IvaImportAssetsDraftTest extends TestCase
{
use DatabaseTransactions;
public function test_import_classification_recovers_privately_without_changing_delivered_books(): void
{
$target = DB::selectOne('select current_database() as name,inet_server_port() as port');
$this->assertSame('simulator_fiscal_delta_20261021_test', $target->name);
$this->assertSame(55441, (int) $target->port);
config(['investor-path.enabled' => true, 'suitecrm.enabled' => false]);
$this->actingAs(User::factory()->create(['email_verified_at' => now()]));
$draft = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-g6c-imports.json')), true, flags: JSON_THROW_ON_ERROR);
$id = $this->postJson('/api/v1/simulation-drafts', ['personal_snapshot' => [], 'economic_snapshot' => $draft], ['Idempotency-Key' => (string) Str::uuid()])->assertCreated()->json('data.id');
$recovered = $this->getJson('/api/v1/simulation-drafts/'.$id)->assertOk()->json('data.economic_snapshot');
$this->assertSame($draft['modelo_a_snapshot'], $recovered['modelo_a_snapshot']);
$this->assertSame('opportunity:332', $recovered['context_opportunity']);
$this->assertSame('Manica', $recovered['selection_labels']['province_id']);
$store = json_decode($recovered['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
$book = $store['importExemptions']['opportunity:332'];
$this->assertCount(4, $book['rows']);
$this->assertSame(['eligible_ship_import', 'ship_operation_object_import', 'eligible_aircraft_import', 'aircraft_operation_object_import'], array_column($book['rows'], 'treatment'));
$this->assertSame(['0.00', '0.00', '0.00', '0.00'], array_column($book['result']['rows'], 'importVat'));
$this->assertSame(['exempt', 'exempt', 'exempt', 'exempt'], array_column($book['result']['rows'], 'status'));
$this->assertSame('2026-12', $book['rows'][0]['period']);
$this->assertSame('4000', $book['rows'][0]['declaredValue']);
$this->assertSame('SYNTHETIC QA G6C eligible_ship_import', $book['rows'][0]['documentRef']);
$this->assertStringContainsString('12(1)(h/i)', $book['result']['source']);
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-g6b-inputs.json')), true, flags: JSON_THROW_ON_ERROR);
$prior = json_decode($frozen['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
$this->assertSame($prior['salesOperations'], $store['salesOperations']);
$this->assertSame($prior['books'], $store['books']);
$this->assertSame($prior['importExemptions']['opportunity:330'], $store['importExemptions']['opportunity:330']);
$this->assertSame($prior['importExemptions']['opportunity:331'], $store['importExemptions']['opportunity:331']);
$this->assertCount(1, $book['history']);
$this->assertNull($book['history'][0]['rows'][0]['importVat']);
$this->assertNull($store['books']['opportunity:329']['result']['periods'][0]['fields']['11']);
$this->assertNull($store['books']['opportunity:329']['result']['periods'][0]['fields']['17']);
$this->assertStringContainsString('BR89', $store['books']['opportunity:329']['result']['sources']);
file_put_contents(base_path('outputs/iva-l1-g6c-imports-20261024/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE));
}
}
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+55
View File
@@ -0,0 +1,55 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import { newImportExemption,evaluateImportExemption,recordImportExemptions,saveImportExemptionBook,importExemptionBook,importExemptionCurrent,importExemptionRules,importRuleSource } from '../../resources/js/lib/iva-import-exemptions.ts';
import { internationalShipEligibility,internationalAircraftEligibility,internationalAssetTreatments } from '../../resources/js/lib/iva-international-assets.ts';
import { salesCurrent } from '../../resources/js/lib/iva-operations.ts';
import { acquisitionCurrent } from '../../resources/js/lib/iva-acquisitions.ts';
import { createProjectDossierReport } from '../../resources/js/lib/project-dossier-report.ts';
const frozen=JSON.parse(fs.readFileSync(new URL('./fixtures/iva-g6b-inputs.json',import.meta.url),'utf8'));
const ids=['eligible_ship_import','ship_operation_object_import','eligible_aircraft_import','aircraft_operation_object_import'];
const row=(treatment='eligible_ship_import')=>({...newImportExemption('g6c-'+treatment,'MZN'),treatment,description:'SYNTHETIC QA '+treatment,period:'2026-12',declaredValue:'4000',importer:'SYNTHETIC QA operador',documentRef:'SYNTHETIC QA G6C '+treatment,documentDate:'2026-11-13',evidence:'SYNTHETIC QA meio identificado, utilização elegível e ligação do bem importado expressamente assumidas; não é documento real',conditions:Object.fromEntries(importExemptionRules.find(r=>r.id===treatment).conditions.map(([key])=>[key,'yes']))});
const draft=()=>({...structuredClone(frozen),context_opportunity:'opportunity:332',project_title:'SYNTHETIC QA — G6C / Embarcações e aviões'});
test('P053/P054 four treatments require every own condition;unknown and false never become exempt zero or ordinary tax',()=>{
for(const id of ids){
const input=row(id),rule=importExemptionRules.find(r=>r.id===id);assert.equal(evaluateImportExemption(input,'MZN').importVat,'0.00');
for(const [key] of rule.conditions)for(const value of ['','no','unknown']){
const result=evaluateImportExemption({...input,conditions:{...input.conditions,[key]:value}},'MZN');assert.equal(result.status,value==='no'?'not_applicable':'indeterminate');assert.equal(result.importVat,null);
}
for(const patch of [{period:'2025-12'},{currency:'USD'},{evidence:''},{documentRef:''},{documentDate:'2026-02-30'}])assert.equal(evaluateImportExemption({...input,...patch},'MZN').importVat,null);
assert.deepEqual(input,row(id));
}
assert.equal(new Set(ids.map(id=>importExemptionRules.find(r=>r.id===id).branch)).size,2);
});
test('import definitions reuse accepted vessel/aircraft eligibility;principal asset does not substitute for linked object',()=>{
assert.equal(importExemptionRules.find(r=>r.id===ids[0]).conditions[0][1],internationalShipEligibility);
assert.equal(importExemptionRules.find(r=>r.id===ids[2]).conditions[0][1],internationalAircraftEligibility);
assert.ok(internationalAssetTreatments.find(r=>r.id==='international_ship_operations').conditions.includes(internationalShipEligibility));
assert.ok(internationalAssetTreatments.find(r=>r.id==='international_aircraft_operations').conditions.includes(internationalAircraftEligibility));
assert.match(internationalAircraftEligibility,/principalmente.*internacional/);assert.match(internationalAircraftEligibility,/voo internacional isolado/);
const ship=row();const object={...ship,treatment:'ship_operation_object_import'};assert.equal(evaluateImportExemption(object,'MZN').status,'indeterminate');assert.equal(object.conditions.importedShip,'yes');assert.equal(object.documentRef,ship.documentRef);
assert.equal(evaluateImportExemption({...object,conditions:{...object.conditions,shipObjectLink:'yes'}},'MZN').status,'exempt');
assert.equal(evaluateImportExemption({...row('aircraft_operation_object_import'),conditions:{eligibleAircraft:'yes',importedAircraft:'yes'}},'MZN').status,'indeterminate');
assert.match(importRuleSource(ids[1]),/12\(1\)\(h\/i\)/);assert.match(importRuleSource(ids[3]),/13\(1\)\(f\/g\)/);
});
test('classification archives unknown and failed versions;edits preserve earlier result and mark it historical',()=>{
const d=draft(),input=row();let book=recordImportExemptions(d,{rows:[{...input,conditions:{eligibleShip:'yes'}}]});assert.equal(book.result.rows[0].status,'indeterminate');
book=recordImportExemptions(d,{...book,rows:[{...input,conditions:{...input.conditions,eligibleShip:'no'}}]});assert.equal(book.result.rows[0].status,'not_applicable');
book=recordImportExemptions(d,{...book,rows:ids.map(row)});assert.equal(book.history.length,2);assert.equal(book.history[0].rows[0].importVat,null);assert.equal(book.history[1].rows[0].importVat,null);assert.ok(importExemptionCurrent(d,book));
for(const patch of [{currency:'USD'},{context_opportunity:'opportunity:331'},{selection_labels:{province_id:'Maputo'}}])assert.ok(!importExemptionCurrent({...d,...patch},book));
assert.ok(!importExemptionCurrent(d,{...book,rows:[{...input,declaredValue:'4100'}]}));
});
test('save/recover/report preserve23acceptedbooks current;only new asset treatments add version and do not populate field11',()=>{
const d=draft(),prior=JSON.parse(frozen.modelo_a_snapshot);let book=recordImportExemptions(d,{rows:ids.map(id=>({...row(id),conditions:{}}))});book=recordImportExemptions(d,{...book,rows:ids.map(row)});d.modelo_a_snapshot=saveImportExemptionBook(d,book);
assert.deepEqual(importExemptionBook(JSON.parse(JSON.stringify(d))),book);assert.match(book.result.sourceKey,/import-assets\/1/);assert.doesNotMatch(book.result.sourceKey,/beneficiaryVersion/);assert.match(book.result.source,/12\(1\)\(h\/i\)/);
const next=JSON.parse(d.modelo_a_snapshot);assert.deepEqual(next.salesOperations,prior.salesOperations);assert.deepEqual(next.books,prior.books);
for(const [scope,imports] of Object.entries(prior.importExemptions)){assert.deepEqual(next.importExemptions[scope],imports);assert.ok(importExemptionCurrent({...d,context_opportunity:scope},imports));}
for(const [scope,sales] of Object.entries(next.salesOperations))assert.ok(salesCurrent({...d,context_opportunity:scope},sales));
assert.ok(acquisitionCurrent({...d,context_opportunity:'opportunity:329'},next.books['opportunity:329']));assert.equal(next.books['opportunity:329'].result.periods[0].fields['11'],null);assert.equal(next.books['opportunity:329'].result.periods[0].fields['17'],null);
const report=JSON.stringify(createProjectDossierReport(d,{selectedSections:new Set(['finance']),version:'QA G6C'}));for(const token of ['P053','P054','opportunity:332','Manica','2026-12','SYNTHETIC QA G6C','0.00','12(1)(h/i)','campo11',...ids])assert.ok(report.includes(token),token);
if(process.env.IVA_G6C_CALCULATED)fs.writeFileSync(process.env.IVA_G6C_CALCULATED,JSON.stringify(d));
});