Update tenant lifecycle tooling and retire docs/process

This commit is contained in:
Codex Agent
2026-01-01 17:02:08 +01:00
parent 1e57fc1046
commit 405a4b7340
44 changed files with 631 additions and 860 deletions

View File

@@ -0,0 +1,45 @@
<?php
namespace Tests\Feature;
use App\Filament\Resources\TenantResource;
use App\Models\Tenant;
use App\Models\TenantNotificationLog;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class TenantLifecycleViewTest extends TestCase
{
use RefreshDatabase;
public function test_view_page_shows_lifecycle_timeline(): void
{
$user = User::factory()->create(['role' => 'super_admin']);
$tenant = Tenant::factory()->create([
'last_activity_at' => now()->subDay(),
'pending_deletion_at' => now()->addDays(10),
'deletion_warning_sent_at' => now()->subHours(2),
]);
TenantNotificationLog::query()->create([
'tenant_id' => $tenant->id,
'type' => 'retention_warning',
'channel' => 'mail',
'recipient' => 'owner@example.com',
'status' => 'sent',
'context' => ['source' => 'test'],
'sent_at' => now()->subHour(),
]);
$this->actingAs($user, 'super_admin');
$url = TenantResource::getUrl('view', ['record' => $tenant], panel: 'superadmin');
$this->get($url)
->assertOk()
->assertSee(__('admin.tenants.timeline.created'))
->assertSee(__('admin.tenants.timeline.deletion_scheduled'))
->assertSee(__('admin.tenants.timeline.notification_sent'));
}
}