Compare commits

...
4 Commits
16 changed files with 1412 additions and 18 deletions
@@ -11596,5 +11596,648 @@
},
"authenticated_destination": "Fresh read confirmed69f2e365;installer inactive",
"new_backup_restore": "Verified fresh backup and real isolated restore;no active restore performed"
},
"iva_l1_g5b_homologation_20261024": {
"status": "installed_delta_verified_partial_L1",
"candidate": "689a4c93c33cd737c6fc90823533b34b5219b5d3",
"base": "d3e9f373",
"last_known_remote_main": "69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75",
"fresh_destination_preflight": "completed authenticated69f2e365 before installation;see authenticated_preflight",
"coverage": {
"group": "G5B",
"branches": {
"AUD-SIM-L1-P086": "former_exploration_exemption -> explicit normal acquisition continuation"
},
"branch_count": 1,
"scope": "2026/MZN;nonapplication of eliminated14(2)(c) and explicit normal-acquisition continuity;not an active exemption"
},
"runtime_delta": [
{
"path": "resources/js/components/simulation-acquisitions.tsx",
"sha256_LF": "7c4e0a960c361c1fe67e9cb05e249f07ee5710d2dfefa69859e163a9f23118c6"
},
{
"path": "resources/js/lib/iva-acquisition-continuity.ts",
"sha256_LF": "2c40643c8f5ceb79b01fb4cb56d1955beb8bbd1c8a2a0cd080647bbc3db24e74"
},
{
"path": "resources/js/lib/iva-acquisitions.ts",
"sha256_LF": "364661218cdf7769a57b030006818c506a7296057e87333f2d7a1f673ac1a91c"
}
],
"counts_current": {
"delivered": 66,
"QA": 0,
"functional_pending": 66,
"documentary": 1,
"total": 133
},
"counts_after_delivery_only": {
"delivered": 66,
"QA": 0,
"functional_pending": 66,
"documentary": 1,
"total": 133
},
"proofs_reused": {
"frontend_new": 4,
"existing_changed_acquisition_suite": 8,
"frontend_total": 12,
"latest_delta": 4,
"API_tests": 1,
"API_assertions": 45,
"QA_database": "simulator_fiscal_delta_20261021_test:55441",
"transaction_rollback": true,
"types": "passed",
"production_build": "passed;existing plugin timing warnings",
"QA_build": "passed;existing config/chunk warnings",
"QA_storage": "save/recover/reject passed in temporary directory",
"UI": {
"actor": "Codex",
"method": "Edge/CUA observed",
"URL": "http://127.0.0.1:18641/g5b.html",
"observed": [
"former14(2)(c) selected -> eliminated notice;deduction indeterminate,100/16/116MZN retained",
"normal deduction controls hidden while nonapplicable",
"explicit continue ->normal controls/facts restored;calculate ->16MZN field10 under normal declared conditions",
"Guardar -> Recuperar -> Relatório with document,source,period/context;17/18 remain indeterminate",
"three results in history and20salesbooks unchanged in saved file"
],
"manual_Tempo_reply": null,
"screenshot": "outputs/iva-l1-g5b-acquisitions-20261024/qa-recovered-report.png",
"screenshot_sha256": "e29df1a8daf66f43ab7aaab9f78f472cf331272860aaac0edcde6ff40fd3a9d5"
},
"Word_PDF": "Existing exporter/numeric proofs reused;no new pagination claim"
},
"rollback": "l1-g3-readonly-rollback-20261024.patch checked on G5B candidate,not applied;readers/history/reports retained;fresh backup and previous release must be preserved",
"backup_restore": {
"backup": {
"stage": "/var/backups/investmoz-l1-g5b-delivery-20261024/backup",
"target": {
"database": "teste_investidor",
"port": 5432
},
"tables": 174,
"files_verified": 369,
"dump_sha256": "d6c09b69fc18aba716554ca4aedded870c861c01c4997a4d29bc5e0f0b5380fe",
"files_sha256": "bd05d701fce9f8c150315791d196289db6036352cfd79341766c7fab031a7501",
"restore_verified": false
},
"restore": {
"restore_verified": true,
"tables_verified": 174,
"container_network": "none",
"database": "l1_g5b_restore_20261024",
"port": 55441,
"source_dump_sha256": "d6c09b69fc18aba716554ca4aedded870c861c01c4997a4d29bc5e0f0b5380fe",
"active_database_writes": 0
}
},
"activation": "Git FF/webhook/installer completed;zero migrations/imports",
"served_revision_and_delta": "verified",
"limits": "2026/MZN;P086 é não aplicação da antiga14(2)(c),eliminada pelo Aviso2017,e continuidade deliberada na aquisição normal; não é isenção nova/activa nem cálculo retroactivo. Sem taxa presumida,dedução automática,importação,apuramento integral ou submissãoAT. P080/P084/P085 pendentes. 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": "69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75",
"release": "/var/www/investmoz-homologacao/releases/69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75-ac55d458",
"previous_release": "/var/www/investmoz-homologacao/releases/2e21ca45002b76adcef0347135783c706d37dd42-a5faea22",
"database_migrations": 0,
"content_imports": 0
},
"current_link": "/var/www/investmoz-homologacao/releases/69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75-ac55d458",
"release_revision": {
"commit": "69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75",
"branch": "main",
"built_at": "2026-10-24T16:48:42.080060+00:00",
"manifest_sha256": "84ea021139c585e0c7e7f8ab6933cd1775cd08173d3d0cdfeffad0b5bef46801"
},
"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 confirmed69f2e365;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_G5B": false
},
"treatment": "Disposição eliminada e encaminhamento para o regime aplicável; não é isenção disponível",
"rectification_reference": "Aviso da Assembleia da República, BR n.º89, I Série,08/06/2017,PDF1/p.569: c) eliminado",
"served_commit": "6f056359df4231f9e1802922782b21263a8dae0b",
"installation": {
"protected": {
"installed": {
"status": "installed",
"commit": "6f056359df4231f9e1802922782b21263a8dae0b",
"release": "/var/www/investmoz-homologacao/releases/6f056359df4231f9e1802922782b21263a8dae0b-5bf30d7b",
"previous_release": "/var/www/investmoz-homologacao/releases/69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75-ac55d458",
"database_migrations": 0,
"content_imports": 0
},
"runtime_files_verified": 3,
"persistent_files_and_env_verified": 369,
"tables_compared": 174,
"changed_tables": {
"cache": {
"before": {
"rows": 105,
"checksum": "674479c6ce0897731d51e4ad2409f060"
},
"after": {
"rows": 105,
"checksum": "e278d0e2e0e8561bb0b474d138226a35"
}
},
"sessions": {
"before": {
"rows": 26,
"checksum": "c7dfaaba275b5b5758caa2aad1136c72"
},
"after": {
"rows": 27,
"checksum": "d0f71dec810ed1bb8a7112773d53bf34"
}
}
},
"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": "6f056359df4231f9e1802922782b21263a8dae0b",
"branch": "main",
"built_at": "2026-10-24T17:10:20.021314+00:00",
"manifest_sha256": "0e2ee85ab107f34efcc9c589328a0635d2d6021ba28ee387e02b0654aeab85db"
},
"manifest_hash_matches": true,
"compiled_delta_markers": {
"acquisition-continuity/1": [
"assets/project-dossier-weQkfpPV.js"
],
"former_exploration_exemption": [
"assets/services-DjZF4TLj.js",
"assets/project-dossier-weQkfpPV.js"
],
"acquisitionTreatment": [
"assets/services-DjZF4TLj.js",
"assets/project-dossier-weQkfpPV.js"
],
"acquisitionTreatmentOrigin": [
"assets/services-DjZF4TLj.js",
"assets/project-dossier-weQkfpPV.js"
],
"c) eliminado": [
"assets/services-DjZF4TLj.js",
"assets/project-dossier-weQkfpPV.js"
]
},
"assets": [
{
"file": "assets/project-dossier-document-DjMS3OYA.js",
"status": 200,
"sha256": "b50a5e08e323454b8c651baba303a86634620580bc103952d27ea21ff651d431"
},
{
"file": "assets/simulation-form-CPZAFZU3.js",
"status": 200,
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
},
{
"file": "assets/services-DjZF4TLj.js",
"status": 200,
"sha256": "f45efdeb6764272a00ec2ead6f1052ab77b199f3af2d6ade54c6dbeea413fc35"
},
{
"file": "assets/project-dossier-weQkfpPV.js",
"status": 200,
"sha256": "8ded1cc5a561a72cb1003097ece6edfe28760b9677eec09bb461390334260b31"
}
],
"simulator_status": 200,
"simulator_entry": "assets/app-DABOgBTI.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": "6f056359df4231f9e1802922782b21263a8dae0b",
"release": "/var/www/investmoz-homologacao/releases/6f056359df4231f9e1802922782b21263a8dae0b-5bf30d7b",
"previous_release": "/var/www/investmoz-homologacao/releases/69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75-ac55d458",
"database_migrations": 0,
"content_imports": 0
},
"latest_report": {
"status": "installed",
"commit": "6f056359df4231f9e1802922782b21263a8dae0b",
"release": "/var/www/investmoz-homologacao/releases/6f056359df4231f9e1802922782b21263a8dae0b-5bf30d7b",
"previous_release": "/var/www/investmoz-homologacao/releases/69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75-ac55d458",
"database_migrations": 0,
"content_imports": 0,
"requested_commits": [
"6f056359df4231f9e1802922782b21263a8dae0b"
],
"finished_at": "2026-10-24T17:10:22.445560+00:00"
},
"log_file": "1792861731226475463.log",
"summaries": [
"OK (1 test, 3106 assertions)",
"built in 25.29s",
"OK (59 tests, 317 assertions)",
"# tests 300",
"# pass 300",
"# fail 0"
],
"log_bytes": 115761
},
"rollback_executed": false
}
},
"iva_l1_g6a_P049_P051_import_exemptions_QA_demonstrated_20261024": {
"key": "iva_l1_g6a_P049_P051_import_exemptions_QA_demonstrated_20261024",
"status": "demonstrated_QA_not_installed",
"candidate": "965da2642627ad1e484d52587e07b4a60cae6af2",
"base": "e99ea1d0",
"homologation": "6f056359/e99ea1d0",
"group": "G6A",
"branches": {
"AUD-SIM-L1-P049": "reimport_same_state",
"AUD-SIM-L1-P051": "central_bank_gold"
},
"branch_count": 2,
"source": {
"reference": "CIVA12(1)(d/f),Lei13/2016PDF11/p1426(269),visual inspected;2022PDF2/p2252(26) and2025PDF12–13/p2180(12–13) retain d/f",
"acceptance": "Tempo08/10/2026;no new generic authenticity/legal approval",
"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": "e99ea1d0137543ca3fc37cb2c79732f3bb7c3edf",
"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-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-g5b-delivery-20261024.json;6f056359/e99ea1d0;174tables/369files/29published/28relations/408geometries;no schema/content/permissions changes",
"frozen_fixture_sha256": "96f239cd9edd6d522447ce16e7b6dc32610f836a9d25dc8ea8789fb3042cf6f2",
"sales_books": 20,
"purchase_books": 1,
"preserved_open": [
"P080",
"P084",
"P085"
],
"counts": {
"delivered": 66,
"QA": 0,
"functional_pending": 66,
"documentary": 1,
"total": 133
}
},
"tests": {
"frontend_new": 5,
"affected_report_tests": 14,
"frontend_total": 19,
"API_tests": 1,
"API_assertions": 20,
"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 passed,temporary file only",
"UI": {
"actor": "Codex",
"method": "Edge/CUA observed",
"URL": "http://127.0.0.1:18642/g6a.html",
"observed": [
"unknown condition ->indeterminate",
"failed condition ->nonapplication,normal tax unknown",
"affirmative conditions ->exempt import VAT0.00",
"switch treatment ->only applicable questions;answers,document,1000MZN retained",
"save/recover/report ->P049/P051,Manica,2026-12,documents,sources",
"three previous UI results;20salesbooks and1purchasebook identical"
],
"manual_Tempo_reply": null,
"screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g6a-imports-20261024\\qa-recovered-report.png",
"screenshot_sha256": "e6914778f6513e2ea22850d1b30a79ff3592e0c8085cb09c38f1ffb23541cf9c"
},
"Word_PDF": "Existing exporter proofs reused;no new pagination claim"
},
"implementation": {
"optional_snapshot_key": "importExemptions",
"no_schema_change": true,
"legacy_books": "no additional required fields;20sales and1purchase unchanged/current",
"data_conditions": "per branch;unknown != false;no ordinary rate inferred",
"value": "declared/previsional value preserved,optional;no invented customs taxable base",
"period": "explicit import period independent from supporting document date and sales calendar",
"history": "explicit classification archives previous result;edits keep historical state;reports show only applicable conditions",
"roll_back": "l1-g6a-readonly-rollback-20261024.patch checked,not applied;readers/history/reports retained"
},
"counts": {
"delivered": 66,
"QA": 2,
"functional_pending": 64,
"documentary": 1,
"total": 133
},
"G6": {
"delivered": 0,
"QA": 2,
"functional_pending": 13
},
"limits": "2026/MZN;classificação L1 de12(1)(d/f),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."
},
"iva_l1_g6a_delivery_preparation_20261024": {
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
"candidate": "965da2642627ad1e484d52587e07b4a60cae6af2",
"base": "e99ea1d0",
"last_known_remote_main": "6f056359",
"coverage": {
"AUD-SIM-L1-P049": "reimport_same_state",
"AUD-SIM-L1-P051": "central_bank_gold"
},
"runtime_delta": [
{
"path": "resources/js/lib/iva-import-exemptions.ts",
"sha256_LF": "43d823a594c5ea98801b69597fbd660effd90596709dec3a84787b7b11eef1c8"
},
{
"path": "resources/js/components/simulation-import-exemptions.tsx",
"sha256_LF": "20f35daf9573e9ff0813ee7b0e3f4ad19eb0d47eabb0d661af845a915e76340e"
},
{
"path": "resources/js/components/simulation-monthly-iva.tsx",
"sha256_LF": "a41275ce37268345d137745572c858ff3c989e392af337235f6b8b5e7dc38b86"
},
{
"path": "resources/js/lib/project-dossier.ts",
"sha256_LF": "ac75a0e24fdf31d17a90b3c9ecec338d6f0e309bd302d1254da04c2eacc493b3"
}
],
"counts_current": {
"delivered": 66,
"QA": 2,
"functional_pending": 64,
"documentary": 1,
"total": 133
},
"counts_after_delivery_only": {
"delivered": 68,
"QA": 0,
"functional_pending": 64,
"documentary": 1,
"total": 133
},
"proofs_reused": {
"frontend_new": 5,
"affected_report_tests": 14,
"frontend_total": 19,
"API_tests": 1,
"API_assertions": 20,
"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 passed,temporary file only",
"UI": {
"actor": "Codex",
"method": "Edge/CUA observed",
"URL": "http://127.0.0.1:18642/g6a.html",
"observed": [
"unknown condition ->indeterminate",
"failed condition ->nonapplication,normal tax unknown",
"affirmative conditions ->exempt import VAT0.00",
"switch treatment ->only applicable questions;answers,document,1000MZN retained",
"save/recover/report ->P049/P051,Manica,2026-12,documents,sources",
"three previous UI results;20salesbooks and1purchasebook identical"
],
"manual_Tempo_reply": null,
"screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g6a-imports-20261024\\qa-recovered-report.png",
"screenshot_sha256": "e6914778f6513e2ea22850d1b30a79ff3592e0c8085cb09c38f1ffb23541cf9c"
},
"Word_PDF": "Existing exporter proofs reused;no new pagination claim"
},
"rollback": "l1-g6a-readonly-rollback-20261024.patch checked;not applied",
"backup_restore": {
"backup": {
"stage": "/var/backups/investmoz-l1-g6a-delivery-20261024/backup",
"target": {
"database": "teste_investidor",
"port": 5432
},
"tables": 174,
"files_verified": 369,
"dump_sha256": "93d9e16845af367cab80ee4d646cc679b9668495c822d26ed6157caeb74da3fb",
"files_sha256": "928f06a3795206702dbdc3ebd3ef76f9e345a199c1ec81f5abfa97a40154ba58",
"restore_verified": false
},
"restore": {
"restore_verified": true,
"tables_verified": 174,
"container_network": "none",
"database": "l1_g6a_restore_20261024",
"port": 55441,
"source_dump_sha256": "93d9e16845af367cab80ee4d646cc679b9668495c822d26ed6157caeb74da3fb",
"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 remains6f056359",
"limits": "2026/MZN;classificação L1 de12(1)(d/f),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": "6f056359df4231f9e1802922782b21263a8dae0b",
"release": "/var/www/investmoz-homologacao/releases/6f056359df4231f9e1802922782b21263a8dae0b-5bf30d7b",
"previous_release": "/var/www/investmoz-homologacao/releases/69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75-ac55d458",
"database_migrations": 0,
"content_imports": 0
},
"current_link": "/var/www/investmoz-homologacao/releases/6f056359df4231f9e1802922782b21263a8dae0b-5bf30d7b",
"release_revision": {
"commit": "6f056359df4231f9e1802922782b21263a8dae0b",
"branch": "main",
"built_at": "2026-10-24T17:10:20.021314+00:00",
"manifest_sha256": "0e2ee85ab107f34efcc9c589328a0635d2d6021ba28ee387e02b0654aeab85db"
},
"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 confirmed6f056359;installer inactive",
"new_backup_restore": "Verified fresh backup and real isolated restore;no active restore performed"
}
}
@@ -1,6 +1,6 @@
{
"key": "iva_l1_g5b_P086_acquisition_continuity_QA_demonstrated_20261024",
"status": "demonstrated_QA_not_installed",
"status": "delivered_with_QA_proofs_preserved",
"candidate": "689a4c93c33cd737c6fc90823533b34b5219b5d3",
"base": "d3e9f373",
"homologation": "69f2e365/d3e9f373",
@@ -128,16 +128,29 @@
"Word_PDF": "Existing exporter/numeric proofs reused;no new pagination claim"
},
"counts": {
"delivered": 66,
"QA": 0,
"functional_pending": 66,
"documentary": 1,
"total": 133
},
"G5": {
"delivered": 4,
"QA": 0,
"functional_pending": 3
},
"limits": "2026/MZN;P086 é não aplicação da antiga14(2)(c),eliminada pelo Aviso2017,e continuidade deliberada na aquisição normal; não é isenção nova/activa nem cálculo retroactivo. Sem taxa presumida,dedução automática,importação,apuramento integral ou submissãoAT. P080/P084/P085 pendentes. L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.",
"qa_acceptance_status": "demonstrated_QA_not_installed",
"qa_acceptance_counts": {
"delivered": 65,
"QA": 1,
"functional_pending": 66,
"documentary": 1,
"total": 133
},
"G5": {
"delivered": 3,
"QA": 1,
"functional_pending": 3
},
"limits": "2026/MZN;P086 é não aplicação da antiga14(2)(c),eliminada pelo Aviso2017,e continuidade deliberada na aquisição normal; não é isenção nova/activa nem cálculo retroactivo. Sem taxa presumida,dedução automática,importação,apuramento integral ou submissãoAT. P080/P084/P085 pendentes. L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas."
"delivery_followup": {
"served_commit": "6f056359df4231f9e1802922782b21263a8dae0b",
"record": "iva_l1_g5b_homologation_20261024",
"receipt": "l1-g5b-delivery-20261024.json"
}
}
@@ -0,0 +1,194 @@
{
"key": "iva_l1_g6a_P049_P051_import_exemptions_QA_demonstrated_20261024",
"status": "demonstrated_QA_not_installed",
"candidate": "965da2642627ad1e484d52587e07b4a60cae6af2",
"base": "e99ea1d0",
"homologation": "6f056359/e99ea1d0",
"group": "G6A",
"branches": {
"AUD-SIM-L1-P049": "reimport_same_state",
"AUD-SIM-L1-P051": "central_bank_gold"
},
"branch_count": 2,
"source": {
"reference": "CIVA12(1)(d/f),Lei13/2016PDF11/p1426(269),visual inspected;2022PDF2/p2252(26) and2025PDF12–13/p2180(12–13) retain d/f",
"acceptance": "Tempo08/10/2026;no new generic authenticity/legal approval",
"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": "e99ea1d0137543ca3fc37cb2c79732f3bb7c3edf",
"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-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-g5b-delivery-20261024.json;6f056359/e99ea1d0;174tables/369files/29published/28relations/408geometries;no schema/content/permissions changes",
"frozen_fixture_sha256": "96f239cd9edd6d522447ce16e7b6dc32610f836a9d25dc8ea8789fb3042cf6f2",
"sales_books": 20,
"purchase_books": 1,
"preserved_open": [
"P080",
"P084",
"P085"
],
"counts": {
"delivered": 66,
"QA": 0,
"functional_pending": 66,
"documentary": 1,
"total": 133
}
},
"tests": {
"frontend_new": 5,
"affected_report_tests": 14,
"frontend_total": 19,
"API_tests": 1,
"API_assertions": 20,
"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 passed,temporary file only",
"UI": {
"actor": "Codex",
"method": "Edge/CUA observed",
"URL": "http://127.0.0.1:18642/g6a.html",
"observed": [
"unknown condition ->indeterminate",
"failed condition ->nonapplication,normal tax unknown",
"affirmative conditions ->exempt import VAT0.00",
"switch treatment ->only applicable questions;answers,document,1000MZN retained",
"save/recover/report ->P049/P051,Manica,2026-12,documents,sources",
"three previous UI results;20salesbooks and1purchasebook identical"
],
"manual_Tempo_reply": null,
"screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g6a-imports-20261024\\qa-recovered-report.png",
"screenshot_sha256": "e6914778f6513e2ea22850d1b30a79ff3592e0c8085cb09c38f1ffb23541cf9c"
},
"Word_PDF": "Existing exporter proofs reused;no new pagination claim"
},
"implementation": {
"optional_snapshot_key": "importExemptions",
"no_schema_change": true,
"legacy_books": "no additional required fields;20sales and1purchase unchanged/current",
"data_conditions": "per branch;unknown != false;no ordinary rate inferred",
"value": "declared/previsional value preserved,optional;no invented customs taxable base",
"period": "explicit import period independent from supporting document date and sales calendar",
"history": "explicit classification archives previous result;edits keep historical state;reports show only applicable conditions",
"roll_back": "l1-g6a-readonly-rollback-20261024.patch checked,not applied;readers/history/reports retained"
},
"counts": {
"delivered": 66,
"QA": 2,
"functional_pending": 64,
"documentary": 1,
"total": 133
},
"G6": {
"delivered": 0,
"QA": 2,
"functional_pending": 13
},
"limits": "2026/MZN;classificação L1 de12(1)(d/f),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."
}
@@ -1,9 +1,9 @@
{
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
"status": "installed_delta_verified_partial_L1",
"candidate": "689a4c93c33cd737c6fc90823533b34b5219b5d3",
"base": "d3e9f373",
"last_known_remote_main": "69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75",
"fresh_destination_preflight": "required before installation;not performed in this QA passage",
"fresh_destination_preflight": "completed authenticated69f2e365 before installation;see authenticated_preflight",
"coverage": {
"group": "G5B",
"branches": {
@@ -27,8 +27,8 @@
}
],
"counts_current": {
"delivered": 65,
"QA": 1,
"delivered": 66,
"QA": 0,
"functional_pending": 66,
"documentary": 1,
"total": 133
@@ -94,8 +94,8 @@
"active_database_writes": 0
}
},
"activation": "Existing Git FF/webhook/installer when delivery is undertaken;no migrations/imports/permission changes or synthetic active tests",
"served_revision_and_delta": "pending installation;homologation remains69f2e365/d3e9f373",
"activation": "Git FF/webhook/installer completed;zero migrations/imports",
"served_revision_and_delta": "verified",
"limits": "2026/MZN;P086 é não aplicação da antiga14(2)(c),eliminada pelo Aviso2017,e continuidade deliberada na aquisição normal; não é isenção nova/activa nem cálculo retroactivo. Sem taxa presumida,dedução automática,importação,apuramento integral ou submissãoAT. P080/P084/P085 pendentes. L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.",
"L1_complete": false,
"P001": "05/06 only",
@@ -144,5 +144,159 @@
"pipeline_sha256": "adec1c17654f3a8658b83b134f1e75f95391b235738552721906c3236e388604"
},
"authenticated_destination": "Fresh read confirmed69f2e365;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_G5B": false
},
"treatment": "Disposição eliminada e encaminhamento para o regime aplicável; não é isenção disponível",
"rectification_reference": "Aviso da Assembleia da República, BR n.º89, I Série,08/06/2017,PDF1/p.569: c) eliminado",
"served_commit": "6f056359df4231f9e1802922782b21263a8dae0b",
"installation": {
"protected": {
"installed": {
"status": "installed",
"commit": "6f056359df4231f9e1802922782b21263a8dae0b",
"release": "/var/www/investmoz-homologacao/releases/6f056359df4231f9e1802922782b21263a8dae0b-5bf30d7b",
"previous_release": "/var/www/investmoz-homologacao/releases/69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75-ac55d458",
"database_migrations": 0,
"content_imports": 0
},
"runtime_files_verified": 3,
"persistent_files_and_env_verified": 369,
"tables_compared": 174,
"changed_tables": {
"cache": {
"before": {
"rows": 105,
"checksum": "674479c6ce0897731d51e4ad2409f060"
},
"after": {
"rows": 105,
"checksum": "e278d0e2e0e8561bb0b474d138226a35"
}
},
"sessions": {
"before": {
"rows": 26,
"checksum": "c7dfaaba275b5b5758caa2aad1136c72"
},
"after": {
"rows": 27,
"checksum": "d0f71dec810ed1bb8a7112773d53bf34"
}
}
},
"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": "6f056359df4231f9e1802922782b21263a8dae0b",
"branch": "main",
"built_at": "2026-10-24T17:10:20.021314+00:00",
"manifest_sha256": "0e2ee85ab107f34efcc9c589328a0635d2d6021ba28ee387e02b0654aeab85db"
},
"manifest_hash_matches": true,
"compiled_delta_markers": {
"acquisition-continuity/1": [
"assets/project-dossier-weQkfpPV.js"
],
"former_exploration_exemption": [
"assets/services-DjZF4TLj.js",
"assets/project-dossier-weQkfpPV.js"
],
"acquisitionTreatment": [
"assets/services-DjZF4TLj.js",
"assets/project-dossier-weQkfpPV.js"
],
"acquisitionTreatmentOrigin": [
"assets/services-DjZF4TLj.js",
"assets/project-dossier-weQkfpPV.js"
],
"c) eliminado": [
"assets/services-DjZF4TLj.js",
"assets/project-dossier-weQkfpPV.js"
]
},
"assets": [
{
"file": "assets/project-dossier-document-DjMS3OYA.js",
"status": 200,
"sha256": "b50a5e08e323454b8c651baba303a86634620580bc103952d27ea21ff651d431"
},
{
"file": "assets/simulation-form-CPZAFZU3.js",
"status": 200,
"sha256": "c6bcf64e60a5eeac0cafe3dc055dc5544162f21942ee08b34d51bc6d52947567"
},
{
"file": "assets/services-DjZF4TLj.js",
"status": 200,
"sha256": "f45efdeb6764272a00ec2ead6f1052ab77b199f3af2d6ade54c6dbeea413fc35"
},
{
"file": "assets/project-dossier-weQkfpPV.js",
"status": 200,
"sha256": "8ded1cc5a561a72cb1003097ece6edfe28760b9677eec09bb461390334260b31"
}
],
"simulator_status": 200,
"simulator_entry": "assets/app-DABOgBTI.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": "6f056359df4231f9e1802922782b21263a8dae0b",
"release": "/var/www/investmoz-homologacao/releases/6f056359df4231f9e1802922782b21263a8dae0b-5bf30d7b",
"previous_release": "/var/www/investmoz-homologacao/releases/69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75-ac55d458",
"database_migrations": 0,
"content_imports": 0
},
"latest_report": {
"status": "installed",
"commit": "6f056359df4231f9e1802922782b21263a8dae0b",
"release": "/var/www/investmoz-homologacao/releases/6f056359df4231f9e1802922782b21263a8dae0b-5bf30d7b",
"previous_release": "/var/www/investmoz-homologacao/releases/69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75-ac55d458",
"database_migrations": 0,
"content_imports": 0,
"requested_commits": [
"6f056359df4231f9e1802922782b21263a8dae0b"
],
"finished_at": "2026-10-24T17:10:22.445560+00:00"
},
"log_file": "1792861731226475463.log",
"summaries": [
"OK (1 test, 3106 assertions)",
"built in 25.29s",
"OK (59 tests, 317 assertions)",
"# tests 300",
"# pass 300",
"# fail 0"
],
"log_bytes": 115761
},
"rollback_executed": false
}
}
@@ -0,0 +1,147 @@
{
"status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore",
"candidate": "965da2642627ad1e484d52587e07b4a60cae6af2",
"base": "e99ea1d0",
"last_known_remote_main": "6f056359",
"coverage": {
"AUD-SIM-L1-P049": "reimport_same_state",
"AUD-SIM-L1-P051": "central_bank_gold"
},
"runtime_delta": [
{
"path": "resources/js/lib/iva-import-exemptions.ts",
"sha256_LF": "43d823a594c5ea98801b69597fbd660effd90596709dec3a84787b7b11eef1c8"
},
{
"path": "resources/js/components/simulation-import-exemptions.tsx",
"sha256_LF": "20f35daf9573e9ff0813ee7b0e3f4ad19eb0d47eabb0d661af845a915e76340e"
},
{
"path": "resources/js/components/simulation-monthly-iva.tsx",
"sha256_LF": "a41275ce37268345d137745572c858ff3c989e392af337235f6b8b5e7dc38b86"
},
{
"path": "resources/js/lib/project-dossier.ts",
"sha256_LF": "ac75a0e24fdf31d17a90b3c9ecec338d6f0e309bd302d1254da04c2eacc493b3"
}
],
"counts_current": {
"delivered": 66,
"QA": 2,
"functional_pending": 64,
"documentary": 1,
"total": 133
},
"counts_after_delivery_only": {
"delivered": 68,
"QA": 0,
"functional_pending": 64,
"documentary": 1,
"total": 133
},
"proofs_reused": {
"frontend_new": 5,
"affected_report_tests": 14,
"frontend_total": 19,
"API_tests": 1,
"API_assertions": 20,
"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 passed,temporary file only",
"UI": {
"actor": "Codex",
"method": "Edge/CUA observed",
"URL": "http://127.0.0.1:18642/g6a.html",
"observed": [
"unknown condition ->indeterminate",
"failed condition ->nonapplication,normal tax unknown",
"affirmative conditions ->exempt import VAT0.00",
"switch treatment ->only applicable questions;answers,document,1000MZN retained",
"save/recover/report ->P049/P051,Manica,2026-12,documents,sources",
"three previous UI results;20salesbooks and1purchasebook identical"
],
"manual_Tempo_reply": null,
"screenshot": "C:\\laragon\\www\\portal-investidor\\outputs\\iva-l1-g6a-imports-20261024\\qa-recovered-report.png",
"screenshot_sha256": "e6914778f6513e2ea22850d1b30a79ff3592e0c8085cb09c38f1ffb23541cf9c"
},
"Word_PDF": "Existing exporter proofs reused;no new pagination claim"
},
"rollback": "l1-g6a-readonly-rollback-20261024.patch checked;not applied",
"backup_restore": {
"backup": {
"stage": "/var/backups/investmoz-l1-g6a-delivery-20261024/backup",
"target": {
"database": "teste_investidor",
"port": 5432
},
"tables": 174,
"files_verified": 369,
"dump_sha256": "93d9e16845af367cab80ee4d646cc679b9668495c822d26ed6157caeb74da3fb",
"files_sha256": "928f06a3795206702dbdc3ebd3ef76f9e345a199c1ec81f5abfa97a40154ba58",
"restore_verified": false
},
"restore": {
"restore_verified": true,
"tables_verified": 174,
"container_network": "none",
"database": "l1_g6a_restore_20261024",
"port": 55441,
"source_dump_sha256": "93d9e16845af367cab80ee4d646cc679b9668495c822d26ed6157caeb74da3fb",
"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 remains6f056359",
"limits": "2026/MZN;classificação L1 de12(1)(d/f),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": "6f056359df4231f9e1802922782b21263a8dae0b",
"release": "/var/www/investmoz-homologacao/releases/6f056359df4231f9e1802922782b21263a8dae0b-5bf30d7b",
"previous_release": "/var/www/investmoz-homologacao/releases/69f2e365bf4ebd509ec2e080dd0bf1b7717d7a75-ac55d458",
"database_migrations": 0,
"content_imports": 0
},
"current_link": "/var/www/investmoz-homologacao/releases/6f056359df4231f9e1802922782b21263a8dae0b-5bf30d7b",
"release_revision": {
"commit": "6f056359df4231f9e1802922782b21263a8dae0b",
"branch": "main",
"built_at": "2026-10-24T17:10:20.021314+00:00",
"manifest_sha256": "0e2ee85ab107f34efcc9c589328a0635d2d6021ba28ee387e02b0654aeab85db"
},
"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 confirmed6f056359;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
@@ -48,6 +48,7 @@
function key(draft:Record<string,unknown>,book:ImportExemptionBook):string {return JSON.stringify({version:importExemptionVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},currency:draft.currency,rows:book.rows});}
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:importExemptionSource,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 — G6A/P049/P051 demonstrado em QA
**P049→reimport_same_state /12(1)(d); P051→central_bank_gold /12(1)(f)**,candidata`965da264`,registo`iva_l1_g6a_P049_P051_import_exemptions_QA_demonstrated_20261024`. Dois ramos,com condições próprias,identificadas na preparação abaixo. Classificação de IVA na importação em2026/MZN,não uma venda interna,base aduaneira,liquidação de direitos ou dedução noModeloA. Provas e originais anteriores conservados;P086 continua disposição eliminada/encaminhamento normal,com fonteBR89/2017 preservada.
Livro opcional no snapshot privado existente,sem mudança de schema/permissões. Condições desconhecidas→indeterminado;negativas→não aplicação desta isenção,sem presumir taxa;afirmativas com contexto→IVAisento0.00MZN. Campos próprios adaptáveis;respostas de outros ramos conservadas,sem as exibir como condições aplicáveis no relatório. Documento/previsão,importador,bens,período e pressupostos rastreáveis. Mês da importação independente da data do documento de suporte e de vendas;valor declarado opcional não determina classificação nem baseaduaneira. Estas opções técnicas evitam dependências artificiais,sem nova exigência daTempo. Resultado anterior preservado;classificar novamente arquiva a versão anterior.
5testesnovos+14testes de relatório afectados aprovados;APIprivada1teste/20asserções em*_test:55441,rollback;tipos/produção/QAaprovados,avisosexistentes deplugins/chunks. UIobservadaCodex/Edge-CUA:por indicar→indeterminado,não→não aplicação,sim→isenção;mudança de ramo conserva1000MZN/documento/respostas;Guardar→Recuperar→Relatório comP049/P051,opportunity330/Manica/2026-12,fontes e3versõesanteriores. Preservados20livrosvendas e1aquisiçõesG5B,incluindo resultados/actuais,histórico eBR89,sem recálculo. ExportadoresWord/PDF aceites reutilizados,sem alegar nova paginação ou conferência manualTempo.
**66entregues+2QA+64funcionaispendentes+P001=133.** G6:2QA/13pendentes. Homologação6f056359/e99ea1d0 inalterada. [Manifesto preparado](../simulations/l1-g6a-delivery-20261024.json),contenção de novas classificações conferida,não aplicada;leitores/histórico/relatório mantidos. Antes de instalação continuam necessários destino/main autenticados frescos e backup/restauro isolado;esta passagem não fezpush nem alterou oactivo. **P080/P084/P085 explicitamente abertos;L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.**
## 24/10/2026 — preparação G6A e preservação antes dos testes
Inventário existente: **66ramos entregues**, conforme matriz e recibo G5B6f056359/e99ea1d0; sem perda confirmada. Reutilizadas provas da comparação código/schema/dados/configuração/permissões:174tabelas/369ficheiros,29fichas/28relações/408geometrias. Nesta preparação não há alteração nem novos testes no activo. Congelados20livros de vendas e1livro de aquisições aceiteG5B,com resultado/histórico/documento e fonte2017,sem recálculo;fixtureiva-g5b-inputs.json. Nenhuma redução de âmbito prevista. **P080/P084/P085 explicitamente abertos.** Saldo66entregues+66funcionaispendentes+P001=133,sem candidataQA nova demonstrada.
G6A delimita **P049→reimport_same_state /12(1)(d)** e **P051→central_bank_gold /12(1)(f)**. Página oficial2016PDF11/p1426(269) conferida visualmente: na reimportação,mesmo exportador,mesmo estado e isenção de direitos;no ouro,importação efectuada pelo Banco de Moçambique,sem copiar a condição de ouro não trabalhado da venda13(1)(r). Redacções2022PDF2/p2252(26) e2025PDF12–13/p2180(12–13) mantêm d/f;rectificação2017 eLei3/2025 não alteram estas alíneas. Inventário dos seis originais e inventários gerais existentes reutilizados. Fontes oficiais aceites pelaTempo08/10;sem nova autenticação jurídica genérica.
Escolha técnica: livro opcional de classificação no snapshot existente,sem mudar schema nem campos obrigatórios dos livros aceites. Condições próprias por ramo;desconhecido→indeterminado,não→não aplicação desta isenção,sim com contexto→IVA isento0.00. Fora deste fundamento não presumir taxa. Documento/previsão,período,importador,bens e fundamento factual identificados;valor declarado preservado sem definir base aduaneira,código/origem disponíveis sem nova pré-condição organizacional. DireitosaduaneirosL13 e dedução/campo11L2 mantêm âmbito próprio;classificação não altera parcelas05/06/11 nem totaisModeloA. Edições e versões conservadas,sem sobrescrever resultado;gravação/recuperação/relatório devem ser demonstrados emQA isolada. L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.
## 24/10/2026 — G5B/P086 entregue na homologação 6f056359
**P086: tratamento da disposição eliminada e encaminhamento para o regime aplicável; não é uma isenção disponível.** A Tempo aceitou a candidata689a4c93 concluída emQA e autorizou integração/disponibilização. Referência exacta preservada: **Aviso da Assembleia da República, BR n.º89, I Série,08/06/2017,PDF1/p.569**, elimina14(2)(c), «c) eliminado». Cobertura2026/MZN,sem cálculo retroactivo. A continuação expressa na aquisição normal conserva valores,documento,origem e histórico; não presume taxa nem dedução.
Gitfast-forward sobre69f2e365,sem alterações concorrentes encontradas;65ramos entregues e recibos anteriores preservados. Backup fresco e restauro real isolado sem rede:174tabelas/369ficheiros. Conferidos somente delta instalado e preservação:revisão servida,manifesto/assets,cinco marcadores,três ficheiros funcionais,simuladorHTTP200;174tabelas e369ficheiros/configuração,29fichas publicadas/28relações/408geometrias,com identidadePostgreSQL equivalente. Diferenças operacionais cache/sessões registadas;zero migrações/importações e ensaios sintéticos noactivo. ProvasQA aceites reutilizadas,sem repetir testes de aceitação ou atribuir conferência manual àTempo. Backup/release anterior conservados;contenção verificada,não aplicada.
[Manifesto/recibo](../simulations/l1-g5b-delivery-20261024.json),registo `iva_l1_g5b_homologation_20261024`. **66entregues+66funcionaispendentes+P001=133;sem candidatasQA por disponibilizar.** G5:4entregues;P080/P084/P085 abertos. **L1aberto;P001só05/06;bebidasL2/L3;Estatísticas/IAadiadas.**
## 24/10/2026 — G5B/P086 demonstrado em QA: referência eliminada e continuidade
**P086 → former_exploration_exemption → continuidade expressa pelo enquadramento normal da aquisição. Umramo**,candidata`689a4c93`,registo`iva_l1_g5b_P086_acquisition_continuity_QA_demonstrated_20261024`. Não é nova isenção,activação da alínea eliminada ou encerramento deP080/P084/P085. AvisoAR/BR89/I08-06-2017,PDF1/p569,página visual conferida,ordena eliminação14(2)(c);originais/hashes e inventário dos seisficheiros preservados. Alterações2022/2025 não reintroduzem14(2)(c) noacervo conferido. DecisãoTempo08/10aceita fonteoficial;sem segundaautenticação ou validaçãojurídicagenérica. Cobertura2026,sem apuramento retroactivo2016/2017. G5A14(1)(b/c/d) preservado.
File diff suppressed because one or more lines are too long
@@ -0,0 +1,33 @@
import { useState } from 'react';
import { importExemptionBook,importExemptionCurrent,importExemptionReportRows,importExemptionRules,importExemptionSource,newImportExemption,recordImportExemptions,saveImportExemptionBook,type ImportExemptionBook,type ImportExemptionRow } from '@/lib/iva-import-exemptions';
export function SimulationImportExemptions({draft,onChange}:{draft:Record<string,unknown>;onChange:(field:string,value:string)=>void}) {
const [error,setError]=useState('');
let book:ImportExemptionBook;
try {book=importExemptionBook(draft);}catch(cause){return <p role="alert">{String(cause)}</p>;}
const save=(next:ImportExemptionBook)=>{try {onChange('modelo_a_snapshot',saveImportExemptionBook(draft,next));setError('');}catch(cause){setError(String(cause));}};
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 — reimportação no mesmo estado / ouro pelo Banco de Moçambique</summary>
<p>Oportunidade: {String(draft.context_opportunity||'entrada geral')}. Indique apenas importações relevantes. Estes dois ramos classificam a isenção em2026/MZN; as compras internas e os seus resultados conservam-se.</p>
<p>{importExemptionSource}</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>
{book.rows.map(row=>{
const rule=importExemptionRules.find(item=>item.id===row.treatment);
return <details key={row.id} className="rounded border p-3"><summary>{row.description||'Importação por identificar'} — {row.period||'mês por indicar'}</summary>
<div className="grid gap-3 md:grid-cols-2">
<label>Ramo da importação<select className="block rounded border p-2" value={row.treatment} onChange={e=>change(row.id,{treatment:e.target.value})}><option value="">Por indicar</option>{importExemptionRules.map(item=><option key={item.id} value={item.id}>{item.label}</option>)}</select></label>
<label>Natureza dos dados<select className="block rounded border p-2" value={row.origin} onChange={e=>change(row.id,{origin:e.target.value as ImportExemptionRow['origin']})}><option value="projected">Projectados / pressupostos</option><option value="effective">Efectivos declarados</option></select></label>
{(['description','importer','declaredValue','goodsCode','originCountry','documentRef','documentDate','period','evidence'] as const).map((field,index)=><label key={field}>{['Bens importados','Importador','Valor declarado / previsão (moeda indicada)','Código aduaneiro, se disponível','País de origem, se disponível','Documento aduaneiro / referência da previsão','Data do documento / prevista','Mês da importação','Fundamento factual das condições / pressupostos'][index]}<input className="block rounded border p-2" type={field==='documentDate'?'date':field==='period'?'month':'text'} value={row[field]} onChange={e=>change(row.id,{[field]:e.target.value})}/></label>)}
<label>Moeda de origem<input className="block rounded border p-2" value={row.currency} onChange={e=>change(row.id,{currency:e.target.value})}/></label>
</div>
{rule?<fieldset><legend>Condições de{rule.article}; respostas conservadas ao mudar de ramo</legend>{rule.conditions.map(([key,label])=><label className="block" key={key}>{label}<select className="block rounded border p-2" value={row.conditions[key]??''} onChange={e=>change(row.id,{conditions:{...row.conditions,[key]:e.target.value}})}><option value="">Por indicar</option><option value="yes">Sim</option><option value="no">Não</option></select></label>)}</fieldset>:<p>Escolha o ramo para apresentar apenas as condições aplicáveis; as respostas anteriores mantêm-se.</p>}
<p>Editar não substitui o resultado anterior. Ao classificar novamente, a versão anterior passa ao histórico.</p>
</details>;
})}
{!!book.rows.length&&<button type="button" className="rounded bg-emerald-800 p-2 text-white" onClick={()=>{try {save(recordImportExemptions(draft,book));}catch(cause){setError(String(cause));}}}>Classificar importações e guardar versão</button>}
{book.result&&<><p role="status">{importExemptionCurrent(draft,book)?'Classificação correspondente às entradas guardadas.':'Entradas alteradas; classificação histórica preservada. Reveja e classifique novamente.'} {book.history?.length??0} versões anteriores.</p><dl>{importExemptionReportRows(draft).map(([,label,value,origin],index)=><div key={index}><dt className="font-semibold">{label}</dt><dd>{value}<small className="block">{origin}</small></dd></div>)}</dl></>}
</details>;
}
@@ -5,6 +5,7 @@ import { fiscalQaRows } from '@/lib/fiscal-qa-preview';
import { type ApiSimulationExecutionV1 } from '@/lib/simulation-contract';
import { SimulationModeloA } from './simulation-modelo-a';
import { SimulationAcquisitions } from './simulation-acquisitions';
import { SimulationImportExemptions } from './simulation-import-exemptions';
import { SimulationOperations } from './simulation-operations';
export function SimulationMonthlyIva({draft, busy, onCalculate, onChange}: {
@@ -87,6 +88,7 @@ export function SimulationMonthlyIva({draft, busy, onCalculate, onChange}: {
{snapshot && <details><summary>Ver fundamento e relatório da versão guardada</summary><dl>{fiscalQaRows(snapshot).map(([label,value], index) => <div key={index}><dt className="font-semibold">{label}</dt><dd>{value}</dd></div>)}</dl></details>}
<SimulationOperations draft={draft} onChange={onChange} />
<SimulationAcquisitions draft={draft} onChange={onChange} />
<SimulationImportExemptions draft={draft} onChange={onChange} />
<SimulationModeloA draft={draft} />
</section>;
}
+61
View File
@@ -0,0 +1,61 @@
import { acquisitionScope } from './iva-acquisitions.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 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']]},
] as const;
type Condition = 'sameExporter'|'sameState'|'customsExempt'|'gold'|'centralBank';
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[]};
export type ImportExemptionBook = {rows:ImportExemptionRow[];result?:ImportExemptionCalculation;history?:ImportExemptionCalculation[]};
type Store = {version:1;books:Record<string,unknown>;importExemptions?:Record<string,ImportExemptionBook>;[key:string]:unknown};
function store(draft:Record<string,unknown>):Store {
const value:Store=draft.modelo_a_snapshot?JSON.parse(String(draft.modelo_a_snapshot)):{version:1,books:{}};
if(value?.version!==1||!value.books||typeof value.books!=='object'||Array.isArray(value.books))throw new Error('Dados fiscais não recuperáveis; originais preservados, sem substituição.');
if(value.importExemptions!==undefined&&(!value.importExemptions||typeof value.importExemptions!=='object'||Array.isArray(value.importExemptions)))throw new Error('Importações guardadas não recuperáveis; originais preservados.');
for(const book of Object.values(value.importExemptions??{})) {
if(!book||!Array.isArray(book.rows)||(book.history!==undefined&&!Array.isArray(book.history))||book.rows.some(row=>!row||['id','treatment','description','period','origin','currency','declaredValue','goodsCode','originCountry','importer','documentRef','documentDate','evidence'].some(k=>typeof row[k as keyof ImportExemptionRow]!=='string')||!row.conditions||typeof row.conditions!=='object'||Array.isArray(row.conditions)))throw new Error('Linhas de importação não recuperáveis; sem substituição por lista vazia.');
}
return value;
}
export function importExemptionBook(draft:Record<string,unknown>):ImportExemptionBook {return store(draft).importExemptions?.[acquisitionScope(draft)]??{rows:[]};}
export function saveImportExemptionBook(draft:Record<string,unknown>,book:ImportExemptionBook):string {
const current=store(draft);return JSON.stringify({...current,importExemptions:{...current.importExemptions,[acquisitionScope(draft)]:book}});
}
export function newImportExemption(id:string,currency:string):ImportExemptionRow {return {id,treatment:'',description:'',period:'',origin:'projected',currency,declaredValue:'',goodsCode:'',originCountry:'',importer:'',documentRef:'',documentDate:'',evidence:'',conditions:{}};}
function validDate(value:string):boolean {const d=new Date(value+'T00:00:00Z');return /^\d{4}-\d{2}-\d{2}$/.test(value)&&Number.isFinite(d.getTime())&&d.toISOString().slice(0,10)===value;}
export function evaluateImportExemption(row:ImportExemptionRow,currency:unknown):ImportResult {
const result:ImportResult={id:row.id,status:'indeterminate',importVat:null,reason:''};
const stop=(reason:string,status:ImportResult['status']='indeterminate')=>({...result,status,reason});
const rule=importExemptionRules.find(r=>r.id===row.treatment);
if(!rule)return stop('Escolha o ramo aplicável; referência desconhecida ou em falta não concede isenção.');
if(currency!=='MZN'||row.currency!==currency)return stop('Moeda fora do âmbito MZN ou divergente do projecto; valores conservados, sem conversão.');
if(!/^2026-(0[1-9]|1[0-2])$/.test(row.period))return stop('Indique o período da importação em2026; não é inferido do mês do orçamento.');
if(!['projected','effective'].includes(row.origin))return stop('Indique dados efectivos ou pressupostos de projecção.');
const failed=rule.conditions.filter(([key])=>row.conditions[key]==='no');
if(failed.length)return stop('Não se aplica esta isenção: '+failed.map(([,label])=>label).join('; ')+'. O IVA fora deste fundamento permanece por enquadrar, sem taxa presumida.','not_applicable');
const missing=rule.conditions.filter(([key])=>row.conditions[key]!=='yes');
if(missing.length)return stop('Condições por indicar: '+missing.map(([,label])=>label).join('; ')+'. Desconhecido não significa não aplicável nem IVA zero.');
if(!row.description.trim()||!row.importer.trim()||!row.documentRef.trim()||!row.evidence.trim())return stop('Identifique bens, importador, documento aduaneiro ou previsão e o fundamento factual das condições; não é exigida segunda validação da fonte oficial.');
if(!validDate(row.documentDate))return stop('Data do documento/previsão em falta ou inválida; o período da importação é indicado separadamente.');
if(row.declaredValue.trim()&&!/^\d{1,15}(\.\d{1,6})?$/.test(row.declaredValue.trim()))return stop('Valor declarado/previsional inválido; conserve o original e reveja, sem presumir base aduaneira ou imposto normal.');
return {...result,status:'exempt',importVat:'0.00',reason:`Isenção ${rule.article} nas condições ${row.origin==='projected'?'expressamente assumidas na projecção':'efectivas declaradas'}. IVA na importação:0.00MZN por isenção, sem inferir direitos aduaneiros, certificação pela AT ou dedução.`};
}
function key(draft:Record<string,unknown>,book:ImportExemptionBook):string {return JSON.stringify({version:importExemptionVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},currency:draft.currency,rows:book.rows});}
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 {
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:importExemptionSource,inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateImportExemption(row,draft.currency))};
return {...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};
}
export function importExemptionReportRows(draft:Record<string,unknown>):Array<[string,string,string,string]> {
try {
const book=importExemptionBook(draft),result=book.result;if(!result)return [];
const context=`${result.opportunity}; ${result.location}; ${importExemptionCurrent(draft,book)?'Resultado actual':'Entradas alteradas; resultado histórico conservado'}; versão${result.revision}; ${result.calculatedAt}; ${result.source}`;
return result.inputs.map((row,index)=>['IVA mensal',`Importação ${importExemptionRules.find(r=>r.id===row.treatment)?.branch??row.treatment} — ${row.period} — ${row.id}`,`${row.description}; IVA na importação: ${result.rows[index].importVat??'Indeterminado'} ${row.currency}; ${result.rows[index].reason}`,`${context}; ${row.origin==='projected'?'Projecção':'Dados efectivos declarados'}; importador ${row.importer}; valor declarado/previsional ${row.declaredValue||'Não informado'} ${row.currency}, sem fixar base aduaneira; código ${row.goodsCode||'não indicado'}; origem ${row.originCountry||'não indicada'}; documento ${row.documentRef},${row.documentDate}; condições ${(importExemptionRules.find(rule=>rule.id===row.treatment)?.conditions??[]).map(([key,label])=>label+': '+(row.conditions[key]==='yes'?'Sim':row.conditions[key]==='no'?'Não':'Por indicar')).join('; ')}; fundamento factual ${row.evidence}; campo11 e totaisModeloA não preenchidos por esta classificação.`]);
}catch {return [['IVA mensal','Importações','Dados não recuperáveis','Originais preservados; sem substituir por zero.']];}
}
+2
View File
@@ -4,6 +4,7 @@ import { investmentLandPreparation } from './investment-land-preparation.ts';
import { monthlyIvaInput, monthlyIvaKey, readMonthlyIvaRecord, readMonthlyIvaSettings } from './monthly-iva.ts';
import { modeloAPurchaseReferences } from './iva-modelo-a.ts';
import { acquisitionReportRows } from './iva-acquisitions.ts';
import { importExemptionReportRows } from './iva-import-exemptions.ts';
import { salesReportRows } from './iva-operations.ts';
import { fiscalQaRows } from './fiscal-qa-preview.ts';
import { csvCellWithDelimiter } from './csv.js';
@@ -617,6 +618,7 @@ export function buildProjectDossierRows(
]);
}
rows.push(...acquisitionReportRows(draft));
rows.push(...importExemptionReportRows(draft));
const operationRows = salesReportRows(draft);
rows.push(...operationRows);
if (draft.monthly_iva_snapshot) {
@@ -0,0 +1,46 @@
<?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 IvaImportExemptionsDraftTest 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-g6a-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:330', $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:330'];
$this->assertCount(2, $book['rows']);
$this->assertSame(['reimport_same_state', 'central_bank_gold'], array_column($book['rows'], 'treatment'));
$this->assertSame(['0.00', '0.00'], array_column($book['result']['rows'], 'importVat'));
$this->assertSame(['exempt', 'exempt'], array_column($book['result']['rows'], 'status'));
$this->assertSame('2026-12', $book['rows'][0]['period']);
$this->assertSame('1000', $book['rows'][0]['declaredValue']);
$this->assertSame('SYNTHETIC QA G6A reimport_same_state', $book['rows'][0]['documentRef']);
$this->assertStringContainsString('12(1)(d/f)', $book['result']['source']);
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-g5b-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->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-g6a-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
@@ -0,0 +1,56 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import { newImportExemption,evaluateImportExemption,recordImportExemptions,saveImportExemptionBook,importExemptionBook,importExemptionCurrent,importExemptionReportRows } from '../../resources/js/lib/iva-import-exemptions.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-g5b-inputs.json',import.meta.url),'utf8'));
const row=(treatment='reimport_same_state')=>({...newImportExemption('g6a-'+treatment,'MZN'),treatment,description:treatment==='reimport_same_state'?'SYNTHETIC QA equipamento reimportado':'SYNTHETIC QA ouro importado',period:'2026-12',declaredValue:'1000',importer:treatment==='reimport_same_state'?'SYNTHETIC QA exportador original':'SYNTHETIC QA Banco de Moçambique',documentRef:'SYNTHETIC QA G6A '+treatment,documentDate:'2026-12-11',evidence:'SYNTHETIC QA pressupostos expressos; não é documento real',conditions:{sameExporter:'yes',sameState:'yes',customsExempt:'yes',gold:'yes',centralBank:'yes'}});
const draft=()=>({...structuredClone(frozen),context_opportunity:'opportunity:330',project_title:'SYNTHETIC QA — G6A / Importações'});
test('P049 requires all three own conditions;unknown differs from failed and neither produces normal tax or exempt zero',()=>{
const input=row();assert.equal(evaluateImportExemption(input,'MZN').importVat,'0.00');
for(const key of ['sameExporter','sameState','customsExempt'])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'},{documentDate:'2026-02-30'},{documentRef:''},{evidence:''},{declaredValue:'-1'},{origin:'unknown'},{treatment:'unknown'}])assert.equal(evaluateImportExemption({...input,...patch},'MZN').importVat,null);
assert.equal(evaluateImportExemption({...input,documentDate:'2026-11-11',declaredValue:''},'MZN').importVat,'0.00');
assert.deepEqual(input,row());assert.equal(evaluateImportExemption(input,'USD').importVat,null);
});
test('P051 uses gold and actual central-bank importer;does not import reimport conditions or unworked-form restriction from domestic sales',()=>{
const input={...row('central_bank_gold'),description:'SYNTHETIC QA ouro trabalhado; classificação de importação',conditions:{gold:'yes',centralBank:'yes'}};
assert.equal(evaluateImportExemption(input,'MZN').status,'exempt');
for(const key of ['gold','centralBank']){
assert.equal(evaluateImportExemption({...input,conditions:{...input.conditions,[key]:''}},'MZN').status,'indeterminate');
assert.equal(evaluateImportExemption({...input,conditions:{...input.conditions,[key]:'no'}},'MZN').status,'not_applicable');
}
assert.equal(evaluateImportExemption({...input,conditions:{...input.conditions,customsExempt:'no'}},'MZN').importVat,'0.00');
});
test('explicit classification archives prior inputs/results;editing currency,opportunity,location or conditions marks result historical',()=>{
const d=draft();let book=recordImportExemptions(d,{rows:[{...row(),conditions:{sameExporter:'yes',sameState:'yes'}}]});assert.equal(book.result.rows[0].importVat,null);
const original=structuredClone(book);book=recordImportExemptions(d,{...book,rows:[row()]});assert.deepEqual(book.history,[original.result]);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:[{...row(),conditions:{...row().conditions,sameState:'no'}}]}));
assert.throws(()=>recordImportExemptions(d,{rows:[row(),row()]}),/distintos/);
});
test('save/recovery/report preserve20sales and acceptedP086 purchase;classifying import leaves all ModeloA fields untouched',()=>{
const d=draft(),prior=JSON.parse(d.modelo_a_snapshot);
let book=recordImportExemptions(d,{rows:[row(),row('central_bank_gold')]});
d.modelo_a_snapshot=saveImportExemptionBook(d,book);assert.deepEqual(importExemptionBook(JSON.parse(JSON.stringify(d))),book);
const next=JSON.parse(d.modelo_a_snapshot);assert.deepEqual(next.salesOperations,prior.salesOperations);assert.deepEqual(next.books,prior.books);
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']));
const report=JSON.stringify(createProjectDossierReport(d,{selectedSections:new Set(['finance']),version:'QA G6A'}));
for(const token of ['P049','P051','2026-12','opportunity:330','Manica','SYNTHETIC QA G6A','0.00','12(1)(d/f)','campo11','sem fixar base aduaneira'])assert.ok(report.includes(token),token);
assert.equal(importExemptionReportRows({...d,context_opportunity:'opportunity:331'}).length,0);
if(process.env.IVA_G6A_CALCULATED)fs.writeFileSync(process.env.IVA_G6A_CALCULATED,JSON.stringify(d));
});
test('old snapshots need no import book;corrupt import data cannot erase originals',()=>{
assert.deepEqual(importExemptionBook(draft()),{rows:[]});
const d=draft(),data=JSON.parse(d.modelo_a_snapshot);data.importExemptions=[];d.modelo_a_snapshot=JSON.stringify(data);const original=d.modelo_a_snapshot;assert.throws(()=>importExemptionBook(d),/preservados/);assert.equal(d.modelo_a_snapshot,original);
});