diff --git a/docs/investmoz/simulations/l1-secondhand-delivery-20261025.json b/docs/investmoz/simulations/l1-secondhand-delivery-20261025.json new file mode 100644 index 00000000..1c863f40 --- /dev/null +++ b/docs/investmoz/simulations/l1-secondhand-delivery-20261025.json @@ -0,0 +1,143 @@ +{ + "status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore", + "candidate": "0ebb20c86a8cfcee9fae56c38f6bfdc6b2ab80ab", + "base_installed": "6c12aabb3ac7f8296025a2af0408390bfe292bdb", + "coverage_complete_branches": { + "AUD-SIM-L1-P092": [ + "reseller_margin" + ], + "AUD-SIM-L1-P093": [ + "auction_margin" + ], + "AUD-SIM-L1-P125": [ + "used_goods", + "art", + "collection", + "antique" + ] + }, + "branch_count_complete": 3, + "treatment_count": 2, + "category_count": 4, + "QA_example_count": 8, + "runtime_delta": [ + { + "path": "resources/js/lib/iva-secondhand.ts", + "sha256_LF": "de9cab0f8685c0be1072ce0b8b5ae98865383fa52f4487ecb62514ddb28d6fdc" + }, + { + "path": "resources/js/components/simulation-secondhand.tsx", + "sha256_LF": "7a715a05635137d3b7b8a1eb3d554646c4553430904613235199fc6a254cec20" + }, + { + "path": "resources/js/components/simulation-monthly-iva.tsx", + "sha256_LF": "338d5c4b9b60b2be6b3f059c543c92127222f621424854cba9a19651d86d2967" + }, + { + "path": "resources/js/lib/project-dossier.ts", + "sha256_LF": "fe0b12b2acc5d1a59c862abf6c96e2e09c51193fc2e090e475dc0ec8673e23c9" + } + ], + "counts_before": { + "delivered": 111, + "QA": 3, + "functional_pending": 18, + "documentary": 1, + "total": 133 + }, + "counts_current": { + "delivered": 111, + "QA": 3, + "functional_pending": 18, + "documentary": 1, + "total": 133 + }, + "counts_after_delivery": { + "delivered": 114, + "QA": 0, + "functional_pending": 18, + "documentary": 1, + "total": 133 + }, + "QA_proofs_reused": [ + "iva-l1-secondhand-qa-20261025.json" + ], + "authorization": "Tempo explicitly requests one joint delivery of0ebb20c8,P092/P093/P125,preserving concurrent changes and installeddelta only", + "scope": "2026/MZN,transmissões internas tributáveis e aquisição nacional com qualidade do fornecedor/comitente demonstrada. Duas fórmulas, quatro categorias, oito exemplos e três ramos; uma operação individual, sem dupla contagem. Apenas classificação/base:sem IVA calculado,nova dedução,campo11,regularização ou totaisModeloA. IVA identificado no leilão é componente referenciada. Exportação isenta e opção normal separadas; origens legadas35/42 permanecem indeterminadas.", + "source": "CIVA Lei13/2016:3(3)g/3(6),PDF7,p1426(265);15(2)f/g,PDF13,p1426(271). RIVA Decreto7/2008,BR16-I de16/04/2008,arts47–49,PDF8–9,p106–107. Lei22/2022 PDF3 mantém15f/g e fixa17(1)16%. Lei10/2025 não altera15/17 e revoga regimes35/42;referência antiga não os reactiva. Rectificação2017 sem alteração destas disposições.", + "meaning": { + "P092": "Revendedor: margem individual positiva da contraprestação total com IVA menos preço de compra justificado; dividir por 1.16 e arredondar a base à unidade. Perda conservada no bem, sem compensação entre transmissões. Opção pelo regime normal fica separada.", + "P093": "Organizador em nome próprio por conta do comitente, contrato de comissão e venda em leilão: base = facturado ao comprador menos líquido do comitente menos IVA próprio identificado. Líquido = adjudicação menos comissão. IVA desconhecido não é zero.", + "P125": "Classificação própria: bem usado reutilizável, arte, colecção ou antiguidade superior a 100 anos; critérios de 3(6) conservados. Categoria identificada não activa automaticamente a margem. Tiragem limitada a 200 exemplares e cerâmica única executada/assinada pelo artista nos percursos respectivos." + }, + "classification_margin_separation": "P125 classifies goods;P092/P093 independently require eligible supplier/principal,territorial and regimeconditions;no automaticmargineligibility", + "preservation": "111priorclosures andpartialP084/P085 preserved;acceptedperbranchQA reused;one integration/backup/realisolatedrestore/check forwhole set", + "partial_P084_P085": "Preparation/conditional simulation only;benefits pending;no closure", + "limits": "L1aberto;P00105/06;P121digital/P084/P085pendentes;bebidasL2/L3;Estatísticas/IAadiadas", + "containment": "l1-secondhand-readonly-rollback-20261025.patch,checked only,not applied;blocks newP092/P093/P125calculations,preserves readers/history/otherbranches", + "authenticated_preflight": { + "installed": { + "status": "installed", + "commit": "6c12aabb3ac7f8296025a2af0408390bfe292bdb", + "release": "/var/www/investmoz-homologacao/releases/6c12aabb3ac7f8296025a2af0408390bfe292bdb-4c33615a", + "previous_release": "/var/www/investmoz-homologacao/releases/63cc336787cade92fb7ee5b2b2d407308a0cf66b-a32af166", + "database_migrations": 0, + "content_imports": 0 + }, + "current_link": "/var/www/investmoz-homologacao/releases/6c12aabb3ac7f8296025a2af0408390bfe292bdb-4c33615a", + "release_revision": { + "commit": "6c12aabb3ac7f8296025a2af0408390bfe292bdb", + "branch": "main", + "built_at": "2026-10-24T22:19:07.102372+00:00", + "manifest_sha256": "91a95647c3666b2dc9a322fbf7534e055c616872c791920d2cc004234c1b0d25" + }, + "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" + }, + "backup_restore": { + "backup": { + "stage": "/var/backups/investmoz-l1-secondhand-delivery-20261025/backup", + "target": { + "database": "teste_investidor", + "port": 5432 + }, + "tables": 174, + "files_verified": 369, + "dump_sha256": "d7c0767888ce08fcb078020cefe7a83634849939c6d436911475d6779a640c01", + "files_sha256": "e3b297c870dd26676004c495c1893cebf68be0ccbc013b2c073b93f63a4643e6", + "restore_verified": false + }, + "restore": { + "restore_verified": true, + "tables_verified": 174, + "container_network": "none", + "database": "l1_secondhand_restore_20261024", + "port": 55441, + "source_dump_sha256": "d7c0767888ce08fcb078020cefe7a83634849939c6d436911475d6779a640c01", + "active_database_writes": 0 + } + } +} diff --git a/docs/investmoz/simulations/l1-secondhand-readonly-rollback-20261025.patch b/docs/investmoz/simulations/l1-secondhand-readonly-rollback-20261025.patch new file mode 100644 index 00000000..3ec07ad2 --- /dev/null +++ b/docs/investmoz/simulations/l1-secondhand-readonly-rollback-20261025.patch @@ -0,0 +1,10 @@ +--- a/resources/js/lib/iva-secondhand.ts ++++ b/resources/js/lib/iva-secondhand.ts +@@ -74,6 +74,7 @@ + function key(draft:Record,book:SecondhandBook):string{return JSON.stringify({version:secondhandVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},currency:draft.currency,rows:book.rows});} + export function secondhandCurrent(draft:Record,book:SecondhandBook):boolean{return!!book.result&&book.result.sourceKey===key(draft,book);} + export function recordSecondhands(draft:Record,book:SecondhandBook):SecondhandBook{ ++ throw new Error('Novos cálculos P092/P093/P125 temporariamente suspensos;dados,histórico,relatórios e restantes ramos preservados.'); + if(!book.rows.length||new Set(book.rows.map(row=>row.id)).size!==book.rows.length)throw new Error('Indique operações com identificadores distintos;originais conservados.'); + const result:SecondhandCalculation={version:secondhandVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:secondhandSource,inputs:structuredClone(book.rows),rows:book.rows.map(row=>evaluateSecondhand(row,draft.currency))}; + const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveSecondhandBook(draft,next);return next;