assertSame('continuity_20261120_test', $identity->name); $this->assertSame(55441, (int) $identity->port); config(['investor-path.enabled' => true]); $owner = User::factory()->create(); $cases = []; foreach (['Hotel sintético QA' => '250.50', 'Agronegócio sintético QA' => '375.25'] as $title => $price) { $case = app(VirtualDesk::class)->createCase($owner, ['title' => $title, 'client_key' => (string) Str::uuid(), 'reuse_consent' => true]); $snapshot = json_encode(['version' => 17, 'plan' => ['currency' => 'MZN', 'products' => [['label' => $title, 'monthlyUnits' => '25', 'unitPrice' => $price, 'unitVariableCost' => '100.50']], 'monthlyOperatingExpenses' => '500.25', 'salesCollectionPercent' => '', 'openingReceivablesCollectionPercent' => '']], JSON_THROW_ON_ERROR); $this->actingAs($owner)->postJson('/api/v1/simulation-drafts', ['context' => $case->id, 'personal_snapshot' => [], 'economic_snapshot' => ['purpose' => 'simulate_only', 'journey_type' => 'small_business', 'business_plan_snapshot' => $snapshot]], ['Idempotency-Key' => (string) Str::uuid()])->assertCreated(); $cases[] = [$case->id, $snapshot]; } $this->flushSession(); foreach ($cases as [$caseId, $snapshot]) { $this->actingAs(User::findOrFail($owner->id))->getJson('/api/v1/simulation-drafts/current?context='.$caseId)->assertOk()->assertJsonPath('data.economic_snapshot.business_plan_snapshot', $snapshot); } $this->actingAs(User::factory()->create())->getJson('/api/v1/simulation-drafts/current?context='.$cases[0][0])->assertForbidden(); } }