fix: complete InvesteMoz validation and error corrections

This commit is contained in:
2026-10-29 21:47:33 +02:00
parent 63147312e2
commit daf8623441
718 changed files with 127308 additions and 20959 deletions
+9 -4
View File
@@ -1,4 +1,5 @@
<?php
namespace Tests\Feature;
use App\Models\User;
@@ -11,7 +12,7 @@ final class IvaAcquisitionBCDraftTest extends TestCase
{
use DatabaseTransactions;
public function test_customs_exclusions_recover_with_sources_totals_history_and_preserved_A(): void
public function test_customs_exclusions_recover_with_sources_totals_history_and_preserved_a(): void
{
$target = DB::selectOne('select current_database() as name,inet_server_port() as port');
$this->assertSame('simulator_fiscal_delta_20261021_test', $target->name);
@@ -25,7 +26,7 @@ final class IvaAcquisitionBCDraftTest extends TestCase
$store = json_decode($recovered['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
$book = $store['books']['opportunity:369'];
$this->assertCount(4, $book['rows']);
$this->assertSame(['eligible','eligible','no_right','eligible'], array_column(array_column($book['result']['rows'], 'eligibility'), 'status'));
$this->assertSame(['eligible', 'eligible', 'no_right', 'eligible'], array_column(array_column($book['result']['rows'], 'eligibility'), 'status'));
$this->assertSame('40.00', $book['result']['periods'][0]['fields']['15']);
$this->assertCount(1, $book['history']);
$this->assertSame('16.00', $book['result']['periods'][0]['fields']['11']);
@@ -34,8 +35,12 @@ final class IvaAcquisitionBCDraftTest extends TestCase
$this->assertSame('yes', $book['rows'][0]['bc']['belongs']);
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-l2bc-preserved.json')), true, flags: JSON_THROW_ON_ERROR);
foreach (json_decode($frozen['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR) as $key => $map) {
if ($key === 'version') continue;
foreach ($map as $context => $original) $this->assertSame($original, $store[$key][$context]);
if ($key === 'version') {
continue;
}
foreach ($map as $context => $original) {
$this->assertSame($original, $store[$key][$context]);
}
}
file_put_contents(base_path('outputs/iva-l2-bc-20261025/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE));
}