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
@@ -1,4 +1,5 @@
<?php
namespace Tests\Feature;
use App\Models\User;
@@ -28,15 +29,15 @@ final class IvaCompositionBaseDraftTest extends TestCase
$book = $store['considerationCompositions']['opportunity:344'];
$this->assertCount(1, $book['rows']);
$this->assertCount(2, $book['rows'][0]['parts']);
$this->assertSame(['tax_component','accessory_component'], array_column($book['rows'][0]['parts'], 'treatment'));
$this->assertSame(['tax_component', 'accessory_component'], array_column($book['rows'][0]['parts'], 'treatment'));
$this->assertSame(['1150.60'], array_column($book['result']['rows'], 'baseAmount'));
$this->assertSame(['determined'], array_column($book['result']['rows'], 'status'));
$this->assertSame([null], array_column($book['result']['rows'], 'vat'));
$this->assertSame([null], array_column($book['result']['rows'], 'rate'));
$this->assertSame('1000.25', $book['rows'][0]['initialAmount']);
$this->assertSame(['100.10','50.25'], array_column($book['rows'][0]['parts'], 'amount'));
$this->assertSame(['no','no'], array_column($book['rows'][0]['parts'], 'included'));
$this->assertSame(['yes','yes'], array_column($book['rows'][0]['parts'], 'ownVatExcluded'));
$this->assertSame(['100.10', '50.25'], array_column($book['rows'][0]['parts'], 'amount'));
$this->assertSame(['no', 'no'], array_column($book['rows'][0]['parts'], 'included'));
$this->assertSame(['yes', 'yes'], array_column($book['rows'][0]['parts'], 'ownVatExcluded'));
$this->assertStringContainsString('operação A', $book['rows'][0]['operationRef']);
$this->assertStringContainsString('próprioIVA', $book['rows'][0]['initialRef']);
$this->assertStringContainsString('referência tax_component', $book['rows'][0]['parts'][0]['reference']);
@@ -55,4 +56,3 @@ final class IvaCompositionBaseDraftTest extends TestCase
file_put_contents(base_path('outputs/iva-l1-g7f-composition-20261024/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE));
}
}