## Summary - remove legacy tenant-scoped routing and middleware paths in favor of the current environment/workspace context flow - update Filament pages and resources to use the cleaned-up admin surface and environment filter context - add the related spec 317 artifacts and targeted tests for environment filter state and legacy context cleanup ## Testing - not run as part of this commit/push/PR workflow Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #372
53 lines
1.7 KiB
PHP
53 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Support\Tenants;
|
|
|
|
use App\Models\ManagedEnvironment;
|
|
use App\Models\ManagedEnvironmentOnboardingSession;
|
|
use App\Models\User;
|
|
use App\Support\Navigation\AdminSurfaceScope;
|
|
|
|
final readonly class TenantOperabilityContext
|
|
{
|
|
public function __construct(
|
|
public ManagedEnvironment $tenant,
|
|
public ?User $actor,
|
|
public ?int $workspaceId,
|
|
public TenantInteractionLane $lane,
|
|
public ?AdminSurfaceScope $pageCategory = null,
|
|
public ?string $linkedRecordType = null,
|
|
public ?int $linkedRecordId = null,
|
|
public ?ManagedEnvironmentOnboardingSession $onboardingDraft = null,
|
|
public ?string $requiredCapability = null,
|
|
public ?ManagedEnvironment $selectedTenant = null,
|
|
) {}
|
|
|
|
public static function forTenant(
|
|
ManagedEnvironment $tenant,
|
|
?User $actor = null,
|
|
?int $workspaceId = null,
|
|
TenantInteractionLane $lane = TenantInteractionLane::AdministrativeManagement,
|
|
?AdminSurfaceScope $pageCategory = null,
|
|
?ManagedEnvironmentOnboardingSession $onboardingDraft = null,
|
|
?string $requiredCapability = null,
|
|
?ManagedEnvironment $selectedTenant = null,
|
|
?string $linkedRecordType = null,
|
|
?int $linkedRecordId = null,
|
|
): self {
|
|
return new self(
|
|
tenant: $tenant,
|
|
actor: $actor,
|
|
workspaceId: $workspaceId,
|
|
lane: $lane,
|
|
pageCategory: $pageCategory,
|
|
linkedRecordType: $linkedRecordType,
|
|
linkedRecordId: $linkedRecordId,
|
|
onboardingDraft: $onboardingDraft,
|
|
requiredCapability: $requiredCapability,
|
|
selectedTenant: $selectedTenant,
|
|
);
|
|
}
|
|
}
|