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,21 +28,24 @@ final class IvaDigitalDraftTest extends TestCase
|
||||
$store = json_decode($recovered['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
|
||||
$book = $store['digitalOperations']['opportunity:359'];
|
||||
$this->assertCount(46, $book['rows']);
|
||||
$this->assertSame('national',$book['result']['rows'][0]['territory']);
|
||||
$this->assertSame('acquirer',$book['result']['rows'][0]['responsible']);
|
||||
$this->assertSame('2027-01-10',$book['result']['rows'][0]['declarationReferenceDate']);
|
||||
$this->assertSame('outside',$book['result']['rows'][1]['territory']);
|
||||
$this->assertSame('provider',$book['result']['rows'][2]['responsible']);
|
||||
$this->assertSame('national',$book['result']['rows'][42]['territory']);
|
||||
$this->assertSame('indeterminate',$book['result']['rows'][42]['responsible']);
|
||||
$this->assertSame('representative',$book['result']['rows'][44]['responsible']);
|
||||
$this->assertSame('acquirer',$book['result']['rows'][45]['responsible']);
|
||||
$this->assertSame('national', $book['result']['rows'][0]['territory']);
|
||||
$this->assertSame('acquirer', $book['result']['rows'][0]['responsible']);
|
||||
$this->assertSame('2027-01-10', $book['result']['rows'][0]['declarationReferenceDate']);
|
||||
$this->assertSame('outside', $book['result']['rows'][1]['territory']);
|
||||
$this->assertSame('provider', $book['result']['rows'][2]['responsible']);
|
||||
$this->assertSame('national', $book['result']['rows'][42]['territory']);
|
||||
$this->assertSame('indeterminate', $book['result']['rows'][42]['responsible']);
|
||||
$this->assertSame('representative', $book['result']['rows'][44]['responsible']);
|
||||
$this->assertSame('acquirer', $book['result']['rows'][45]['responsible']);
|
||||
foreach ($book['result']['rows'] as $row) {
|
||||
$this->assertNull($row['deduction']);$this->assertNull($row['baseAmount']);$this->assertNull($row['vat']);$this->assertNull($row['rate']);
|
||||
$this->assertNull($row['deduction']);
|
||||
$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('national',$book['history'][0]['rows'][0]['territory']);
|
||||
$this->assertSame('national', $book['history'][0]['rows'][0]['territory']);
|
||||
$frozen = json_decode(file_get_contents(base_path('tests/frontend/fixtures/iva-digital-preserved.json')), true, flags: JSON_THROW_ON_ERROR);
|
||||
$prior = json_decode($frozen['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR);
|
||||
$preserved = array_diff_key($store, ['digitalOperations' => true]);
|
||||
@@ -53,4 +57,3 @@ final class IvaDigitalDraftTest extends TestCase
|
||||
file_put_contents(base_path('outputs/iva-l1-digital-20261025/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user