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
@@ -8,10 +8,12 @@ use App\Services\DeclaredOriginStatistics;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Str;
use Inertia\Testing\AssertableInertia as Assert;
use Tests\Support\AuthenticatesQaActors;
use Tests\TestCase;
class PortalOriginCompatibilityTest extends TestCase
{
use AuthenticatesQaActors;
use RefreshDatabase;
private function payload(): array
@@ -22,6 +24,7 @@ class PortalOriginCompatibilityTest extends TestCase
public function test_public_api_preserves_explicit_origin_in_receipt_replay_and_statistics(): void
{
$this->actingAs(User::factory()->create());
config(['portal.notifications_enabled' => false]);
$headers = ['Idempotency-Key' => (string) Str::uuid()];
$data = [...$this->payload(), 'declared_origin_country_code' => 'PT'];
@@ -37,6 +40,7 @@ class PortalOriginCompatibilityTest extends TestCase
$this->postJson('/api/v1/interest-requests', $this->payload(), ['Idempotency-Key' => (string) Str::uuid()])->assertCreated();
$manager = User::factory()->create();
config(['portal.managers' => [$manager->email]]);
$this->actingAsWithMfa($manager);
$stats = app(DeclaredOriginStatistics::class)->forManager($manager);
$this->assertSame([null, 'PT'], array_column($stats['interests'], 'code'));
$this->assertSame([1, 1], array_column($stats['interests'], 'count'));