## Summary - add a shared tenant lifecycle presentation contract and referenced-tenant adapter for canonical lifecycle labels and helper copy - align tenant, chooser, onboarding, archived-banner, and tenantless operation viewer surfaces with the shared lifecycle vocabulary - add Spec 146 design artifacts, audit notes, and regression coverage for lifecycle presentation across Filament and onboarding surfaces ## Validation - `vendor/bin/sail bin pint --dirty --format agent` - `vendor/bin/sail artisan test --compact tests/Feature/Badges/TenantStatusBadgeTest.php tests/Unit/Badges/TenantBadgesTest.php tests/Unit/Tenants/TenantLifecycleTest.php tests/Unit/Support/Tenants/TenantLifecyclePresentationTest.php tests/Feature/Filament/TenantLifecyclePresentationAcrossTenantSurfacesTest.php tests/Feature/Filament/ReferencedTenantLifecyclePresentationTest.php tests/Feature/Filament/TenantLifecycleStatusDomainSeparationTest.php tests/Feature/Filament/TenantViewHeaderUiEnforcementTest.php tests/Feature/Onboarding/TenantLifecyclePresentationCopyTest.php tests/Feature/Onboarding/OnboardingDraftAuthorizationTest.php tests/Feature/Onboarding/OnboardingDraftLifecycleTest.php` ## Notes - Livewire v4.0+ compliance preserved; this change is presentation-only on existing Filament v5 surfaces. - Panel provider registration remains unchanged in `bootstrap/providers.php`. - No global-search behavior changed; no resource was newly made globally searchable or disabled. - No destructive actions were added or changed. - No asset registration strategy changed; existing deploy flow for `php artisan filament:assets` remains unchanged. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #175
2.3 KiB
2.3 KiB
Quickstart: Central Tenant Status Presentation
Goal
Implement a shared tenant lifecycle presentation contract that keeps draft, onboarding, active, and archived explicit and consistent across tenant management surfaces and the tenantless operations viewer surface.
Prerequisites
- Work on branch
146-central-tenant-status-presentation - Sail services available for running tests and formatting
- Review these existing code anchors before implementation:
app/Support/Tenants/TenantLifecycle.phpapp/Support/Badges/BadgeCatalog.phpapp/Support/Badges/Domains/TenantStatusBadge.phpapp/Services/Tenants/TenantOperabilityService.phpapp/Filament/Resources/TenantResource.phpresources/views/filament/pages/choose-tenant.blade.phpapp/Filament/Pages/Operations/TenantlessOperationRunViewer.phpapp/Filament/Resources/OperationRunResource.php
Suggested Implementation Order
- Add a central lifecycle presentation object or presenter in the tenant/support layer.
- Refactor badge-only lifecycle rendering to source label, tone, and icon from that contract without breaking BADGE-001.
- Add concise and detailed helper-text variants for surfaces that need more than a badge.
- Update tenant list/detail surfaces to consume the new contract.
- Update choose-tenant and onboarding-linked lifecycle wording to use the canonical lifecycle vocabulary.
- Update the tenantless operations viewer referenced-tenant context, including the
OperationRunResourceenterprise-detail summary payload, to use the same contract. - Add focused unit and feature regression tests for all four lifecycle states and invalid fallback behavior.
- Run formatting and focused tests through Sail.
Focused Validation Commands
vendor/bin/sail artisan test --compact tests/Unit
vendor/bin/sail artisan test --compact tests/Feature/Filament
vendor/bin/sail artisan test --compact tests/Feature/Onboarding
vendor/bin/sail bin pint --dirty --format agent
Expected Outcomes
- Canonical lifecycle states never render as Unknown.
- Tenant list/detail and tenantless operations viewer surfaces reuse one lifecycle vocabulary.
- Lifecycle remains visually and semantically separate from provider, RBAC, verification, and run status.
- Invalid-data fallback is explicit and test-covered.