TenantAtlas/specs/146-central-tenant-status-presentation/quickstart.md
ahmido 6ca496233b feat: centralize tenant lifecycle presentation (#175)
## 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
2026-03-16 18:18:53 +00:00

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.php
    • app/Support/Badges/BadgeCatalog.php
    • app/Support/Badges/Domains/TenantStatusBadge.php
    • app/Services/Tenants/TenantOperabilityService.php
    • app/Filament/Resources/TenantResource.php
    • resources/views/filament/pages/choose-tenant.blade.php
    • app/Filament/Pages/Operations/TenantlessOperationRunViewer.php
    • app/Filament/Resources/OperationRunResource.php

Suggested Implementation Order

  1. Add a central lifecycle presentation object or presenter in the tenant/support layer.
  2. Refactor badge-only lifecycle rendering to source label, tone, and icon from that contract without breaking BADGE-001.
  3. Add concise and detailed helper-text variants for surfaces that need more than a badge.
  4. Update tenant list/detail surfaces to consume the new contract.
  5. Update choose-tenant and onboarding-linked lifecycle wording to use the canonical lifecycle vocabulary.
  6. Update the tenantless operations viewer referenced-tenant context, including the OperationRunResource enterprise-detail summary payload, to use the same contract.
  7. Add focused unit and feature regression tests for all four lifecycle states and invalid fallback behavior.
  8. 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.