fix: complete InvesteMoz validation and error corrections
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Models\User;
|
||||
@@ -27,15 +28,16 @@ final class IvaSecondhandDraftTest extends TestCase
|
||||
$store = json_decode($recovered['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
|
||||
$book = $store['regulatedSecondhands']['opportunity:354'];
|
||||
$this->assertCount(8, $book['rows']);
|
||||
$this->assertSame(array_merge(array_fill(0,4,'reseller_margin'),array_fill(0,4,'auction_margin')),array_column($book['rows'],'treatment'));
|
||||
$this->assertSame(array_merge(array_fill(0,4,'138.00'),array_fill(0,4,'344.83')),array_column($book['result']['rows'],'baseAmount'));
|
||||
$this->assertSame(array_fill(0,8,'qualified_goods'),array_column($book['result']['rows'],'classification'));
|
||||
$this->assertSame(array_merge(array_fill(0, 4, 'reseller_margin'), array_fill(0, 4, 'auction_margin')), array_column($book['rows'], 'treatment'));
|
||||
$this->assertSame(array_merge(array_fill(0, 4, '138.00'), array_fill(0, 4, '344.83')), array_column($book['result']['rows'], 'baseAmount'));
|
||||
$this->assertSame(array_fill(0, 8, 'qualified_goods'), array_column($book['result']['rows'], 'classification'));
|
||||
foreach ($book['result']['rows'] as $row) {
|
||||
$this->assertNull($row['vat']);$this->assertNull($row['rate']);
|
||||
$this->assertNull($row['vat']);
|
||||
$this->assertNull($row['rate']);
|
||||
}
|
||||
$this->assertSame($book['rows'], $book['result']['inputs']);
|
||||
$this->assertCount(1, $book['history']);
|
||||
$this->assertSame('138.00',$book['history'][0]['rows'][0]['baseAmount']);
|
||||
$this->assertSame('138.00', $book['history'][0]['rows'][0]['baseAmount']);
|
||||
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-secondhand-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, ['regulatedSecondhands' => true]));
|
||||
@@ -46,4 +48,3 @@ final class IvaSecondhandDraftTest extends TestCase
|
||||
file_put_contents(base_path('outputs/iva-l1-secondhand-20261025/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user