TenantAtlas/apps/platform/app/Support/OperateHub/ResolvedShellContext.php
ahmido b159dacd36 feat: clean up legacy tenant environment context (#372)
## 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
2026-05-16 18:25:36 +00:00

41 lines
1.0 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Support\OperateHub;
use App\Models\ManagedEnvironment;
use App\Models\Workspace;
use App\Support\Navigation\AdminSurfaceScope;
final readonly class ResolvedShellContext
{
public function __construct(
public ?Workspace $workspace,
public ?ManagedEnvironment $tenant,
public AdminSurfaceScope $pageCategory,
public string $state,
public string $displayMode,
public string $workspaceSource = 'none',
public string $tenantSource = 'none',
public string $recoveryAction = 'none',
public ?string $recoveryDestination = null,
public ?string $recoveryReason = null,
) {}
public function hasWorkspace(): bool
{
return $this->workspace instanceof Workspace;
}
public function hasTenant(): bool
{
return $this->tenant instanceof ManagedEnvironment;
}
public function showsRecoveryNotice(): bool
{
return $this->displayMode === 'recovery' || $this->recoveryReason !== null;
}
}