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 -7
View File
@@ -1,4 +1,5 @@
<?php
namespace Tests\Feature;
use App\Models\User;
@@ -27,16 +28,18 @@ final class IvaCurrencyEventDraftTest extends TestCase
$store = json_decode($recovered['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
$book = $store['currencyEvents']['opportunity:357'];
$this->assertCount(15, $book['rows']);
$this->assertSame('conditional',$book['result']['rows'][0]['status']);
$this->assertSame('64500.00',$book['result']['rows'][0]['scenarioAmount']);
$this->assertSame('2026-12-10',$book['result']['rows'][13]['eventDate']);
$this->assertSame(['200.00','800.00'],array_column($book['result']['rows'][14]['dueEvents'],'amount'));
$this->assertSame('conditional', $book['result']['rows'][0]['status']);
$this->assertSame('64500.00', $book['result']['rows'][0]['scenarioAmount']);
$this->assertSame('2026-12-10', $book['result']['rows'][13]['eventDate']);
$this->assertSame(['200.00', '800.00'], array_column($book['result']['rows'][14]['dueEvents'], 'amount'));
foreach ($book['result']['rows'] as $row) {
$this->assertNull($row['baseAmount']);$this->assertNull($row['vat']);$this->assertNull($row['rate']);
$this->assertNull($row['baseAmount']);
$this->assertNull($row['vat']);
$this->assertNull($row['rate']);
}
$this->assertSame($book['rows'], $book['result']['inputs']);
$this->assertCount(1, $book['history']);
$this->assertSame('64500.00',$book['history'][0]['rows'][0]['scenarioAmount']);
$this->assertSame('64500.00', $book['history'][0]['rows'][0]['scenarioAmount']);
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-currency-events-preserved.json')), true, flags: JSON_THROW_ON_ERROR);
$prior = json_decode($frozen['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
$this->assertSame($prior, array_diff_key($store, ['currencyEvents' => true]));
@@ -47,4 +50,3 @@ final class IvaCurrencyEventDraftTest extends TestCase
file_put_contents(base_path('outputs/iva-l1-currency-events-20261025/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE));
}
}