diff --git a/docs/investmoz/simulations/l1-currency-events-delivery-20261025.json b/docs/investmoz/simulations/l1-currency-events-delivery-20261025.json new file mode 100644 index 00000000..717ae206 --- /dev/null +++ b/docs/investmoz/simulations/l1-currency-events-delivery-20261025.json @@ -0,0 +1,170 @@ +{ + "status": "ready_after_fresh_authenticated_preflight_and_verified_backup_restore", + "candidate": "0052cd42d2755753b7e54257db05df8fbd9f08bc", + "base_installed": "92eaa93570b96561a0d2ab60787b7af8171c9529", + "coverage_complete_branches": { + "AUD-SIM-L1-P131": [ + "goods_available", + "goods_transport", + "goods_installation", + "service_completed", + "service_early_charge", + "import_clearance", + "import_auction", + "continuous_period", + "contract_effects" + ], + "AUD-SIM-L1-P132": [ + "own_goods", + "own_services", + "commission_delivery", + "consignment_deadline", + "advance_payment" + ] + }, + "coverage_partial": { + "AUD-SIM-L1-P104": "Preparação e simulação cambial condicionada,gravação/recuperação/histórico/relatório;moeda original,taxa,direcção,data,fonte e pressuposto explícitos. Não fechaP104 e não confirma base fiscal. Falta obter/cotejar disposição de conversão da Lei2/2006 referida em15(8),seu momento/regra e correspondência em2026." + }, + "branch_count_complete": 2, + "event_treatment_count": 14, + "conditional_scenario_count": 1, + "runtime_delta": [ + { + "path": "resources/js/lib/iva-currency-events.ts", + "sha256_LF": "7133d1df2cf4171495bd145f5b8350938f0a3b4230af824c223d2b03cf0d9bb1" + }, + { + "path": "resources/js/components/simulation-currency-events.tsx", + "sha256_LF": "d103234361d57d0461d19a0f1fb9cbc5a714dbd566000478fad9aced585f32fa" + }, + { + "path": "resources/js/components/simulation-monthly-iva.tsx", + "sha256_LF": "44901ef5fc9def8ebd6c251d4af65f36a1cb330f5ed7d44db4a52d98753f18ff" + }, + { + "path": "resources/js/lib/project-dossier.ts", + "sha256_LF": "1712be726c868d182a2ddf405331dcc1f55bf0c3ce72ad32ab758c15afef2f4a" + }, + { + "path": "resources/js/lib/business-financial-plan.ts", + "sha256_LF": "c20274722d1ffcd0360f041a6cacb5d868fe0621cb27a1aca6e06826612c3ebb" + } + ], + "counts_before": { + "delivered": 118, + "QA": 2, + "functional_pending": 12, + "documentary": 1, + "total": 133 + }, + "counts_current": { + "delivered": 118, + "QA": 2, + "functional_pending": 12, + "documentary": 1, + "total": 133 + }, + "counts_after_delivery": { + "delivered": 120, + "QA": 0, + "functional_pending": 12, + "documentary": 1, + "total": 133 + }, + "QA_proofs_reused": [ + "iva-l1-currency-events-qa-20261025.json" + ], + "authorization": "Tempo explicitly requests one joint delivery0052cd42/P131/P132;P104 may accompany only as conditionalconversion,notfiscalclosure;concurrentchanges preserved,installeddeltaonly", + "scope": "2026contexto;facto gerador7 e exigibilidade8 por data/âmbito;uma parcela de recebimento e restante por linha,ou parcelas de âmbitos distintos,sem agregação de totais entre linhas. Prazo de emissão é parâmetro legal identificado,não calendário presumido;importação segue7c. P104parcial não aplica câmbio fiscal.Sem nova base/IVA,taxa,dedução,campo11,regularização ou totaisModeloA;P133regimes suspensivos/viagens mantém âmbito separado.", + "source": "CIVA Lei13/2016:7(1)–(7),PDF8/p1426(266);8,PDF9/p1426(267);15(8),PDF14/p1426(272),páginas visualmente conferidas.Lei22/2022 eLei10/2025 não alteram7/8;15(8)mantido.RIVADecreto7/2008,21,PDF4:regra histórica5dias úteis e excepções;prazo actual não automatizado,exige disposição/calendário/âmbito identificados.", + "meaning": { + "P131": "Eventos7(1)a/b/c,7(2),7(3),7(7):disponibilização,início transporte,instalação/montagem concluída,serviço realizado/cobrado ou debitado antecipadamente pelo montante respectivo,desembaraço/arrematação/venda na importação,termo do período sucessivo,efeitos translativos com excepções3(3)a/b. Facto gerador separado de exigibilidade8;factura comercial não desloca evento aduaneiro.", + "P132": "Eventos7(4)/(5)/(6) e8c:afectações/transmissões assimiladas3(3)e/f,serviços4(2),disponibilização pelo comissário,termo180dias de mercadorias à consignação3(3)d e pagamentos anteriores à factura. Corrigida remissão a consignação,não embalagensP102.8a/b/c separam parcela recebida e restante,sem dupla contagem." + }, + "P104_partial_condition": "Conversão condicionada,sem base fiscal confirmada.Preserva moeda,taxa,direcção,data,fonte e regra/pressuposto.Exemplar/disposição cambialLei2/2006 deve ser cotejado antes de fecharP104.P104continua nos12pendentes.", + "documentary_research_delimited": { + "P104": { + "finding": "Remissão15(8) para Lei2/2006 identificada;artigo de conversão e parâmetros ainda não cotejados em exemplar íntegro.", + "attempts": [ + "Acervo local seisPDF semLei2/2006", + "Pesquisa Lei2/2006/CIP identificaBR12-I22/03/2006", + "PDF primário platformchinaplp devolveu404;DLA recusou/timeout;archiveBR2006 devolveu403" + ], + "next_action": "Obter exemplar íntegroLei2/2006 e identificar disposição de conversão/momento/regra;reutilizar rascunhos,sem validação jurídica genérica." + }, + "RIVA21": { + "primary_notice": "https://portaldogoverno.gov.mz/governo-introduz-alteracoes-nos-regulamentos-fiscais-para-reforcar-eficiencia-tributaria/", + "finding": "Anúncio governamental inclui alteração21;anúncio não substitui texto normativo/publicação. Prazo não presumido5dias úteis por defeito;campo exige termo/disposição/calendário aplicáveis.", + "next_action": "Localizar texto publicado da alteração21 para eventual automatização do prazo;motor8já opera com parâmetro concreto identificado." + } + }, + "preservation": "118priorclosures andpartialP084/P085 preserved;one integration/backup/realisolatedrestore/check;QAproofsreused", + "partial_P084_P085": "Preparation/conditional simulation only;benefits pending;no closure", + "limits": "L1aberto;P00105/06;bebidasL2/L3;Estatísticas/IAadiadas", + "containment": "l1-currency-events-readonly-rollback-20261025.patch,checked only,not applied;blocks newP131/P132/conditionalP104calculations,preserves readers/history/otherbranches", + "authenticated_preflight": { + "installed": { + "status": "installed", + "commit": "92eaa93570b96561a0d2ab60787b7af8171c9529", + "release": "/var/www/investmoz-homologacao/releases/92eaa93570b96561a0d2ab60787b7af8171c9529-d4d7a2a2", + "previous_release": "/var/www/investmoz-homologacao/releases/ce9d649fbf631b584cb521ce120c98a4cb459c13-f7d31a27", + "database_migrations": 0, + "content_imports": 0 + }, + "current_link": "/var/www/investmoz-homologacao/releases/92eaa93570b96561a0d2ab60787b7af8171c9529-d4d7a2a2", + "release_revision": { + "commit": "92eaa93570b96561a0d2ab60787b7af8171c9529", + "branch": "main", + "built_at": "2026-10-24T22:52:27.789891+00:00", + "manifest_sha256": "52e638801184578d481f490734a4b98f8f557625e81fd942348a2067bfc0f58b" + }, + "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-currency-events-delivery-20261025/backup", + "target": { + "database": "teste_investidor", + "port": 5432 + }, + "tables": 174, + "files_verified": 369, + "dump_sha256": "3bf9ce6052b554884fc9073ef094df83e4061a4acf9698aa4b86746372a933b3", + "files_sha256": "bfdc60b76ce1da29199eeb9f21503350c94da165ba2458fcb26f57c96bde995b", + "restore_verified": false + }, + "restore": { + "restore_verified": true, + "tables_verified": 174, + "container_network": "none", + "database": "l1_currency_events_restore_20261024", + "port": 55441, + "source_dump_sha256": "3bf9ce6052b554884fc9073ef094df83e4061a4acf9698aa4b86746372a933b3", + "active_database_writes": 0 + } + } +} diff --git a/docs/investmoz/simulations/l1-currency-events-readonly-rollback-20261025.patch b/docs/investmoz/simulations/l1-currency-events-readonly-rollback-20261025.patch new file mode 100644 index 00000000..4169e80d --- /dev/null +++ b/docs/investmoz/simulations/l1-currency-events-readonly-rollback-20261025.patch @@ -0,0 +1,9 @@ +--- a/resources/js/lib/iva-currency-events.ts ++++ b/resources/js/lib/iva-currency-events.ts +@@ -90,5 +90,5 @@ + } + function key(draft:Record,book:CurrencyEventBook):string{return JSON.stringify({version:currencyEventVersion,scope:acquisitionScope(draft),location:draft.selection_labels??{},rows:book.rows});} + export function currencyEventCurrent(draft:Record,book:CurrencyEventBook):boolean{return!!book.result&&book.result.sourceKey===key(draft,book);} +-export function recordCurrencyEvents(draft:Record,book:CurrencyEventBook):CurrencyEventBook{if(!book.rows.length||new Set(book.rows.map(r=>r.id)).size!==book.rows.length)throw new Error('Indique operações com identidades distintas;originais conservados.');const result:CurrencyEventCalculation={version:currencyEventVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:currencyEventSource,inputs:structuredClone(book.rows),rows:book.rows.map(evaluateCurrencyEvent)};const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveCurrencyEventBook(draft,next);return next;} ++export function recordCurrencyEvents(draft:Record,book:CurrencyEventBook):CurrencyEventBook{throw new Error('Novas versões P131/P132 e cenários condicionados P104 temporariamente suspensos;dados,histórico e relatórios preservados.');if(!book.rows.length||new Set(book.rows.map(r=>r.id)).size!==book.rows.length)throw new Error('Indique operações com identidades distintas;originais conservados.');const result:CurrencyEventCalculation={version:currencyEventVersion,revision:(book.result?.revision??0)+1,calculatedAt:new Date().toISOString(),opportunity:acquisitionScope(draft),location:JSON.stringify(draft.selection_labels??{}),sourceKey:key(draft,book),source:currencyEventSource,inputs:structuredClone(book.rows),rows:book.rows.map(evaluateCurrencyEvent)};const next={...book,result,history:[...(book.history??[]),...(book.result?[book.result]:[])]};saveCurrencyEventBook(draft,next);return next;} + export function currencyEventReportRows(draft:Record):Array<[string,string,string,string]>{try{const book=currencyEventBook(draft),r=book.result;if(!r)return[];return r.inputs.map((row,i)=>['IVA mensal',`${currencyEventTreatments.find(t=>t.id===row.treatment)?.branch??'Evento'} — ${row.period} — ${row.id}`,`${row.description};${r.rows[i].reason};facto gerador:${r.rows[i].eventDate??'Indeterminado/não apurado'};parcelas:${r.rows[i].dueEvents.map(p=>p.date+': '+(p.amount??'Montante indeterminado')+' '+row.currency+' ('+p.reason+')').join('; ')||'Nenhuma apurada'};restante pendente:${r.rows[i].status==='indeterminate'?'Indeterminado':r.rows[i].remainingPending?'Sim':'Não'};cenário condicionado:${r.rows[i].scenarioAmount??'Indeterminado'};base/IVA:Indeterminados`,`${r.opportunity};${r.location};${currencyEventCurrent(draft,book)?'Resultado actual':'Entradas alteradas;resultado histórico conservado'};versão${r.revision};${r.calculatedAt};${r.source};${row.origin};documento ${row.documentRef},${row.documentDate};ambito ${row.scope};${row.treatment==='foreign_scenario'?`origem ${row.amount} ${row.sourceCurrency};taxa ${row.fxRate},${row.fxDirection},${row.fxDate};fonte ${row.fxSource};pressuposto ${row.fxRuleRef}`:`evento ${row.eventDate},${row.eventRef};outra data ${row.otherDate};conferencia ${row.reviewDate};factura ${row.invoiceRequired},${row.invoiceState},${row.invoiceDate},${row.invoiceRef};prazo ${row.legalDeadline},${row.deadlineRef};recebimento ${row.paymentState},${row.paymentDate},${row.paymentAmount},${row.paymentRef};total do ambito ${row.amount} ${row.currency}`};fundamento ${row.evidence};sem nova dedução/campo11/IVA ou activação cambial nos livros anteriores.`]);}catch{return[['IVA mensal','Moeda/eventos','Dados não recuperáveis','Originais preservados;sem substituição porzero.']];}}