Files
SGF/scripts/sgf-coverage-reconciliation-proof.php
2026-11-11 15:04:01 +02:00

3 lines
1.4 KiB
PHP

<?php
require __DIR__.'/sgf-single-bootstrap.php';$c=App\Modules\Services\FiscalCoverage::describe();$checks=[];$ok=function($v,$n)use(&$checks){if(!$v)throw new LogicException($n);$checks[]=$n;};$tax=collect($c['taxes'])->keyBy('id');foreach(['irps','inss']as$key){$ok($tax[$key]['state']==='partial'&&is_string($tax[$key]['available']),'existing internal capability acknowledged '.$key);$ok($tax[$key]['legal_use']===false&&preg_match('/leg(?:al|ais)/u',$tax[$key]['pending'])===1,'legal gap preserved '.$key);}$management=collect($c['management'])->keyBy('id');$ok(str_contains($management['human_resources']['available'],'autónomo')&&str_contains($management['human_resources']['available'],'férias'),'autonomous HR delivered operations in coverage');$ok(str_contains($management['accounting']['available'],'parciais')&&str_contains($management['accounting']['pending'],'Activos'),'partial statements present assets explicitly absent');$ok($tax['irpc']['state']==='pending'&&$tax['ice']['state']==='pending'&&!$c['legal_validation']&&!$c['official_submission_enabled'],'no unimplemented engine or legal activation inferred');file_put_contents($work.'/coverage-reconciliation.json',json_encode(['passed'=>true,'checks'=>$checks,'database_writes'=>0,'new_grants'=>0],JSON_PRETTY_PRINT));echo json_encode(['passed'=>true,'checks'=>count($checks),'proof'=>$work.'/coverage-reconciliation.json']).PHP_EOL;