assertSame('simulator_fiscal_delta_20261021_test', $target->name); $this->assertSame(55441, (int) $target->port); config(['investor-path.enabled' => true, 'suitecrm.enabled' => false]); $this->actingAs(User::factory()->create(['email_verified_at' => now()])); $draft = json_decode(file_get_contents(base_path('outputs/irpc-mrfta/calculated.json')), true, flags: JSON_THROW_ON_ERROR); $personal = ['person_type' => $draft['person_type']]; unset($draft['person_type']); $id = $this->postJson('/api/v1/simulation-drafts', ['personal_snapshot' => $personal, 'economic_snapshot' => $draft], ['Idempotency-Key' => (string) Str::uuid()])->assertCreated()->json('data.id'); $recovered = $this->getJson('/api/v1/simulation-drafts/'.$id)->assertOk()->json('data.economic_snapshot'); $this->assertSame($draft['modelo_a_snapshot'], $recovered['modelo_a_snapshot']); $store = json_decode($recovered['modelo_a_snapshot'], true, flags: JSON_THROW_ON_ERROR); $book = $store['irpcWithholdings'][$draft['context_opportunity']]; $model = $book['mrftaResult']['model']; $this->assertSame('2026-10', $model['period']); $this->assertSame('20000', $model['principal']['numerator']); $this->assertSame('3000', $model['paid']['numerator']); $this->assertSame('500', $model['interest']['numerator']); $this->assertSame('17500', $model['total']['numerator']); $this->assertSame([], $model['pending']); $this->assertSame('999', $model['lines'][0]['cer']); $this->assertStringContainsString('fictício', $model['input']['codes'][0]['reference']); $this->assertNotEmpty($book['history']); file_put_contents(base_path('outputs/irpc-mrfta/recovered.json'), json_encode($recovered, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE)); } }